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

Unified Diff: src/compiler.cc

Issue 1900613002: [compiler] Let CompileForLiveEdit use common pipeline. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments. Created 4 years, 8 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 9de36ed7f06890d873f6feae11d956a26ab25adc..6fc89698f892b93dff2c3ee28041185a5fb4767f 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -1178,25 +1178,24 @@ bool Compiler::CompileDebugCode(Handle<SharedFunctionInfo> shared) {
return true;
}
-void Compiler::CompileForLiveEdit(Handle<Script> script) {
+bool Compiler::CompileForLiveEdit(Handle<Script> script) {
Isolate* isolate = script->GetIsolate();
DCHECK(AllowCompilation::IsAllowed(isolate));
// Start a compilation.
- // TODO(635): support extensions.
Zone zone(isolate->allocator());
ParseInfo parse_info(&zone, script);
CompilationInfo info(&parse_info, Handle<JSFunction>::null());
- PostponeInterruptsScope postpone(isolate);
- VMState<COMPILER> state(isolate);
-
+ parse_info.set_global();
info.MarkAsDebug();
- info.parse_info()->set_global();
- if (!Parser::ParseStatic(info.parse_info())) return;
+ // TODO(635): support extensions.
+ if (CompileToplevel(&info).is_null()) {
+ return false;
+ }
- LiveEditFunctionTracker tracker(isolate, parse_info.literal());
- if (!CompileBaselineCode(&info)) return;
- tracker.RecordRootFunctionInfo(info.code());
+ // Check postconditions on success.
+ DCHECK(!isolate->has_pending_exception());
+ return true;
}
// TODO(turbofan): In the future, unoptimized code with deopt support could
« 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