summaryrefslogtreecommitdiff
path: root/deno2/deno.cc
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-06-18 16:02:08 +0200
committerRyan Dahl <ry@tinyclouds.org>2018-06-19 15:07:31 +0200
commitcc2ae2d316b039ba599e3a8d3aed168ad7e77b10 (patch)
tree9b96fafe8671b59aaa65ad182de984e09797eba4 /deno2/deno.cc
parent064d889af05365b3d2051f0db800adc1ad977f3a (diff)
Snapshot clean ups
- Don't call eval() in mock_runtime - not allowed - see js2c.py. - Don't use v8_use_external_startup_data - Move MakeSnapshot to snapshot_creator.cc - Use logging.h in from_snapshot.cc
Diffstat (limited to 'deno2/deno.cc')
-rw-r--r--deno2/deno.cc38
1 files changed, 0 insertions, 38 deletions
diff --git a/deno2/deno.cc b/deno2/deno.cc
index ec3665c93..0ebdf380c 100644
--- a/deno2/deno.cc
+++ b/deno2/deno.cc
@@ -194,19 +194,6 @@ bool Execute(v8::Local<v8::Context> context, const char* js_filename,
return true;
}
-v8::StartupData SerializeInternalFields(v8::Local<v8::Object> holder, int index,
- void* data) {
- DCHECK_EQ(data, nullptr); // TODO(ry) pass Deno* object here.
- InternalFieldData* embedder_field = static_cast<InternalFieldData*>(
- holder->GetAlignedPointerFromInternalField(index));
- if (embedder_field == nullptr) return {nullptr, 0};
- int size = sizeof(*embedder_field);
- char* payload = new char[size];
- // We simply use memcpy to serialize the content.
- memcpy(payload, embedder_field, size);
- return {payload, size};
-}
-
void InitializeContext(v8::Isolate* isolate, v8::Local<v8::Context> context,
const char* js_filename, const char* js_source) {
v8::HandleScope handle_scope(isolate);
@@ -233,31 +220,6 @@ void InitializeContext(v8::Isolate* isolate, v8::Local<v8::Context> context,
CHECK(r);
}
-v8::StartupData MakeSnapshot(v8::StartupData* prev_natives_blob,
- v8::StartupData* prev_snapshot_blob,
- const char* js_filename, const char* js_source) {
- v8::V8::SetNativesDataBlob(prev_natives_blob);
- v8::V8::SetSnapshotDataBlob(prev_snapshot_blob);
-
- auto* creator = new v8::SnapshotCreator(external_references);
- auto* isolate = creator->GetIsolate();
- v8::Isolate::Scope isolate_scope(isolate);
- {
- v8::HandleScope handle_scope(isolate);
- auto context = v8::Context::New(isolate);
- InitializeContext(isolate, context, js_filename, js_source);
- creator->SetDefaultContext(context, v8::SerializeInternalFieldsCallback(
- SerializeInternalFields, nullptr));
- }
-
- // Note that using kKeep here will cause segfaults. This is demoed in the
- // "SnapshotBug" test case.
- auto snapshot_blob =
- creator->CreateBlob(v8::SnapshotCreator::FunctionCodeHandling::kClear);
-
- return snapshot_blob;
-}
-
void AddIsolate(Deno* d, v8::Isolate* isolate) {
d->isolate = isolate;
// Leaving this code here because it will probably be useful later on, but