diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2022-07-22 19:06:32 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-22 19:06:32 +0530 |
commit | 4db650ddd57b85475d71c0b9fc84d37becab9d6a (patch) | |
tree | e32602ab92d4c117dbbd72ea9c7436964466187d /core/runtime.rs | |
parent | 03dc3b8972f460e40d0b75fc3207cae9fe4f60da (diff) |
Revert "feat(ops): V8 Fast Calls (#15122)" (#15276)
This reverts commit 03dc3b8972f460e40d0b75fc3207cae9fe4f60da.
Diffstat (limited to 'core/runtime.rs')
-rw-r--r-- | core/runtime.rs | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/core/runtime.rs b/core/runtime.rs index caadd0089..64e7f635c 100644 --- a/core/runtime.rs +++ b/core/runtime.rs @@ -230,7 +230,6 @@ fn v8_init( " --harmony-import-assertions", " --no-validate-asm", " --turbo_fast_api_calls", - " --allow-natives-syntax", ); if predictable { @@ -243,9 +242,6 @@ fn v8_init( } } -pub const V8_WRAPPER_TYPE_INDEX: i32 = 0; -pub const V8_WRAPPER_OBJECT_INDEX: i32 = 1; - #[derive(Default)] pub struct RuntimeOptions { /// Source map reference for errors. @@ -321,6 +317,7 @@ impl JsRuntime { if let Some(get_error_class_fn) = options.get_error_class_fn { op_state.get_error_class_fn = get_error_class_fn; } + let op_state = Rc::new(RefCell::new(op_state)); let op_ctxs = ops .into_iter() @@ -333,13 +330,12 @@ impl JsRuntime { .collect::<Vec<_>>() .into_boxed_slice(); - let refs = bindings::external_references(&op_ctxs); - let refs: &'static v8::ExternalReferences = Box::leak(Box::new(refs)); let global_context; let (mut isolate, maybe_snapshot_creator) = if options.will_snapshot { // TODO(ry) Support loading snapshots before snapshotting. assert!(options.startup_snapshot.is_none()); - let mut creator = v8::SnapshotCreator::new(Some(refs)); + let mut creator = + v8::SnapshotCreator::new(Some(&bindings::EXTERNAL_REFERENCES)); // SAFETY: `get_owned_isolate` is unsafe because it may only be called // once. This is the only place we call this function, so this call is // safe. @@ -356,13 +352,8 @@ impl JsRuntime { let mut params = options .create_params .take() - .unwrap_or_else(|| { - v8::Isolate::create_params().embedder_wrapper_type_info_offsets( - V8_WRAPPER_TYPE_INDEX, - V8_WRAPPER_OBJECT_INDEX, - ) - }) - .external_references(&**refs); + .unwrap_or_else(v8::Isolate::create_params) + .external_references(&**bindings::EXTERNAL_REFERENCES); let snapshot_loaded = if let Some(snapshot) = options.startup_snapshot { params = match snapshot { Snapshot::Static(data) => params.snapshot_blob(data), |