Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Unified Diff: src/compiler.cc

Issue 1971683002: [debugger] Refactor LiveEdit function info collection (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Return MaybeHandle from CompileForLiveEdit Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler.h ('k') | src/debug/liveedit.h » ('j') | src/debug/liveedit.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index fdb41e732bdd1cbd8844cb87e688696ad3522b83..93dd9e943553a92ff74c7e384ff26be0fa31fe3b 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -1032,7 +1032,6 @@ Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) {
DCHECK(!info->is_debug() || !parse_info->allow_lazy_parsing());
FunctionLiteral* lit = parse_info->literal();
- LiveEditFunctionTracker live_edit_tracker(isolate, lit);
// Measure how long it takes to do the compilation; only take the
// rest of the function into account to avoid overlap with the
@@ -1078,8 +1077,6 @@ Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) {
if (!script.is_null())
script->set_compilation_state(Script::COMPILATION_STATE_COMPILED);
-
- live_edit_tracker.RecordFunctionInfo(result, lit, info->zone());
}
return result;
@@ -1238,7 +1235,7 @@ bool Compiler::CompileDebugCode(Handle<SharedFunctionInfo> shared) {
return true;
}
-bool Compiler::CompileForLiveEdit(Handle<Script> script) {
+MaybeHandle<JSArray> Compiler::CompileForLiveEdit(Handle<Script> script) {
Isolate* isolate = script->GetIsolate();
DCHECK(AllowCompilation::IsAllowed(isolate));
@@ -1254,22 +1251,23 @@ bool Compiler::CompileForLiveEdit(Handle<Script> script) {
CompilationInfo info(&parse_info, Handle<JSFunction>::null());
parse_info.set_global();
info.MarkAsDebug();
+
// TODO(635): support extensions.
const bool compilation_succeeded = !CompileToplevel(&info).is_null();
+ Handle<JSArray> infos;
+ if (compilation_succeeded) {
+ // Check postconditions on success.
+ DCHECK(!isolate->has_pending_exception());
+ infos = LiveEditFunctionTracker::Collect(parse_info.literal(), script,
+ &zone, isolate);
+ }
// Restore the original function info list in order to remain side-effect
// free as much as possible, since some code expects the old shared function
// infos to stick around.
script->set_shared_function_infos(*old_function_infos);
- if (!compilation_succeeded) {
- return false;
- }
-
- // Check postconditions on success.
- DCHECK(!isolate->has_pending_exception());
-
- return compilation_succeeded;
+ return infos;
}
// TODO(turbofan): In the future, unoptimized code with deopt support could
@@ -1598,7 +1596,6 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfo(
if (outer_info->will_serialize()) info.PrepareForSerializing();
if (outer_info->is_debug()) info.MarkAsDebug();
- LiveEditFunctionTracker live_edit_tracker(isolate, literal);
// Determine if the function can be lazily compiled. This is necessary to
// allow some of our builtin JS files to be lazily compiled. These
// builtins cannot be handled lazily by the parser, since we have to know
@@ -1641,7 +1638,6 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfo(
if (maybe_existing.is_null()) {
RecordFunctionCompilation(Logger::FUNCTION_TAG, &info);
- live_edit_tracker.RecordFunctionInfo(result, literal, info.zone());
}
return result;
« no previous file with comments | « src/compiler.h ('k') | src/debug/liveedit.h » ('j') | src/debug/liveedit.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698