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

Unified Diff: src/compiler.cc

Issue 9187005: Enable optimization of top-level code. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 8 years, 10 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/compiler.cc
===================================================================
--- src/compiler.cc (revision 10686)
+++ src/compiler.cc (working copy)
@@ -61,7 +61,7 @@
extension_(NULL),
pre_parse_data_(NULL),
osr_ast_id_(AstNode::kNoNumber) {
- Initialize(NONOPT);
+ Initialize(BASE);
}
@@ -182,10 +182,8 @@
static bool MakeCrankshaftCode(CompilationInfo* info) {
// Test if we can optimize this function when asked to. We can only
// do this after the scopes are computed.
- if (!info->AllowOptimize()) {
+ if (!V8::UseCrankshaft()) {
info->DisableOptimization();
- } else if (info->IsOptimizable()) {
- info->EnableDeoptimizationSupport();
}
// In case we are not optimizing simply return the code from
@@ -664,11 +662,13 @@
// Check the function has compiled code.
ASSERT(shared->is_compiled());
shared->set_code_age(0);
- shared->set_dont_crankshaft(lit->flags()->Contains(kDontOptimize));
+ shared->set_dont_optimize(lit->flags()->Contains(kDontOptimize));
shared->set_dont_inline(lit->flags()->Contains(kDontInline));
shared->set_ast_node_count(lit->ast_node_count());
- if (info->AllowOptimize() && !shared->optimization_disabled()) {
+ if (V8::UseCrankshaft()&&
+ !function.is_null() &&
+ !shared->optimization_disabled()) {
// If we're asked to always optimize, we compile the optimized
// version of the function right away - unless the debugger is
// active as it makes no sense to compile optimized code then.
@@ -766,7 +766,8 @@
function_info->set_uses_arguments(lit->scope()->arguments() != NULL);
function_info->set_has_duplicate_parameters(lit->has_duplicate_parameters());
function_info->set_ast_node_count(lit->ast_node_count());
- function_info->set_dont_crankshaft(lit->flags()->Contains(kDontOptimize));
+ function_info->set_is_function(lit->is_function());
+ function_info->set_dont_optimize(lit->flags()->Contains(kDontOptimize));
function_info->set_dont_inline(lit->flags()->Contains(kDontInline));
}

Powered by Google App Engine
This is Rietveld 408576698