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

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: Keep infos as MaybeHandle 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') | no next file with comments »
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 92c48b6882c5224fb961b37c9a4842c166d2bbe9..d6499509c05549a2c4395168972a692b2a619470 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -1019,7 +1019,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
@@ -1068,8 +1067,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;
@@ -1228,7 +1225,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));
@@ -1244,22 +1241,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
@@ -1589,7 +1587,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
@@ -1632,7 +1629,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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698