[turbofan] Rename --context-specialization to --function-context-specialization.
authorbmeurer <bmeurer@chromium.org>
Fri, 25 Sep 2015 11:33:28 +0000 (04:33 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 25 Sep 2015 11:33:38 +0000 (11:33 +0000)
This name makes it clear that the flag (also the variant in the Compiler)
is talking about specializing to the function context instead of i.e. the
native context.

R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/1372513003

Cr-Commit-Position: refs/heads/master@{#30934}

src/compiler.cc
src/compiler.h
src/compiler/pipeline.cc
src/flag-definitions.h
test/cctest/compiler/function-tester.h
test/cctest/compiler/test-run-inlining.cc
test/cctest/compiler/test-run-properties.cc
test/cctest/test-serialize.cc
test/mjsunit/regress/regress-4374.js
test/mjsunit/regress/regress-osr-context.js

index 1af7cb9b7cd8aace27aacb4710580bebf7a23fc2..4085a71344362666455b6ab484bd5a32c0dcdbe0 100644 (file)
@@ -130,7 +130,7 @@ CompilationInfo::CompilationInfo(ParseInfo* parse_info)
   // with deoptimization support.
   if (isolate_->serializer_enabled()) EnableDeoptimizationSupport();
 
-  if (FLAG_context_specialization) MarkAsContextSpecializing();
+  if (FLAG_function_context_specialization) MarkAsFunctionContextSpecializing();
   if (FLAG_turbo_inlining) MarkAsInliningEnabled();
   if (FLAG_turbo_source_positions) MarkAsSourcePositionsEnabled();
   if (FLAG_turbo_splitting) MarkAsSplittingEnabled();
@@ -440,7 +440,7 @@ OptimizedCompileJob::Status OptimizedCompileJob::CreateGraph() {
 
     if (info()->shared_info()->asm_function()) {
       if (info()->osr_frame()) info()->MarkAsFrameSpecializing();
-      info()->MarkAsContextSpecializing();
+      info()->MarkAsFunctionContextSpecializing();
     } else if (FLAG_turbo_type_feedback) {
       info()->MarkAsTypeFeedbackEnabled();
       info()->EnsureFeedbackVector();
@@ -777,8 +777,8 @@ static void InsertCodeIntoOptimizedCodeMap(CompilationInfo* info) {
   if (code->kind() != Code::OPTIMIZED_FUNCTION) return;  // Nothing to do.
 
   // Context specialization folds-in the context, so no sharing can occur.
-  if (info->is_context_specializing()) return;
-  // Frame specialization implies context specialization.
+  if (info->is_function_context_specializing()) return;
+  // Frame specialization implies function context specialization.
   DCHECK(!info->is_frame_specializing());
 
   // Do not cache bound functions.
@@ -799,7 +799,7 @@ static void InsertCodeIntoOptimizedCodeMap(CompilationInfo* info) {
 
   // Cache optimized context-independent code.
   if (FLAG_turbo_cache_shared_code && code->is_turbofanned()) {
-    DCHECK(!info->is_context_specializing());
+    DCHECK(!info->is_function_context_specializing());
     DCHECK(info->osr_ast_id().IsNone());
     Handle<SharedFunctionInfo> shared(function->shared());
     SharedFunctionInfo::AddSharedCodeToOptimizedCodeMap(shared, code);
@@ -975,7 +975,7 @@ MaybeHandle<Code> Compiler::GetStubCode(Handle<JSFunction> function,
   ParseInfo parse_info(&zone, function);
   CompilationInfo info(&parse_info);
   info.SetFunctionType(stub->GetCallInterfaceDescriptor().GetFunctionType());
-  info.MarkAsContextSpecializing();
+  info.MarkAsFunctionContextSpecializing();
   info.MarkAsDeoptimizationEnabled();
   info.SetStub(stub);
 
index 5c5bb02c722f70b4f8e1d39be45c6b325b8149b0..45cf7b5183d76edafe0a12fb46e1edc91034bde4 100644 (file)
@@ -121,7 +121,7 @@ class CompilationInfo {
     kDeoptimizationSupport = 1 << 5,
     kDebug = 1 << 6,
     kSerializing = 1 << 7,
-    kContextSpecializing = 1 << 8,
+    kFunctionContextSpecializing = 1 << 8,
     kFrameSpecializing = 1 << 9,
     kInliningEnabled = 1 << 10,
     kTypingEnabled = 1 << 11,
@@ -221,9 +221,13 @@ class CompilationInfo {
 
   bool will_serialize() const { return GetFlag(kSerializing); }
 
-  void MarkAsContextSpecializing() { SetFlag(kContextSpecializing); }
+  void MarkAsFunctionContextSpecializing() {
+    SetFlag(kFunctionContextSpecializing);
+  }
 
-  bool is_context_specializing() const { return GetFlag(kContextSpecializing); }
+  bool is_function_context_specializing() const {
+    return GetFlag(kFunctionContextSpecializing);
+  }
 
   void MarkAsFrameSpecializing() { SetFlag(kFrameSpecializing); }
 
index fd79a865e2403b423ab819043bdceb7443dfda8c..209ddfdf0da243c8c62cf6667cddb53e16a0054f 100644 (file)
@@ -504,9 +504,10 @@ struct InliningPhase {
     CommonOperatorReducer common_reducer(&graph_reducer, data->graph(),
                                          data->common(), data->machine());
     JSContextSpecialization context_specialization(
-        &graph_reducer, data->jsgraph(), data->info()->is_context_specializing()
-                                             ? data->info()->context()
-                                             : MaybeHandle<Context>());
+        &graph_reducer, data->jsgraph(),
+        data->info()->is_function_context_specializing()
+            ? data->info()->context()
+            : MaybeHandle<Context>());
     JSFrameSpecialization frame_specialization(data->info()->osr_frame(),
                                                data->jsgraph());
     JSInliner inliner(&graph_reducer, data->info()->is_inlining_enabled()
index df22b0bd5d66df8698dd3fcbe5eadba810ce22b1..857882045094f739896a0b3c79edf6fe7445fbdc 100644 (file)
@@ -431,8 +431,8 @@ DEFINE_BOOL(turbo_allocate, false, "enable inline allocations in TurboFan")
 DEFINE_BOOL(turbo_source_positions, false,
             "track source code positions when building TurboFan IR")
 DEFINE_IMPLICATION(trace_turbo, turbo_source_positions)
-DEFINE_BOOL(context_specialization, false,
-            "enable context specialization in TurboFan")
+DEFINE_BOOL(function_context_specialization, false,
+            "enable function context specialization in TurboFan")
 DEFINE_BOOL(turbo_inlining, false, "enable inlining in TurboFan")
 DEFINE_BOOL(trace_turbo_inlining, false, "trace TurboFan inlining")
 DEFINE_BOOL(loop_assignment_analysis, true, "perform loop assignment analysis")
index f16463e826bb0b96f325f79a109663ed37edd6ad..c2b25e5547c09c2befc091076d53e2f3685d924a 100644 (file)
@@ -31,9 +31,9 @@ class FunctionTester : public InitializedHandleScope {
         function((FLAG_allow_natives_syntax = true, NewFunction(source))),
         flags_(flags) {
     Compile(function);
-    const uint32_t supported_flags = CompilationInfo::kContextSpecializing |
-                                     CompilationInfo::kInliningEnabled |
-                                     CompilationInfo::kTypingEnabled;
+    const uint32_t supported_flags =
+        CompilationInfo::kFunctionContextSpecializing |
+        CompilationInfo::kInliningEnabled | CompilationInfo::kTypingEnabled;
     CHECK_EQ(0u, flags_ & ~supported_flags);
   }
 
@@ -161,8 +161,8 @@ class FunctionTester : public InitializedHandleScope {
 
     CHECK(Parser::ParseStatic(info.parse_info()));
     info.SetOptimizing(BailoutId::None(), Handle<Code>(function->code()));
-    if (flags_ & CompilationInfo::kContextSpecializing) {
-      info.MarkAsContextSpecializing();
+    if (flags_ & CompilationInfo::kFunctionContextSpecializing) {
+      info.MarkAsFunctionContextSpecializing();
     }
     if (flags_ & CompilationInfo::kInliningEnabled) {
       info.MarkAsInliningEnabled();
index 8aa9d030eeb10b989f3bb37a569f77f09715e042..05fb6ad46d8f946ad0edc11dac666d85a85ebe1c 100644 (file)
@@ -43,10 +43,11 @@ void InstallAssertInlineCountHelper(v8::Isolate* isolate) {
 
 
 const uint32_t kRestrictedInliningFlags =
-    CompilationInfo::kContextSpecializing | CompilationInfo::kTypingEnabled;
+    CompilationInfo::kFunctionContextSpecializing |
+    CompilationInfo::kTypingEnabled;
 
 const uint32_t kInlineFlags = CompilationInfo::kInliningEnabled |
-                              CompilationInfo::kContextSpecializing |
+                              CompilationInfo::kFunctionContextSpecializing |
                               CompilationInfo::kTypingEnabled;
 
 }  // namespace
index b7677f7fd207fbeafb2b3a7eb8690d2bc9bbf24d..f2d72e4c4edbabc24019625ce6f2de3c352a5c7c 100644 (file)
@@ -41,9 +41,9 @@ static void TypedArrayLoadHelper(const char* array_type) {
            values_buffer.start(), array_type, arraysize(kValues),
            values_buffer.start(), array_type, array_type);
 
-  FunctionTester T(
-      source_buffer.start(),
-      CompilationInfo::kContextSpecializing | CompilationInfo::kTypingEnabled);
+  FunctionTester T(source_buffer.start(),
+                   CompilationInfo::kFunctionContextSpecializing |
+                       CompilationInfo::kTypingEnabled);
   for (size_t i = 0; i < arraysize(kValues); ++i) {
     for (size_t j = 0; j < arraysize(kValues); ++j) {
       volatile U value_a = static_cast<U>(kValues[i]);
@@ -109,9 +109,9 @@ static void TypedArrayStoreHelper(const char* array_type) {
            values_buffer.start(), array_type, arraysize(kValues),
            values_buffer.start(), array_type, array_type);
 
-  FunctionTester T(
-      source_buffer.start(),
-      CompilationInfo::kContextSpecializing | CompilationInfo::kTypingEnabled);
+  FunctionTester T(source_buffer.start(),
+                   CompilationInfo::kFunctionContextSpecializing |
+                       CompilationInfo::kTypingEnabled);
   for (size_t i = 0; i < arraysize(kValues); ++i) {
     for (size_t j = 0; j < arraysize(kValues); ++j) {
       volatile U value_a = static_cast<U>(kValues[i]);
index bf36081201f57e4a9938ab9d10e7a49812d02299..a37d6a0f19a7bca0429f6a94283bd712a038d1af 100644 (file)
@@ -1599,7 +1599,7 @@ TEST(SerializeInternalReference) {
   return;
 #endif
   // Disable experimental natives that are loaded after deserialization.
-  FLAG_context_specialization = false;
+  FLAG_function_context_specialization = false;
   FLAG_always_opt = true;
   const char* flag = "--turbo-filter=foo";
   FlagList::SetFlagsFromString(flag, StrLength(flag));
index bbdcfb9073060a87cab410dc0a8d41b63e7b6859..afae71c5956d8f4b308bee954b9a6bea7dd8b834 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-// Flags: --allow-natives-syntax --context-specialization
+// Flags: --allow-natives-syntax --function-context-specialization
 // Flags: --turbo-filter=f --turbo-inlining
 
 var f = (function() {
index 8ceb79119ac72f8d06ad841ab7181b9ac902180b..a73954156ce94e09d59aff93aadf76c898bda98f 100644 (file)
@@ -2,7 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-// Flags: --allow-natives-syntax --context-specialization --turbo-filter=f
+// Flags: --allow-natives-syntax --function-context-specialization
+// Flags: --turbo-filter=f
 
 (function() {
   "use strict";