Reviewers: fschneider,

Message:
Please take a look.

Description:
Profiler experiments: prevent self-optimization for V8 Extensions


Please review this at https://chromiumcodereview.appspot.com/9535006/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/compiler.cc
  M src/scopes.h


Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index cbf53a5e86e90cc1ec28c019aa1ffef0c307d734..520db34160de6efb17e5a3331f319255488038e8 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());
 }

Index: src/scopes.h
diff --git a/src/scopes.h b/src/scopes.h
index 30c95ee4e5a1ef8afe302731bab6762eab1a5f95..9ce4cd7b1f119ee651f2523e0aa9ea98cf8b167a 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;



--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to