Chromium Code Reviews| Index: src/compiler.cc |
| diff --git a/src/compiler.cc b/src/compiler.cc |
| index fdb41e732bdd1cbd8844cb87e688696ad3522b83..f133fbbbd046604ec417bb33ce51ed0a7d28dda7 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,8 @@ bool Compiler::CompileDebugCode(Handle<SharedFunctionInfo> shared) { |
| return true; |
| } |
| -bool Compiler::CompileForLiveEdit(Handle<Script> script) { |
| +bool Compiler::CompileForLiveEdit(Handle<Script> script, |
| + Handle<JSArray>* infos) { |
|
Yang
2016/05/13 07:53:30
Let's return a MaybeHandle<JSArray>. If compilatio
jgruber1
2016/05/13 08:31:49
Done.
|
| Isolate* isolate = script->GetIsolate(); |
| DCHECK(AllowCompilation::IsAllowed(isolate)); |
| @@ -1254,21 +1252,21 @@ 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(); |
| + 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; |
| } |
| @@ -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; |