Commit e2ff7d12 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[compiler] Simplify Compiler::CompileDebugCode a bit.

R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/1897793002

Cr-Commit-Position: refs/heads/master@{#35579}
parent 0eae5650
...@@ -1129,28 +1129,17 @@ bool Compiler::CompileOptimized(Handle<JSFunction> function, ...@@ -1129,28 +1129,17 @@ bool Compiler::CompileOptimized(Handle<JSFunction> function,
} }
bool Compiler::CompileDebugCode(Handle<JSFunction> function) { bool Compiler::CompileDebugCode(Handle<JSFunction> function) {
Handle<SharedFunctionInfo> shared(function->shared()); Zone zone(function->GetIsolate()->allocator());
if (IsEvalToplevel(shared)) { ParseInfo parse_info(&zone, function);
Handle<Script> script(Script::cast(shared->script())); CompilationInfo info(&parse_info, Handle<JSFunction>::null());
Handle<Context> context(function->context()); if (IsEvalToplevel(handle(function->shared()))) {
Zone zone(function->GetIsolate()->allocator());
ParseInfo parse_info(&zone, script);
CompilationInfo info(&parse_info, Handle<JSFunction>::null());
parse_info.set_eval(); parse_info.set_eval();
parse_info.set_context(context); if (function->context()->IsNativeContext()) parse_info.set_global();
parse_info.set_shared_info(shared);
if (context->IsNativeContext()) parse_info.set_global();
parse_info.set_toplevel(); parse_info.set_toplevel();
parse_info.set_allow_lazy_parsing(false); parse_info.set_allow_lazy_parsing(false);
parse_info.set_language_mode(shared->language_mode()); parse_info.set_lazy(false);
parse_info.set_parse_restriction(NO_PARSE_RESTRICTION);
return CompileForDebugging(&info);
} else {
CompilationInfoWithZone info(function);
return CompileForDebugging(&info);
} }
return CompileForDebugging(&info);
} }
bool Compiler::CompileDebugCode(Handle<SharedFunctionInfo> shared) { bool Compiler::CompileDebugCode(Handle<SharedFunctionInfo> shared) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment