Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.10',
'v8_embedder_string': '-node.11',

##### V8 defaults for Node.js #####

Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/codegen/compiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3686,7 +3686,7 @@ MaybeHandle<JSFunction> Compiler::GetWrappedFunction(
// functions fully non-lazy instead thus preventing source positions from
// being omitted.
flags.set_collect_source_positions(true);
// flags.set_eager(compile_options == ScriptCompiler::kEagerCompile);
flags.set_is_eager(compile_options == ScriptCompiler::kEagerCompile);

UnoptimizedCompileState compile_state;
ReusableUnoptimizedCompileState reusable_state(isolate);
Expand Down
31 changes: 31 additions & 0 deletions deps/v8/test/cctest/test-serialize.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4979,6 +4979,37 @@ TEST(CachedCompileFunction) {
}
}

TEST(CachedCompileFunctionRespectsEager) {
DisableAlwaysOpt();
LocalContext env;
Isolate* isolate = CcTest::i_isolate();
isolate->compilation_cache()
->DisableScriptAndEval(); // Disable same-isolate code cache.

v8::HandleScope scope(CcTest::isolate());

v8::Local<v8::String> source = v8_str("return function() { return 42; }");
v8::ScriptCompiler::Source script_source(source);

for (bool eager_compile : {false, true}) {
v8::ScriptCompiler::CompileOptions options =
eager_compile ? v8::ScriptCompiler::kEagerCompile
: v8::ScriptCompiler::kNoCompileOptions;
v8::Local<v8::Value> fun =
v8::ScriptCompiler::CompileFunction(env.local(), &script_source, 0,
nullptr, 0, nullptr, options)
.ToLocalChecked()
.As<v8::Function>()
->Call(env.local(), v8::Undefined(CcTest::isolate()), 0, nullptr)
.ToLocalChecked();

auto i_fun = i::Handle<i::JSFunction>::cast(Utils::OpenHandle(*fun));

// Function should be compiled iff kEagerCompile was used.
CHECK_EQ(i_fun->shared().is_compiled(), eager_compile);
}
}

UNINITIALIZED_TEST(SnapshotCreatorAnonClassWithKeep) {
DisableAlwaysOpt();
v8::SnapshotCreator creator;
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/errors/force_colors.snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ throw new Error('Should include grayed stack trace')
Error: Should include grayed stack trace
at Object.<anonymous> (/test*force_colors.js:1:7)
 at Module._compile (node:internal*modules*cjs*loader:1233:14)
 at Module._extensions..js (node:internal*modules*cjs*loader:1287:10)
 at Object..js (node:internal*modules*cjs*loader:1287:10)
 at Module.load (node:internal*modules*cjs*loader:1091:32)
 at Module._load (node:internal*modules*cjs*loader:938:12)
 at Function._load (node:internal*modules*cjs*loader:938:12)
 at Function.executeUserEntryPoint [as runMain] (node:internal*modules*run_main:83:12)
 at node:internal*main*run_main_module:23:47

Expand Down