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

Unified Diff: src/compiler.cc

Issue 1897793002: [compiler] Simplify Compiler::CompileDebugCode a bit. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | « no previous file | no next file » | 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 7ef75a164234752dce6b742145fdb9fad150e99a..4d8d4e6a157c91629bec2d7d5f0fb8718e703d35 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -1129,28 +1129,17 @@ bool Compiler::CompileOptimized(Handle<JSFunction> function,
}
bool Compiler::CompileDebugCode(Handle<JSFunction> function) {
- Handle<SharedFunctionInfo> shared(function->shared());
- if (IsEvalToplevel(shared)) {
- Handle<Script> script(Script::cast(shared->script()));
- Handle<Context> context(function->context());
-
- Zone zone(function->GetIsolate()->allocator());
- ParseInfo parse_info(&zone, script);
- CompilationInfo info(&parse_info, Handle<JSFunction>::null());
-
+ Zone zone(function->GetIsolate()->allocator());
+ ParseInfo parse_info(&zone, function);
+ CompilationInfo info(&parse_info, Handle<JSFunction>::null());
+ if (IsEvalToplevel(handle(function->shared()))) {
parse_info.set_eval();
- parse_info.set_context(context);
- parse_info.set_shared_info(shared);
- if (context->IsNativeContext()) parse_info.set_global();
+ if (function->context()->IsNativeContext()) parse_info.set_global();
parse_info.set_toplevel();
parse_info.set_allow_lazy_parsing(false);
- parse_info.set_language_mode(shared->language_mode());
- parse_info.set_parse_restriction(NO_PARSE_RESTRICTION);
- return CompileForDebugging(&info);
- } else {
- CompilationInfoWithZone info(function);
- return CompileForDebugging(&info);
+ parse_info.set_lazy(false);
}
+ return CompileForDebugging(&info);
}
bool Compiler::CompileDebugCode(Handle<SharedFunctionInfo> shared) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698