Commit 476a8853 authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[turbofan] Remove remnants of deferred frame building.

R=clemensh@chromium.org

Change-Id: I756507bea262c16eb60e1c78dfb349d54633d37d
Reviewed-on: https://chromium-review.googlesource.com/1124689Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54190}
parent 1da6cd9f
......@@ -2933,49 +2933,41 @@ void CodeGenerator::AssembleConstructFrame() {
const RegList saves_fp = call_descriptor->CalleeSavedFPRegisters();
if (shrink_slots > 0) {
if (info()->IsWasm()) {
if (shrink_slots > 128) {
// For WebAssembly functions with big frames we have to do the stack
// overflow check before we construct the frame. Otherwise we may not
// have enough space on the stack to call the runtime for the stack
// overflow.
Label done;
// If the frame is bigger than the stack, we throw the stack overflow
// exception unconditionally. Thereby we can avoid the integer overflow
// check in the condition code.
if ((shrink_slots * kPointerSize) < (FLAG_stack_size * 1024)) {
UseScratchRegisterScope temps(tasm());
Register scratch = temps.Acquire();
__ Move(scratch,
Operand(ExternalReference::address_of_real_stack_limit(
__ isolate())));
__ ldr(scratch, MemOperand(scratch));
__ add(scratch, scratch, Operand(shrink_slots * kPointerSize));
__ cmp(sp, scratch);
__ b(cs, &done);
}
if (!frame_access_state()->has_frame()) {
__ set_has_frame(true);
// There is no need to leave the frame, we will not return from the
// runtime call.
__ EnterFrame(StackFrame::WASM_COMPILED);
}
__ ldr(r2, FieldMemOperand(kWasmInstanceRegister,
WasmInstanceObject::kCEntryStubOffset));
__ Move(cp, Smi::kZero);
__ CallRuntimeWithCEntry(Runtime::kThrowWasmStackOverflow, r2);
// We come from WebAssembly, there are no references for the GC.
ReferenceMap* reference_map = new (zone()) ReferenceMap(zone());
RecordSafepoint(reference_map, Safepoint::kSimple, 0,
Safepoint::kNoLazyDeopt);
if (FLAG_debug_code) {
__ stop(GetAbortReason(AbortReason::kUnexpectedReturnFromThrow));
}
DCHECK(frame_access_state()->has_frame());
if (info()->IsWasm() && shrink_slots > 128) {
// For WebAssembly functions with big frames we have to do the stack
// overflow check before we construct the frame. Otherwise we may not
// have enough space on the stack to call the runtime for the stack
// overflow.
Label done;
// If the frame is bigger than the stack, we throw the stack overflow
// exception unconditionally. Thereby we can avoid the integer overflow
// check in the condition code.
if ((shrink_slots * kPointerSize) < (FLAG_stack_size * 1024)) {
UseScratchRegisterScope temps(tasm());
Register scratch = temps.Acquire();
__ Move(scratch, Operand(ExternalReference::address_of_real_stack_limit(
__ isolate())));
__ ldr(scratch, MemOperand(scratch));
__ add(scratch, scratch, Operand(shrink_slots * kPointerSize));
__ cmp(sp, scratch);
__ b(cs, &done);
}
__ bind(&done);
__ ldr(r2, FieldMemOperand(kWasmInstanceRegister,
WasmInstanceObject::kCEntryStubOffset));
__ Move(cp, Smi::kZero);
__ CallRuntimeWithCEntry(Runtime::kThrowWasmStackOverflow, r2);
// We come from WebAssembly, there are no references for the GC.
ReferenceMap* reference_map = new (zone()) ReferenceMap(zone());
RecordSafepoint(reference_map, Safepoint::kSimple, 0,
Safepoint::kNoLazyDeopt);
if (FLAG_debug_code) {
__ stop(GetAbortReason(AbortReason::kUnexpectedReturnFromThrow));
}
__ bind(&done);
}
// Skip callee-saved and return slots, which are pushed below.
......
......@@ -2430,15 +2430,8 @@ void CodeGenerator::AssembleConstructFrame() {
__ B(hs, &done);
}
if (!frame_access_state()->has_frame()) {
__ set_has_frame(true);
// There is no need to leave the frame, we will not return from the
// runtime call.
__ EnterFrame(StackFrame::WASM_COMPILED);
} else {
{
// Finish the frame that hasn't been fully built yet.
// TODO(mstarzinger): This is a work-around, deferred frame building is
// actually no longer supported, remove the associated code.
UseScratchRegisterScope temps(tasm());
__ Claim(2); // Claim extra slots for marker + instance.
Register scratch = temps.AcquireX();
......
......@@ -9,7 +9,6 @@
#include "src/compiler/node-matchers.h"
#include "src/compiler/operator-properties.h"
#include "src/compiler/simplified-operator.h"
#include "src/zone/zone-list-inl.h" // TODO(mstarzinger): Fix zone-handle-set.h instead!
#ifdef DEBUG
#define TRACE(...) \
......
......@@ -4012,6 +4012,7 @@ void CodeGenerator::AssembleConstructFrame() {
const RegList saves = call_descriptor->CalleeSavedRegisters();
if (shrink_slots > 0) {
DCHECK(frame_access_state()->has_frame());
if (info()->IsWasm() && shrink_slots > 128) {
// For WebAssembly functions with big frames we have to do the stack
// overflow check before we construct the frame. Otherwise we may not
......@@ -4034,10 +4035,6 @@ void CodeGenerator::AssembleConstructFrame() {
__ pop(scratch);
__ j(above_equal, &done);
}
if (!frame_access_state()->has_frame()) {
__ set_has_frame(true);
__ EnterFrame(StackFrame::WASM_COMPILED);
}
__ mov(ecx, FieldOperand(kWasmInstanceRegister,
WasmInstanceObject::kCEntryStubOffset));
__ Move(esi, Smi::kZero);
......
......@@ -733,7 +733,7 @@ std::ostream& operator<<(std::ostream& os,
os << " " << std::setw(5) << j << ": " << printable_instr << std::endl;
}
os << " succecessors:";
os << " successors:";
for (RpoNumber succ : block->successors()) {
os << " B" << succ.ToInt();
}
......
......@@ -3087,6 +3087,7 @@ void CodeGenerator::AssembleConstructFrame() {
const RegList saves_fp = call_descriptor->CalleeSavedFPRegisters();
if (shrink_slots > 0) {
DCHECK(frame_access_state()->has_frame());
if (info()->IsWasm() && shrink_slots > 128) {
// For WebAssembly functions with big frames we have to do the stack
// overflow check before we construct the frame. Otherwise we may not
......@@ -3105,10 +3106,6 @@ void CodeGenerator::AssembleConstructFrame() {
__ cmpq(rsp, kScratchRegister);
__ j(above_equal, &done);
}
if (!frame_access_state()->has_frame()) {
__ set_has_frame(true);
__ EnterFrame(StackFrame::WASM_COMPILED);
}
__ movp(rcx, FieldOperand(kWasmInstanceRegister,
WasmInstanceObject::kCEntryStubOffset));
__ Move(rsi, Smi::kZero);
......
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