aboutsummaryrefslogtreecommitdiff
path: root/deps/v8/src/compiler.cc
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2018-07-25 19:30:07 +0200
committerMichaël Zasso <targos@protonmail.com>2018-07-26 08:31:50 +0200
commit6a31d05340b22fc413ee83eaacd0a5565bbbe799 (patch)
tree78f9e1c2f417244842f6422f17e1816e70317100 /deps/v8/src/compiler.cc
parent4d94bb2b1f72b6b612983a517a39c5545724a3ad (diff)
downloadandroid-node-v8-6a31d05340b22fc413ee83eaacd0a5565bbbe799.tar.gz
android-node-v8-6a31d05340b22fc413ee83eaacd0a5565bbbe799.tar.bz2
android-node-v8-6a31d05340b22fc413ee83eaacd0a5565bbbe799.zip
deps: update V8 to 6.8.275.24
PR-URL: https://github.com/nodejs/node/pull/21079 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yang Guo <yangguo@chromium.org>
Diffstat (limited to 'deps/v8/src/compiler.cc')
-rw-r--r--deps/v8/src/compiler.cc39
1 files changed, 11 insertions, 28 deletions
diff --git a/deps/v8/src/compiler.cc b/deps/v8/src/compiler.cc
index d63f03d358..ae6bc9c4fa 100644
--- a/deps/v8/src/compiler.cc
+++ b/deps/v8/src/compiler.cc
@@ -84,9 +84,8 @@ void LogFunctionCompilation(CodeEventListener::LogEventsAndTags tag,
// Log the code generation. If source information is available include
// script name and line number. Check explicitly whether logging is
// enabled as finding the line number is not free.
- if (!isolate->logger()->is_listening_to_code_events() &&
- !isolate->is_profiling() && !FLAG_log_function_events &&
- !isolate->code_event_dispatcher()->IsListeningToCodeEvents()) {
+ if (!isolate->logger()->is_logging_code_events() &&
+ !isolate->is_profiling() && !FLAG_log_function_events) {
return;
}
@@ -1357,11 +1356,6 @@ MaybeHandle<JSFunction> Compiler::GetFunctionFromEval(
}
}
- // OnAfterCompile has to be called after we create the JSFunction, which we
- // may require to recompile the eval for debugging, if we find a function
- // that contains break points in the eval script.
- isolate->debug()->OnAfterCompile(script);
-
return result;
}
@@ -1403,7 +1397,8 @@ MaybeHandle<JSFunction> Compiler::GetFunctionFromString(
// Compile source string in the native context.
int eval_scope_position = 0;
int eval_position = kNoSourcePosition;
- Handle<SharedFunctionInfo> outer_info(native_context->closure()->shared());
+ Handle<SharedFunctionInfo> outer_info(
+ native_context->empty_function()->shared());
return Compiler::GetFunctionFromEval(
source, outer_info, native_context, LanguageMode::kSloppy, restriction,
parameters_end_pos, eval_scope_position, eval_position);
@@ -1732,12 +1727,6 @@ MaybeHandle<SharedFunctionInfo> Compiler::GetSharedFunctionInfoForScript(
}
}
- // On success, report script compilation to debugger.
- Handle<SharedFunctionInfo> result;
- if (maybe_result.ToHandle(&result)) {
- isolate->debug()->OnAfterCompile(handle(Script::cast(result->script())));
- }
-
return maybe_result;
}
@@ -1816,14 +1805,8 @@ MaybeHandle<JSFunction> Compiler::GetWrappedFunction(
script = Handle<Script>(Script::cast(wrapped->script()), isolate);
}
- Handle<JSFunction> function =
- isolate->factory()->NewFunctionFromSharedFunctionInfo(wrapped, context,
+ return isolate->factory()->NewFunctionFromSharedFunctionInfo(wrapped, context,
NOT_TENURED);
- // OnAfterCompile has to be called after we create the JSFunction, which we
- // may require to recompile the eval for debugging, if we find a function
- // that contains break points in the eval script.
- isolate->debug()->OnAfterCompile(script);
- return function;
}
ScriptCompiler::ScriptStreamingTask* Compiler::NewBackgroundCompileTask(
@@ -1893,12 +1876,6 @@ Compiler::GetSharedFunctionInfoForStreamedScript(
}
}
- // On success, report script compilation to debugger.
- Handle<SharedFunctionInfo> result;
- if (maybe_result.ToHandle(&result)) {
- isolate->debug()->OnAfterCompile(handle(Script::cast(result->script())));
- }
-
streaming_data->Release();
return maybe_result;
}
@@ -1981,6 +1958,12 @@ void Compiler::PostInstantiation(Handle<JSFunction> function,
function->set_code(code);
}
}
+
+ if (shared->is_toplevel() || shared->is_wrapped()) {
+ // If it's a top-level script, report compilation to the debugger.
+ Handle<Script> script(handle(Script::cast(shared->script())));
+ script->GetIsolate()->debug()->OnAfterCompile(script);
+ }
}
// ----------------------------------------------------------------------------