From ef2fd24e9fc66513546ddef940c4b4d36dc94a61 Mon Sep 17 00:00:00 2001 From: mstarzinger Date: Fri, 21 Aug 2015 08:10:38 -0700 Subject: [PATCH] Deprecate semi-correct CompilationInfo::flags predicate. R=titzer@chromium.org Review URL: https://codereview.chromium.org/1304053004 Cr-Commit-Position: refs/heads/master@{#30308} --- src/codegen.cc | 10 +++++++++- src/codegen.h | 1 - src/compiler.cc | 9 --------- src/compiler.h | 1 - src/compiler/code-generator.cc | 4 ++-- src/full-codegen/full-codegen.cc | 3 +-- src/lithium.cc | 4 +--- test/cctest/compiler/test-pipeline.cc | 1 + 8 files changed, 14 insertions(+), 19 deletions(-) diff --git a/src/codegen.cc b/src/codegen.cc index c9de2b1af1..cc5495bc1b 100644 --- a/src/codegen.cc +++ b/src/codegen.cc @@ -149,10 +149,18 @@ void CodeGenerator::MakeCodePrologue(CompilationInfo* info, const char* kind) { Handle CodeGenerator::MakeCodeEpilogue(MacroAssembler* masm, - Code::Flags flags, CompilationInfo* info) { Isolate* isolate = info->isolate(); + Code::Flags flags = + info->code_stub() != nullptr + ? Code::ComputeFlags(info->code_stub()->GetCodeKind(), + info->code_stub()->GetICState(), + info->code_stub()->GetExtraICState(), + info->code_stub()->GetStubType()) + : Code::ComputeFlags(info->IsOptimizing() ? Code::OPTIMIZED_FUNCTION + : Code::FUNCTION); + // Allocate and install the code. CodeDesc desc; bool is_crankshafted = diff --git a/src/codegen.h b/src/codegen.h index 9025a9fca6..04f130999e 100644 --- a/src/codegen.h +++ b/src/codegen.h @@ -76,7 +76,6 @@ class CodeGenerator { // Allocate and install the code. static Handle MakeCodeEpilogue(MacroAssembler* masm, - Code::Flags flags, CompilationInfo* info); // Print the code after compiling it. diff --git a/src/compiler.cc b/src/compiler.cc index 76c70acd30..9ce666c911 100644 --- a/src/compiler.cc +++ b/src/compiler.cc @@ -215,15 +215,6 @@ int CompilationInfo::num_heap_slots() const { } -Code::Flags CompilationInfo::flags() const { - return code_stub() != nullptr - ? Code::ComputeFlags( - code_stub()->GetCodeKind(), code_stub()->GetICState(), - code_stub()->GetExtraICState(), code_stub()->GetStubType()) - : Code::ComputeFlags(Code::OPTIMIZED_FUNCTION); -} - - // Primitive functions are unlikely to be picked up by the stack-walking // profiler, so they trigger their own optimization when they're called // for the SharedFunctionInfo::kCallsUntilPrimitiveOptimization-th time. diff --git a/src/compiler.h b/src/compiler.h index 4775111362..ea311cccfb 100644 --- a/src/compiler.h +++ b/src/compiler.h @@ -173,7 +173,6 @@ class CompilationInfo { int num_parameters_including_this() const; bool is_this_defined() const; int num_heap_slots() const; - Code::Flags flags() const; void set_parameter_count(int parameter_count) { DCHECK(IsStub()); diff --git a/src/compiler/code-generator.cc b/src/compiler/code-generator.cc index 07a741f73e..26683859b0 100644 --- a/src/compiler/code-generator.cc +++ b/src/compiler/code-generator.cc @@ -167,8 +167,8 @@ Handle CodeGenerator::GenerateCode() { safepoints()->Emit(masm(), frame()->GetSpillSlotCount()); - Handle result = v8::internal::CodeGenerator::MakeCodeEpilogue( - masm(), info->flags(), info); + Handle result = + v8::internal::CodeGenerator::MakeCodeEpilogue(masm(), info); result->set_is_turbofanned(true); result->set_stack_slots(frame()->GetSpillSlotCount()); result->set_safepoint_table_offset(safepoints()->GetCodeOffset()); diff --git a/src/full-codegen/full-codegen.cc b/src/full-codegen/full-codegen.cc index 5b8d9c559c..1017b3185b 100644 --- a/src/full-codegen/full-codegen.cc +++ b/src/full-codegen/full-codegen.cc @@ -50,8 +50,7 @@ bool FullCodeGenerator::MakeCode(CompilationInfo* info) { } unsigned table_offset = cgen.EmitBackEdgeTable(); - Code::Flags flags = Code::ComputeFlags(Code::FUNCTION); - Handle code = CodeGenerator::MakeCodeEpilogue(&masm, flags, info); + Handle code = CodeGenerator::MakeCodeEpilogue(&masm, info); cgen.PopulateDeoptimizationData(code); cgen.PopulateTypeFeedbackInfo(code); cgen.PopulateHandlerTable(code); diff --git a/src/lithium.cc b/src/lithium.cc index 728ed67fb5..7d37532ace 100644 --- a/src/lithium.cc +++ b/src/lithium.cc @@ -520,9 +520,7 @@ Handle LChunk::Codegen() { if (generator.GenerateCode()) { generator.CheckEnvironmentUsage(); CodeGenerator::MakeCodePrologue(info(), "optimized"); - Code::Flags flags = info()->flags(); - Handle code = - CodeGenerator::MakeCodeEpilogue(&assembler, flags, info()); + Handle code = CodeGenerator::MakeCodeEpilogue(&assembler, info()); generator.FinishCode(code); CommitDependencies(code); code->set_is_crankshafted(true); diff --git a/test/cctest/compiler/test-pipeline.cc b/test/cctest/compiler/test-pipeline.cc index 8996718644..b14e823ee7 100644 --- a/test/cctest/compiler/test-pipeline.cc +++ b/test/cctest/compiler/test-pipeline.cc @@ -19,6 +19,7 @@ static void RunPipeline(Zone* zone, const char* source) { ParseInfo parse_info(zone, function); CHECK(Compiler::ParseAndAnalyze(&parse_info)); CompilationInfo info(&parse_info); + info.SetOptimizing(BailoutId::None(), Handle(function->code())); Pipeline pipeline(&info); Handle code = pipeline.GenerateCode();