Deprecate semi-correct CompilationInfo::flags predicate.

R=titzer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#30308}
This commit is contained in:
mstarzinger 2015-08-21 08:10:38 -07:00 committed by Commit bot
parent 843d5d5ca4
commit ef2fd24e9f
8 changed files with 14 additions and 19 deletions

View File

@ -149,10 +149,18 @@ void CodeGenerator::MakeCodePrologue(CompilationInfo* info, const char* kind) {
Handle<Code> 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 =

View File

@ -76,7 +76,6 @@ class CodeGenerator {
// Allocate and install the code.
static Handle<Code> MakeCodeEpilogue(MacroAssembler* masm,
Code::Flags flags,
CompilationInfo* info);
// Print the code after compiling it.

View File

@ -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.

View File

@ -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());

View File

@ -167,8 +167,8 @@ Handle<Code> CodeGenerator::GenerateCode() {
safepoints()->Emit(masm(), frame()->GetSpillSlotCount());
Handle<Code> result = v8::internal::CodeGenerator::MakeCodeEpilogue(
masm(), info->flags(), info);
Handle<Code> 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());

View File

@ -50,8 +50,7 @@ bool FullCodeGenerator::MakeCode(CompilationInfo* info) {
}
unsigned table_offset = cgen.EmitBackEdgeTable();
Code::Flags flags = Code::ComputeFlags(Code::FUNCTION);
Handle<Code> code = CodeGenerator::MakeCodeEpilogue(&masm, flags, info);
Handle<Code> code = CodeGenerator::MakeCodeEpilogue(&masm, info);
cgen.PopulateDeoptimizationData(code);
cgen.PopulateTypeFeedbackInfo(code);
cgen.PopulateHandlerTable(code);

View File

@ -520,9 +520,7 @@ Handle<Code> LChunk::Codegen() {
if (generator.GenerateCode()) {
generator.CheckEnvironmentUsage();
CodeGenerator::MakeCodePrologue(info(), "optimized");
Code::Flags flags = info()->flags();
Handle<Code> code =
CodeGenerator::MakeCodeEpilogue(&assembler, flags, info());
Handle<Code> code = CodeGenerator::MakeCodeEpilogue(&assembler, info());
generator.FinishCode(code);
CommitDependencies(code);
code->set_is_crankshafted(true);

View File

@ -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<Code>(function->code()));
Pipeline pipeline(&info);
Handle<Code> code = pipeline.GenerateCode();