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

Unified Diff: src/compiler.cc

Issue 594513002: Do not serialize non-lazy compiled function literals. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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/serialize.h » ('j') | src/serialize.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 685009ec53a5998024e28aced0014507079efd97..431872df282f33d24b5185bc5cbe13adccef49ff 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -912,6 +912,8 @@ static Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) {
DCHECK(info->is_eval() || info->is_global());
+ info->MarkAsToplevel();
+
Handle<SharedFunctionInfo> result;
{ VMState<COMPILER> state(info->isolate());
@@ -1178,6 +1180,13 @@ Handle<SharedFunctionInfo> Compiler::BuildFunctionInfo(
bool allow_lazy = literal->AllowsLazyCompilation() &&
!DebuggerWantsEagerCompilation(&info, allow_lazy_without_ctx);
+
+ if (outer_info->is_toplevel() && outer_info->will_serialize()) {
+ // Make sure that if the toplevel code (possibly to be serialized),
+ // the inner unction must be allowed to be compiled lazily.
+ DCHECK(allow_lazy);
+ }
+
// Generate code
Handle<ScopeInfo> scope_info;
if (FLAG_lazy && allow_lazy && !literal->is_parenthesized()) {
« no previous file with comments | « src/compiler.h ('k') | src/serialize.h » ('j') | src/serialize.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698