Commit 1b42dae4 authored by hablich's avatar hablich Committed by Commit bot

Revert of [turbofan] Do not use the self reference for turbofan functions....

Revert of [turbofan] Do not use the self reference for turbofan functions. (patchset #2 id:20001 of https://codereview.chromium.org/2150523002/ )

Reason for revert:
Dependency of the roll unblocking revert https://codereview.chromium.org/2147883003/

Original issue's description:
> [turbofan] Do not use the self reference for turbofan functions.
>
> The self reference requires the allocation of a handle in the macro
> assembler, which is not possible if we instantiate the macro assembler
> in a worker thread.
>
> R=mstarzinger@chromium.org, bmeurer@chromium.org
>
> Committed: https://crrev.com/49ef529b3af50f5daadacdcdcd6be3a307c10af5
> Cr-Commit-Position: refs/heads/master@{#37713}

TBR=bmeurer@chromium.org,mstarzinger@chromium.org,jarin@chromium.org,ahaas@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/2147943002
Cr-Commit-Position: refs/heads/master@{#37716}
parent 4edebb1c
......@@ -120,8 +120,7 @@ void CodeGenerator::MakeCodePrologue(CompilationInfo* info, const char* kind) {
Handle<Code> CodeGenerator::MakeCodeEpilogue(MacroAssembler* masm,
EhFrameWriter* eh_frame_writer,
CompilationInfo* info,
Handle<Object> self_reference) {
CompilationInfo* info) {
Isolate* isolate = info->isolate();
// Allocate and install the code.
......@@ -132,9 +131,11 @@ Handle<Code> CodeGenerator::MakeCodeEpilogue(MacroAssembler* masm,
info->IsStub();
masm->GetCode(&desc);
if (eh_frame_writer) eh_frame_writer->GetEhFrame(&desc);
Handle<Code> code = isolate->factory()->NewCode(
desc, flags, self_reference, false, is_crankshafted,
info->prologue_offset(), info->is_debug() && !is_crankshafted);
Handle<Code> code =
isolate->factory()->NewCode(desc, flags, masm->CodeObject(),
false, is_crankshafted,
info->prologue_offset(),
info->is_debug() && !is_crankshafted);
isolate->counters()->total_compiled_code_size()->Increment(
code->instruction_size());
isolate->heap()->IncrementCodeGeneratedBytes(is_crankshafted,
......
......@@ -79,8 +79,7 @@ class CodeGenerator {
// Allocate and install the code.
static Handle<Code> MakeCodeEpilogue(MacroAssembler* masm,
EhFrameWriter* unwinding,
CompilationInfo* info,
Handle<Object> self_reference);
CompilationInfo* info);
// Print the code after compiling it.
static void PrintCode(Handle<Code> code, CompilationInfo* info);
......
......@@ -41,7 +41,7 @@ CodeGenerator::CodeGenerator(Frame* frame, Linkage* linkage,
labels_(zone()->NewArray<Label>(code->InstructionBlockCount())),
current_block_(RpoNumber::Invalid()),
current_source_position_(SourcePosition::Unknown()),
masm_(info->isolate(), nullptr, 0, CodeObjectRequired::kNo),
masm_(info->isolate(), nullptr, 0, CodeObjectRequired::kYes),
resolver_(this),
safepoints_(code->zone()),
handlers_(code->zone()),
......@@ -203,9 +203,8 @@ Handle<Code> CodeGenerator::GenerateCode() {
safepoints()->Emit(masm(), frame()->GetTotalFrameSlotCount());
// Turbofan does not use the self reference.
Handle<Code> result = v8::internal::CodeGenerator::MakeCodeEpilogue(
masm(), nullptr, info, Handle<Object>());
Handle<Code> result =
v8::internal::CodeGenerator::MakeCodeEpilogue(masm(), nullptr, info);
result->set_is_turbofanned(true);
result->set_stack_slots(frame()->GetTotalFrameSlotCount());
result->set_safepoint_table_offset(safepoints()->GetCodeOffset());
......
......@@ -457,8 +457,8 @@ Handle<Code> LChunk::Codegen() {
if (generator.GenerateCode()) {
generator.CheckEnvironmentUsage();
CodeGenerator::MakeCodePrologue(info(), "optimized");
Handle<Code> code = CodeGenerator::MakeCodeEpilogue(
&assembler, nullptr, info(), assembler.CodeObject());
Handle<Code> code =
CodeGenerator::MakeCodeEpilogue(&assembler, nullptr, info());
generator.FinishCode(code);
CommitDependencies(code);
generator.source_position_table_builder()->EndJitLogging(
......
......@@ -54,8 +54,7 @@ bool FullCodeGenerator::MakeCode(CompilationInfo* info) {
}
unsigned table_offset = cgen.EmitBackEdgeTable();
Handle<Code> code =
CodeGenerator::MakeCodeEpilogue(&masm, nullptr, info, masm.CodeObject());
Handle<Code> code = CodeGenerator::MakeCodeEpilogue(&masm, nullptr, info);
cgen.PopulateDeoptimizationData(code);
cgen.PopulateTypeFeedbackInfo(code);
cgen.PopulateHandlerTable(code);
......
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