From: jkummerow@chromium.org Date: Wed, 29 Feb 2012 15:08:02 +0000 (+0000) Subject: Profiler experiments: prevent self-optimization for V8 Extensions X-Git-Tag: upstream/4.7.83~17228 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=773c306303e33f0959e5000ef00ae84f496b3858;p=platform%2Fupstream%2Fv8.git Profiler experiments: prevent self-optimization for V8 Extensions Review URL: https://chromiumcodereview.appspot.com/9535006 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10873 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/compiler.cc b/src/compiler.cc index cbf53a5e8..520db3416 100644 --- a/src/compiler.cc +++ b/src/compiler.cc @@ -119,6 +119,7 @@ bool CompilationInfo::ShouldSelfOptimize() { !Serializer::enabled() && !function()->flags()->Contains(kDontSelfOptimize) && !function()->flags()->Contains(kDontOptimize) && + function()->scope()->allows_lazy_recompilation() && (shared_info().is_null() || !shared_info()->optimization_disabled()); } diff --git a/src/scopes.h b/src/scopes.h index 30c95ee4e..9ce4cd7b1 100644 --- a/src/scopes.h +++ b/src/scopes.h @@ -372,6 +372,11 @@ class Scope: public ZoneObject { // Determine if we can use lazy compilation for this scope. bool AllowsLazyCompilation() const; + // True if we can lazily recompile functions with this scope. + bool allows_lazy_recompilation() const { + return !force_eager_compilation_; + } + // True if the outer context of this scope is always the global context. bool HasTrivialOuterContext() const;