summaryrefslogtreecommitdiff
path: root/core/runtime.rs
diff options
context:
space:
mode:
Diffstat (limited to 'core/runtime.rs')
-rw-r--r--core/runtime.rs19
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),