Commit b6b96bf4 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[compiler] Remove unneeded conditional

The {FrameScope} with {StackFrame::NONE} just sets the {has_frame_}
field in the {TurboAssembler}, so it's fine to just unconditionally do
that. The field will be reverted to the previous state when the
{FrameScope} dies.

R=mstarzinger@chromium.org

Bug: v8:9396
Change-Id: Iec56a9bd45d19eda689ff033df58928d6edbdcf0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1692930
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62626}
parent 3a8e6fb7
...@@ -883,32 +883,25 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -883,32 +883,25 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break; break;
case kArchAbortJS: case kArchAbortJS:
DCHECK(i.InputRegister(0) == r1); DCHECK(i.InputRegister(0) == r1);
if (!frame_access_state()->has_frame()) { {
// We don't actually want to generate a pile of code for this, so just // We don't actually want to generate a pile of code for this, so just
// claim there is a stack frame, without generating one. // claim there is a stack frame, without generating one.
FrameScope scope(tasm(), StackFrame::NONE); FrameScope scope(tasm(), StackFrame::NONE);
__ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS), __ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
RelocInfo::CODE_TARGET); RelocInfo::CODE_TARGET);
} else {
__ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
RelocInfo::CODE_TARGET);
} }
__ stop(); __ stop();
unwinding_info_writer_.MarkBlockWillExit(); unwinding_info_writer_.MarkBlockWillExit();
break; break;
case kArchAbortCSAAssert: case kArchAbortCSAAssert:
DCHECK(i.InputRegister(0) == r1); DCHECK(i.InputRegister(0) == r1);
if (!frame_access_state()->has_frame()) { {
// We don't actually want to generate a pile of code for this, so just // We don't actually want to generate a pile of code for this, so just
// claim there is a stack frame, without generating one. // claim there is a stack frame, without generating one.
FrameScope scope(tasm(), StackFrame::NONE); FrameScope scope(tasm(), StackFrame::NONE);
__ Call( __ Call(
isolate()->builtins()->builtin_handle(Builtins::kAbortCSAAssert), isolate()->builtins()->builtin_handle(Builtins::kAbortCSAAssert),
RelocInfo::CODE_TARGET); RelocInfo::CODE_TARGET);
} else {
__ Call(
isolate()->builtins()->builtin_handle(Builtins::kAbortCSAAssert),
RelocInfo::CODE_TARGET);
} }
__ stop(); __ stop();
unwinding_info_writer_.MarkBlockWillExit(); unwinding_info_writer_.MarkBlockWillExit();
......
...@@ -796,32 +796,25 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -796,32 +796,25 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break; break;
case kArchAbortJS: case kArchAbortJS:
DCHECK(i.InputRegister(0).is(x1)); DCHECK(i.InputRegister(0).is(x1));
if (!frame_access_state()->has_frame()) { {
// We don't actually want to generate a pile of code for this, so just // We don't actually want to generate a pile of code for this, so just
// claim there is a stack frame, without generating one. // claim there is a stack frame, without generating one.
FrameScope scope(tasm(), StackFrame::NONE); FrameScope scope(tasm(), StackFrame::NONE);
__ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS), __ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
RelocInfo::CODE_TARGET); RelocInfo::CODE_TARGET);
} else {
__ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
RelocInfo::CODE_TARGET);
} }
__ Debug("kArchAbortJS", 0, BREAK); __ Debug("kArchAbortJS", 0, BREAK);
unwinding_info_writer_.MarkBlockWillExit(); unwinding_info_writer_.MarkBlockWillExit();
break; break;
case kArchAbortCSAAssert: case kArchAbortCSAAssert:
DCHECK(i.InputRegister(0).is(x1)); DCHECK(i.InputRegister(0).is(x1));
if (!frame_access_state()->has_frame()) { {
// We don't actually want to generate a pile of code for this, so just // We don't actually want to generate a pile of code for this, so just
// claim there is a stack frame, without generating one. // claim there is a stack frame, without generating one.
FrameScope scope(tasm(), StackFrame::NONE); FrameScope scope(tasm(), StackFrame::NONE);
__ Call( __ Call(
isolate()->builtins()->builtin_handle(Builtins::kAbortCSAAssert), isolate()->builtins()->builtin_handle(Builtins::kAbortCSAAssert),
RelocInfo::CODE_TARGET); RelocInfo::CODE_TARGET);
} else {
__ Call(
isolate()->builtins()->builtin_handle(Builtins::kAbortCSAAssert),
RelocInfo::CODE_TARGET);
} }
__ Debug("kArchAbortCSAAssert", 0, BREAK); __ Debug("kArchAbortCSAAssert", 0, BREAK);
unwinding_info_writer_.MarkBlockWillExit(); unwinding_info_writer_.MarkBlockWillExit();
......
...@@ -887,31 +887,24 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -887,31 +887,24 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break; break;
case kArchAbortJS: case kArchAbortJS:
DCHECK(i.InputRegister(0) == edx); DCHECK(i.InputRegister(0) == edx);
if (!frame_access_state()->has_frame()) { {
// We don't actually want to generate a pile of code for this, so just // We don't actually want to generate a pile of code for this, so just
// claim there is a stack frame, without generating one. // claim there is a stack frame, without generating one.
FrameScope scope(tasm(), StackFrame::NONE); FrameScope scope(tasm(), StackFrame::NONE);
__ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS), __ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
RelocInfo::CODE_TARGET); RelocInfo::CODE_TARGET);
} else {
__ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
RelocInfo::CODE_TARGET);
} }
__ int3(); __ int3();
break; break;
case kArchAbortCSAAssert: case kArchAbortCSAAssert:
DCHECK(i.InputRegister(0) == edx); DCHECK(i.InputRegister(0) == edx);
if (!frame_access_state()->has_frame()) { {
// We don't actually want to generate a pile of code for this, so just // We don't actually want to generate a pile of code for this, so just
// claim there is a stack frame, without generating one. // claim there is a stack frame, without generating one.
FrameScope scope(tasm(), StackFrame::NONE); FrameScope scope(tasm(), StackFrame::NONE);
__ Call( __ Call(
isolate()->builtins()->builtin_handle(Builtins::kAbortCSAAssert), isolate()->builtins()->builtin_handle(Builtins::kAbortCSAAssert),
RelocInfo::CODE_TARGET); RelocInfo::CODE_TARGET);
} else {
__ Call(
isolate()->builtins()->builtin_handle(Builtins::kAbortCSAAssert),
RelocInfo::CODE_TARGET);
} }
__ int3(); __ int3();
break; break;
......
...@@ -829,31 +829,24 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -829,31 +829,24 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break; break;
case kArchAbortJS: case kArchAbortJS:
DCHECK(i.InputRegister(0) == a0); DCHECK(i.InputRegister(0) == a0);
if (!frame_access_state()->has_frame()) { {
// We don't actually want to generate a pile of code for this, so just // We don't actually want to generate a pile of code for this, so just
// claim there is a stack frame, without generating one. // claim there is a stack frame, without generating one.
FrameScope scope(tasm(), StackFrame::NONE); FrameScope scope(tasm(), StackFrame::NONE);
__ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS), __ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
RelocInfo::CODE_TARGET); RelocInfo::CODE_TARGET);
} else {
__ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
RelocInfo::CODE_TARGET);
} }
__ stop(); __ stop();
break; break;
case kArchAbortCSAAssert: case kArchAbortCSAAssert:
DCHECK(i.InputRegister(0) == a0); DCHECK(i.InputRegister(0) == a0);
if (!frame_access_state()->has_frame()) { {
// We don't actually want to generate a pile of code for this, so just // We don't actually want to generate a pile of code for this, so just
// claim there is a stack frame, without generating one. // claim there is a stack frame, without generating one.
FrameScope scope(tasm(), StackFrame::NONE); FrameScope scope(tasm(), StackFrame::NONE);
__ Call( __ Call(
isolate()->builtins()->builtin_handle(Builtins::kAbortCSAAssert), isolate()->builtins()->builtin_handle(Builtins::kAbortCSAAssert),
RelocInfo::CODE_TARGET); RelocInfo::CODE_TARGET);
} else {
__ Call(
isolate()->builtins()->builtin_handle(Builtins::kAbortCSAAssert),
RelocInfo::CODE_TARGET);
} }
__ stop(); __ stop();
break; break;
......
...@@ -807,31 +807,24 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -807,31 +807,24 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break; break;
case kArchAbortJS: case kArchAbortJS:
DCHECK(i.InputRegister(0) == a0); DCHECK(i.InputRegister(0) == a0);
if (!frame_access_state()->has_frame()) { {
// We don't actually want to generate a pile of code for this, so just // We don't actually want to generate a pile of code for this, so just
// claim there is a stack frame, without generating one. // claim there is a stack frame, without generating one.
FrameScope scope(tasm(), StackFrame::NONE); FrameScope scope(tasm(), StackFrame::NONE);
__ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS), __ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
RelocInfo::CODE_TARGET); RelocInfo::CODE_TARGET);
} else {
__ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
RelocInfo::CODE_TARGET);
} }
__ stop(); __ stop();
break; break;
case kArchAbortCSAAssert: case kArchAbortCSAAssert:
DCHECK(i.InputRegister(0) == a0); DCHECK(i.InputRegister(0) == a0);
if (!frame_access_state()->has_frame()) { {
// We don't actually want to generate a pile of code for this, so just // We don't actually want to generate a pile of code for this, so just
// claim there is a stack frame, without generating one. // claim there is a stack frame, without generating one.
FrameScope scope(tasm(), StackFrame::NONE); FrameScope scope(tasm(), StackFrame::NONE);
__ Call( __ Call(
isolate()->builtins()->builtin_handle(Builtins::kAbortCSAAssert), isolate()->builtins()->builtin_handle(Builtins::kAbortCSAAssert),
RelocInfo::CODE_TARGET); RelocInfo::CODE_TARGET);
} else {
__ Call(
isolate()->builtins()->builtin_handle(Builtins::kAbortCSAAssert),
RelocInfo::CODE_TARGET);
} }
__ stop(); __ stop();
break; break;
......
...@@ -1085,31 +1085,24 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -1085,31 +1085,24 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break; break;
case kArchAbortJS: case kArchAbortJS:
DCHECK(i.InputRegister(0) == r4); DCHECK(i.InputRegister(0) == r4);
if (!frame_access_state()->has_frame()) { {
// We don't actually want to generate a pile of code for this, so just // We don't actually want to generate a pile of code for this, so just
// claim there is a stack frame, without generating one. // claim there is a stack frame, without generating one.
FrameScope scope(tasm(), StackFrame::NONE); FrameScope scope(tasm(), StackFrame::NONE);
__ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS), __ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
RelocInfo::CODE_TARGET); RelocInfo::CODE_TARGET);
} else {
__ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
RelocInfo::CODE_TARGET);
} }
__ stop(); __ stop();
break; break;
case kArchAbortCSAAssert: case kArchAbortCSAAssert:
DCHECK(i.InputRegister(0) == r4); DCHECK(i.InputRegister(0) == r4);
if (!frame_access_state()->has_frame()) { {
// We don't actually want to generate a pile of code for this, so just // We don't actually want to generate a pile of code for this, so just
// claim there is a stack frame, without generating one. // claim there is a stack frame, without generating one.
FrameScope scope(tasm(), StackFrame::NONE); FrameScope scope(tasm(), StackFrame::NONE);
__ Call( __ Call(
isolate()->builtins()->builtin_handle(Builtins::kAbortCSAAssert), isolate()->builtins()->builtin_handle(Builtins::kAbortCSAAssert),
RelocInfo::CODE_TARGET); RelocInfo::CODE_TARGET);
} else {
__ Call(
isolate()->builtins()->builtin_handle(Builtins::kAbortCSAAssert),
RelocInfo::CODE_TARGET);
} }
__ stop(); __ stop();
break; break;
......
...@@ -1560,31 +1560,24 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -1560,31 +1560,24 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break; break;
case kArchAbortJS: case kArchAbortJS:
DCHECK(i.InputRegister(0) == r3); DCHECK(i.InputRegister(0) == r3);
if (!frame_access_state()->has_frame()) { {
// We don't actually want to generate a pile of code for this, so just // We don't actually want to generate a pile of code for this, so just
// claim there is a stack frame, without generating one. // claim there is a stack frame, without generating one.
FrameScope scope(tasm(), StackFrame::NONE); FrameScope scope(tasm(), StackFrame::NONE);
__ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS), __ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
RelocInfo::CODE_TARGET); RelocInfo::CODE_TARGET);
} else {
__ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
RelocInfo::CODE_TARGET);
} }
__ stop(); __ stop();
break; break;
case kArchAbortCSAAssert: case kArchAbortCSAAssert:
DCHECK(i.InputRegister(0) == r3); DCHECK(i.InputRegister(0) == r3);
if (!frame_access_state()->has_frame()) { {
// We don't actually want to generate a pile of code for this, so just // We don't actually want to generate a pile of code for this, so just
// claim there is a stack frame, without generating one. // claim there is a stack frame, without generating one.
FrameScope scope(tasm(), StackFrame::NONE); FrameScope scope(tasm(), StackFrame::NONE);
__ Call( __ Call(
isolate()->builtins()->builtin_handle(Builtins::kAbortCSAAssert), isolate()->builtins()->builtin_handle(Builtins::kAbortCSAAssert),
RelocInfo::CODE_TARGET); RelocInfo::CODE_TARGET);
} else {
__ Call(
isolate()->builtins()->builtin_handle(Builtins::kAbortCSAAssert),
RelocInfo::CODE_TARGET);
} }
__ stop(); __ stop();
break; break;
......
...@@ -968,32 +968,25 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -968,32 +968,25 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break; break;
case kArchAbortJS: case kArchAbortJS:
DCHECK(i.InputRegister(0) == rdx); DCHECK(i.InputRegister(0) == rdx);
if (!frame_access_state()->has_frame()) { {
// We don't actually want to generate a pile of code for this, so just // We don't actually want to generate a pile of code for this, so just
// claim there is a stack frame, without generating one. // claim there is a stack frame, without generating one.
FrameScope scope(tasm(), StackFrame::NONE); FrameScope scope(tasm(), StackFrame::NONE);
__ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS), __ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
RelocInfo::CODE_TARGET); RelocInfo::CODE_TARGET);
} else {
__ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
RelocInfo::CODE_TARGET);
} }
__ int3(); __ int3();
unwinding_info_writer_.MarkBlockWillExit(); unwinding_info_writer_.MarkBlockWillExit();
break; break;
case kArchAbortCSAAssert: case kArchAbortCSAAssert:
DCHECK(i.InputRegister(0) == rdx); DCHECK(i.InputRegister(0) == rdx);
if (!frame_access_state()->has_frame()) { {
// We don't actually want to generate a pile of code for this, so just // We don't actually want to generate a pile of code for this, so just
// claim there is a stack frame, without generating one. // claim there is a stack frame, without generating one.
FrameScope scope(tasm(), StackFrame::NONE); FrameScope scope(tasm(), StackFrame::NONE);
__ Call( __ Call(
isolate()->builtins()->builtin_handle(Builtins::kAbortCSAAssert), isolate()->builtins()->builtin_handle(Builtins::kAbortCSAAssert),
RelocInfo::CODE_TARGET); RelocInfo::CODE_TARGET);
} else {
__ Call(
isolate()->builtins()->builtin_handle(Builtins::kAbortCSAAssert),
RelocInfo::CODE_TARGET);
} }
__ int3(); __ int3();
unwinding_info_writer_.MarkBlockWillExit(); unwinding_info_writer_.MarkBlockWillExit();
......
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