Commit 175edfb4 authored by bmeurer's avatar bmeurer Committed by Commit bot

[turbofan] Rename --context-specialization to --function-context-specialization.

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