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

Unified Diff: src/factory.cc

Issue 1053063003: Make --always-opt also optimize top-level code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Skip failing tests. Created 5 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
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 1cdce60874abfe6671852f1c725202a7f27efc61..a42fdada79e4d9aac3eefb6e1ea936883039d6d9 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -1366,11 +1366,6 @@ Handle<JSObject> Factory::NewFunctionPrototype(Handle<JSFunction> function) {
}
-static bool ShouldOptimizeNewClosure(Handle<SharedFunctionInfo> info) {
- return !info->is_toplevel() && info->allows_lazy_compilation();
-}
-
-
Handle<JSFunction> Factory::NewFunctionFromSharedFunctionInfo(
Handle<SharedFunctionInfo> info,
Handle<Context> context,
@@ -1384,6 +1379,10 @@ Handle<JSFunction> Factory::NewFunctionFromSharedFunctionInfo(
info->ResetForNewContext(isolate()->heap()->global_ic_age());
}
+ if (FLAG_always_opt && info->allows_lazy_compilation()) {
+ result->MarkForOptimization();
+ }
+
int index = info->SearchOptimizedCodeMap(context->native_context(),
BailoutId::None());
if (!info->bound() && index < 0) {
@@ -1399,12 +1398,8 @@ Handle<JSFunction> Factory::NewFunctionFromSharedFunctionInfo(
Code* code = info->GetCodeFromOptimizedCodeMap(index);
DCHECK(!code->marked_for_deoptimization());
result->ReplaceCode(code);
- return result;
}
- if (FLAG_always_opt && ShouldOptimizeNewClosure(info)) {
- result->MarkForOptimization();
- }
return result;
}
« no previous file with comments | « src/compiler/operator-properties.cc ('k') | src/hydrogen.cc » ('j') | src/hydrogen.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698