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

Unified Diff: src/compiler.cc

Issue 2400973002: [compiler] Allow debug compilation for top-level eval. (Closed)
Patch Set: Created 4 years, 2 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 | src/debug/debug.cc » ('j') | src/debug/debug.cc » ('J')
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 5d0b22fd0c7d12433fe7d1e6d2e5ab84e9ff7752..e1aab4e96c8150d7152a64cd51cc614db70ed05a 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -1118,10 +1118,6 @@ Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) {
DCHECK_EQ(kNoSourcePosition, lit->function_token_position());
result = NewSharedFunctionInfoForLiteral(isolate, lit, script);
result->set_is_toplevel(true);
- if (parse_info->is_eval()) {
- // Eval scripts cannot be (re-)compiled without context.
- result->set_allows_lazy_compilation_without_context(false);
- }
parse_info->set_shared_info(result);
// Compile the code.
@@ -1297,8 +1293,12 @@ bool Compiler::CompileDebugCode(Handle<SharedFunctionInfo> shared) {
Zone zone(isolate->allocator());
ParseInfo parse_info(&zone, shared);
CompilationInfo info(&parse_info, Handle<JSFunction>::null());
- DCHECK(shared->allows_lazy_compilation_without_context());
- DCHECK(!IsEvalToplevel(shared));
+ if (IsEvalToplevel(shared)) {
+ parse_info.set_eval();
+ parse_info.set_toplevel();
+ parse_info.set_allow_lazy_parsing(false);
+ parse_info.set_lazy(false);
+ }
info.MarkAsDebug();
if (GetUnoptimizedCode(&info).is_null()) {
isolate->clear_pending_exception();
« no previous file with comments | « no previous file | src/debug/debug.cc » ('j') | src/debug/debug.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698