From b3400d822f6e9a1100e693cc06cd09c8249d4422 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Thu, 25 Oct 2018 11:00:14 -0400 Subject: Decode main.js.map during snapshotting. Pro: time ./out/debug/deno tests/error_001.ts 3.0s -> 0.4s Con: time ./tool/build.py snapshot 33s -> 1m52s out/debug/gen/snapshot_deno.bin 39M -> 121M --- libdeno/binding.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'libdeno/binding.cc') diff --git a/libdeno/binding.cc b/libdeno/binding.cc index 6cf0a7a21..999ccac47 100644 --- a/libdeno/binding.cc +++ b/libdeno/binding.cc @@ -521,13 +521,6 @@ void InitializeContext(v8::Isolate* isolate, v8::Local context, .FromJust()); { - auto source = deno::v8_str(js_source); - CHECK( - deno_val->Set(context, deno::v8_str("mainSource"), source).FromJust()); - - bool r = deno::ExecuteV8StringSource(context, js_filename, source); - CHECK(r); - if (source_map != nullptr) { v8::TryCatch try_catch(isolate); v8::ScriptOrigin origin(v8_str("set_source_map.js")); @@ -551,6 +544,13 @@ void InitializeContext(v8::Isolate* isolate, v8::Local context, source_map_obj.ToLocalChecked()) .FromJust()); } + + auto source = deno::v8_str(js_source); + CHECK( + deno_val->Set(context, deno::v8_str("mainSource"), source).FromJust()); + + bool r = deno::ExecuteV8StringSource(context, js_filename, source); + CHECK(r); } } -- cgit v1.2.3