diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2019-08-05 20:12:15 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-05 20:12:15 -0400 |
commit | 046cccfe1768837fcd5b4c1fd7d52fb2d98c0b11 (patch) | |
tree | 387c54f8c52a42b5c4f363ffa352bf311c646df9 /core/shared_queue.rs | |
parent | a517513182221aa351528cf15d28c449b49fea13 (diff) |
Remove dispatch optimization (#2732)
Deno.core.dispatch() used to push the "control" buf onto the shared
array buffer before calling into V8, with the idea that it was one less
argument to parse. Turns out there is no more overhead passing the
control ArrayBuffer directly over. Furthermore this optimization was
making the refactors outlined in #2730 more complex. Therefore it is
being removed.
Diffstat (limited to 'core/shared_queue.rs')
-rw-r--r-- | core/shared_queue.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/core/shared_queue.rs b/core/shared_queue.rs index c33a37b90..616272f8d 100644 --- a/core/shared_queue.rs +++ b/core/shared_queue.rs @@ -103,6 +103,7 @@ impl SharedQueue { s[INDEX_OFFSETS + index] = end as u32; } + #[cfg(test)] fn get_end(&self, index: usize) -> Option<usize> { if index < self.num_records() { let s = self.as_u32_slice(); @@ -112,6 +113,7 @@ impl SharedQueue { } } + #[cfg(test)] fn get_offset(&self, index: usize) -> Option<usize> { if index < self.num_records() { Some(if index == 0 { @@ -126,6 +128,7 @@ impl SharedQueue { } /// Returns none if empty. + #[cfg(test)] pub fn shift(&mut self) -> Option<&[u8]> { let u32_slice = self.as_u32_slice(); let i = u32_slice[INDEX_NUM_SHIFTED_OFF] as usize; |