Revision: 23410
Author:   [email protected]
Date:     Tue Aug 26 15:17:57 2014 UTC
Log:      Move context specialization flag into CompilationInfo.

[email protected]

Review URL: https://codereview.chromium.org/507603003
https://code.google.com/p/v8/source/detail?r=23410

Modified:
 /branches/bleeding_edge/src/compiler/pipeline.cc
 /branches/bleeding_edge/src/compiler/pipeline.h
 /branches/bleeding_edge/src/compiler.h
 /branches/bleeding_edge/test/cctest/compiler/function-tester.h

=======================================
--- /branches/bleeding_edge/src/compiler/pipeline.cc Fri Aug 22 12:37:51 2014 UTC +++ /branches/bleeding_edge/src/compiler/pipeline.cc Tue Aug 26 15:17:57 2014 UTC
@@ -186,7 +186,7 @@

   VerifyAndPrintGraph(&graph, "Initial untyped");

-  if (context_specialization_) {
+  if (info()->is_context_specializing()) {
     SourcePositionTable::Scope pos(&source_positions,
                                    SourcePosition::Unknown());
     // Specialize the code to the context as aggressively as possible.
=======================================
--- /branches/bleeding_edge/src/compiler/pipeline.h Thu Aug 21 12:40:10 2014 UTC +++ /branches/bleeding_edge/src/compiler/pipeline.h Tue Aug 26 15:17:57 2014 UTC
@@ -24,8 +24,7 @@

 class Pipeline {
  public:
-  explicit Pipeline(CompilationInfo* info)
- : info_(info), context_specialization_(FLAG_context_specialization) {}
+  explicit Pipeline(CompilationInfo* info) : info_(info) {}

   // Run the entire pipeline and generate a handle to a code object.
   Handle<Code> GenerateCode();
@@ -40,14 +39,9 @@

   static void SetUp();
   static void TearDown();
-  bool context_specialization() { return context_specialization_; }
-  void set_context_specialization(bool context_specialization) {
-    context_specialization_ = context_specialization;
-  }

  private:
   CompilationInfo* info_;
-  bool context_specialization_;

   CompilationInfo* info() const { return info_; }
   Isolate* isolate() { return info_->isolate(); }
=======================================
--- /branches/bleeding_edge/src/compiler.h      Tue Aug 26 14:41:58 2014 UTC
+++ /branches/bleeding_edge/src/compiler.h      Tue Aug 26 15:17:57 2014 UTC
@@ -79,7 +79,8 @@
     kDebug = 1 << 12,
     kCompilingForDebugging = 1 << 13,
     kParseRestriction = 1 << 14,
-    kSerializing = 1 << 15
+    kSerializing = 1 << 15,
+    kContextSpecializing = 1 << 16
   };

   CompilationInfo(Handle<JSFunction> closure, Zone* zone);
@@ -180,6 +181,10 @@
   void PrepareForSerializing() { SetFlag(kSerializing); }

   bool will_serialize() const { return GetFlag(kSerializing); }
+
+  void MarkAsContextSpecializing() { SetFlag(kContextSpecializing); }
+
+ bool is_context_specializing() const { return GetFlag(kContextSpecializing); }

   bool IsCodePreAgingActive() const {
     return FLAG_optimize_for_size && FLAG_age_code && !will_serialize() &&
=======================================
--- /branches/bleeding_edge/test/cctest/compiler/function-tester.h Thu Aug 21 12:40:10 2014 UTC +++ /branches/bleeding_edge/test/cctest/compiler/function-tester.h Tue Aug 26 15:17:57 2014 UTC
@@ -32,7 +32,6 @@
         function((FLAG_allow_natives_syntax = true, NewFunction(source))),
         context_specialization_(context_specialization) {
     Compile(function);
-    USE(context_specialization_);
   }

   Isolate* isolate;
@@ -46,6 +45,7 @@
     StrictMode strict_mode = info.function()->strict_mode();
     info.SetStrictMode(strict_mode);
     info.SetOptimizing(BailoutId::None(), Handle<Code>(function->code()));
+    if (context_specialization_) info.MarkAsContextSpecializing();
     CHECK(Rewriter::Rewrite(&info));
     CHECK(Scope::Analyze(&info));
     CHECK_NE(NULL, info.scope());
@@ -55,7 +55,6 @@
     EnsureDeoptimizationSupport(&info);

     Pipeline pipeline(&info);
-    pipeline.set_context_specialization(context_specialization_);
     Handle<Code> code = pipeline.GenerateCode();

     CHECK(!code.is_null());

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to