Chromium Code Reviews| 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 |
| @@ -218,7 +216,7 @@ |
| if (info->shared_info()->opt_count() > kMaxOptCount) { |
| info->AbortOptimization(); |
| Handle<JSFunction> closure = info->closure(); |
|
Tobias Burnus
2012/02/14 21:22:55
GCC 4.7 warns that closure no longer used but only
|
| - info->shared_info()->DisableOptimization(*closure); |
| + info->shared_info()->DisableOptimization(); |
| // True indicates the compilation pipeline is still going, not |
| // necessarily that we optimized the code. |
| return true; |
| @@ -239,7 +237,7 @@ |
| scope->num_parameters() + 1 + scope->num_stack_slots() > locals_limit)) { |
| info->AbortOptimization(); |
| Handle<JSFunction> closure = info->closure(); |
|
Tobias Burnus
2012/02/14 21:22:55
Ditto.
|
| - info->shared_info()->DisableOptimization(*closure); |
| + info->shared_info()->DisableOptimization(); |
| // True indicates the compilation pipeline is still going, not |
| // necessarily that we optimized the code. |
| return true; |
| @@ -318,7 +316,7 @@ |
| // Mark the shared code as unoptimizable unless it was an inlined |
| // function that bailed out. |
| Handle<JSFunction> closure = info->closure(); |
|
Tobias Burnus
2012/02/14 21:22:55
Ditto.
|
| - info->shared_info()->DisableOptimization(*closure); |
| + info->shared_info()->DisableOptimization(); |
| } |
| // True indicates the compilation pipeline is still going, not necessarily |
| // that we optimized the code. |
| @@ -573,6 +571,10 @@ |
| info.SetCallingContext(context); |
| result = MakeFunctionInfo(&info); |
| if (!result.is_null()) { |
| + // Explicitly disable optimization for eval code. We're not yet prepared |
| + // to handle eval-code in the optimizing compiler. |
| + result->DisableOptimization(); |
| + |
| // If caller is strict mode, the result must be in strict mode or |
| // extended mode as well, but not the other way around. Consider: |
| // eval("'use strict'; ..."); |
| @@ -664,11 +666,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 +770,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)); |
| } |