diff options
author | isaacs <i@izs.me> | 2012-02-13 10:04:53 -0800 |
---|---|---|
committer | isaacs <i@izs.me> | 2012-02-13 10:05:16 -0800 |
commit | 68a0c56a7d9c26661245b06c7d1231625a0aa5ac (patch) | |
tree | f498b59d5c3c21297743ec560a9087217f5695fc /deps/v8/src/compiler.cc | |
parent | 09ccbef3bbfc4ca14c58dbed4c3c067bd1f1e14c (diff) | |
download | node-new-68a0c56a7d9c26661245b06c7d1231625a0aa5ac.tar.gz |
Upgrade V8 to 3.9.5
Diffstat (limited to 'deps/v8/src/compiler.cc')
-rw-r--r-- | deps/v8/src/compiler.cc | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/deps/v8/src/compiler.cc b/deps/v8/src/compiler.cc index ba4d202174..aea889f8be 100644 --- a/deps/v8/src/compiler.cc +++ b/deps/v8/src/compiler.cc @@ -1,4 +1,4 @@ -// Copyright 2011 the V8 project authors. All rights reserved. +// Copyright 2012 the V8 project authors. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -110,6 +110,18 @@ void CompilationInfo::DisableOptimization() { } +// Primitive functions are unlikely to be picked up by the stack-walking +// profiler, so they trigger their own optimization when they're called +// for the SharedFunctionInfo::kCallsUntilPrimitiveOptimization-th time. +bool CompilationInfo::ShouldSelfOptimize() { + return FLAG_self_optimization && + FLAG_crankshaft && + !Serializer::enabled() && + !function()->flags()->Contains(kDontSelfOptimize) && + (shared_info().is_null() || !shared_info()->optimization_disabled()); +} + + void CompilationInfo::AbortOptimization() { Handle<Code> code(shared_info()->code()); SetCode(code); @@ -652,6 +664,9 @@ bool Compiler::CompileLazy(CompilationInfo* info) { // 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_inline(lit->flags()->Contains(kDontInline)); + shared->set_ast_node_count(lit->ast_node_count()); if (info->AllowOptimize() && !shared->optimization_disabled()) { // If we're asked to always optimize, we compile the optimized @@ -750,6 +765,9 @@ void Compiler::SetFunctionInfo(Handle<SharedFunctionInfo> function_info, function_info->set_language_mode(lit->language_mode()); 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_dont_inline(lit->flags()->Contains(kDontInline)); } |