Remove AbortJS opcode and builtin

This removes the last remaining use of the AbortJS opcode. We now use
AbortCSAAssert instead, which is not influenced by the
--disable-abortjs flag. The AbortJS runtime function should only be
called from JS now.

R=mstarzinger@chromium.org

Bug: v8:9396
Change-Id: I791da99594f9e1e99991ac8b03e943297d7d41e3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1695476
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62633}
This commit is contained in:
Clemens Hammacher 2019-07-11 10:22:36 +02:00 committed by Commit Bot
parent f71ccd7a2b
commit 4a348ab5dd
35 changed files with 6 additions and 175 deletions

View File

@ -268,7 +268,6 @@ namespace internal {
\
/* Abort */ \
TFC(Abort, Abort) \
TFC(AbortJS, Abort) \
TFC(AbortCSAAssert, Abort) \
\
/* Built-in functions for Javascript */ \

View File

@ -860,11 +860,6 @@ TF_BUILTIN(Abort, CodeStubAssembler) {
TailCallRuntime(Runtime::kAbort, NoContextConstant(), message_id);
}
TF_BUILTIN(AbortJS, CodeStubAssembler) {
TNode<String> message = CAST(Parameter(Descriptor::kMessageOrMessageId));
TailCallRuntime(Runtime::kAbortJS, NoContextConstant(), message);
}
TF_BUILTIN(AbortCSAAssert, CodeStubAssembler) {
TNode<String> message = CAST(Parameter(Descriptor::kMessageOrMessageId));
TailCallRuntime(Runtime::kAbortCSAAssert, NoContextConstant(), message);

View File

@ -881,18 +881,6 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
AssembleArchTableSwitch(instr);
DCHECK_EQ(LeaveCC, i.OutputSBit());
break;
case kArchAbortJS:
DCHECK(i.InputRegister(0) == r1);
{
// We don't actually want to generate a pile of code for this, so just
// claim there is a stack frame, without generating one.
FrameScope scope(tasm(), StackFrame::NONE);
__ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
RelocInfo::CODE_TARGET);
}
__ stop();
unwinding_info_writer_.MarkBlockWillExit();
break;
case kArchAbortCSAAssert:
DCHECK(i.InputRegister(0) == r1);
{

View File

@ -441,11 +441,6 @@ void InstructionSelector::VisitStackSlot(Node* node) {
sequence()->AddImmediate(Constant(slot)), 0, nullptr);
}
void InstructionSelector::VisitAbortJS(Node* node) {
ArmOperandGenerator g(this);
Emit(kArchAbortJS, g.NoOutput(), g.UseFixed(node->InputAt(0), r1));
}
void InstructionSelector::VisitAbortCSAAssert(Node* node) {
ArmOperandGenerator g(this);
Emit(kArchAbortCSAAssert, g.NoOutput(), g.UseFixed(node->InputAt(0), r1));

View File

@ -794,18 +794,6 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
case kArchLookupSwitch:
AssembleArchLookupSwitch(instr);
break;
case kArchAbortJS:
DCHECK(i.InputRegister(0).is(x1));
{
// We don't actually want to generate a pile of code for this, so just
// claim there is a stack frame, without generating one.
FrameScope scope(tasm(), StackFrame::NONE);
__ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
RelocInfo::CODE_TARGET);
}
__ Debug("kArchAbortJS", 0, BREAK);
unwinding_info_writer_.MarkBlockWillExit();
break;
case kArchAbortCSAAssert:
DCHECK(i.InputRegister(0).is(x1));
{

View File

@ -535,11 +535,6 @@ void InstructionSelector::VisitStackSlot(Node* node) {
sequence()->AddImmediate(Constant(slot)), 0, nullptr);
}
void InstructionSelector::VisitAbortJS(Node* node) {
Arm64OperandGenerator g(this);
Emit(kArchAbortJS, g.NoOutput(), g.UseFixed(node->InputAt(0), x1));
}
void InstructionSelector::VisitAbortCSAAssert(Node* node) {
Arm64OperandGenerator g(this);
Emit(kArchAbortCSAAssert, g.NoOutput(), g.UseFixed(node->InputAt(0), x1));

View File

@ -885,17 +885,6 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
case kArchComment:
__ RecordComment(reinterpret_cast<const char*>(i.InputInt32(0)));
break;
case kArchAbortJS:
DCHECK(i.InputRegister(0) == edx);
{
// We don't actually want to generate a pile of code for this, so just
// claim there is a stack frame, without generating one.
FrameScope scope(tasm(), StackFrame::NONE);
__ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
RelocInfo::CODE_TARGET);
}
__ int3();
break;
case kArchAbortCSAAssert:
DCHECK(i.InputRegister(0) == edx);
{

View File

@ -272,11 +272,6 @@ void InstructionSelector::VisitStackSlot(Node* node) {
sequence()->AddImmediate(Constant(slot)), 0, nullptr);
}
void InstructionSelector::VisitAbortJS(Node* node) {
IA32OperandGenerator g(this);
Emit(kArchAbortJS, g.NoOutput(), g.UseFixed(node->InputAt(0), edx));
}
void InstructionSelector::VisitAbortCSAAssert(Node* node) {
IA32OperandGenerator g(this);
Emit(kArchAbortCSAAssert, g.NoOutput(), g.UseFixed(node->InputAt(0), edx));

View File

@ -82,7 +82,6 @@ inline RecordWriteMode WriteBarrierKindToRecordWriteMode(
V(ArchLookupSwitch) \
V(ArchTableSwitch) \
V(ArchNop) \
V(ArchAbortJS) \
V(ArchAbortCSAAssert) \
V(ArchDebugBreak) \
V(ArchComment) \

View File

@ -298,7 +298,6 @@ int InstructionScheduler::GetInstructionFlags(const Instruction* instr) const {
case kArchTailCallCodeObject:
case kArchTailCallAddress:
case kArchTailCallWasm:
case kArchAbortJS:
case kArchAbortCSAAssert:
case kArchDebugBreak:
return kHasSideEffect;

View File

@ -1326,9 +1326,6 @@ void InstructionSelector::VisitNode(Node* node) {
case IrOpcode::kStateValues:
case IrOpcode::kObjectState:
return;
case IrOpcode::kAbortJS:
VisitAbortJS(node);
return;
case IrOpcode::kAbortCSAAssert:
VisitAbortCSAAssert(node);
return;

View File

@ -827,17 +827,6 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
case kArchTableSwitch:
AssembleArchTableSwitch(instr);
break;
case kArchAbortJS:
DCHECK(i.InputRegister(0) == a0);
{
// We don't actually want to generate a pile of code for this, so just
// claim there is a stack frame, without generating one.
FrameScope scope(tasm(), StackFrame::NONE);
__ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
RelocInfo::CODE_TARGET);
}
__ stop();
break;
case kArchAbortCSAAssert:
DCHECK(i.InputRegister(0) == a0);
{

View File

@ -1352,7 +1352,6 @@ int InstructionScheduler::GetInstructionLatency(const Instruction* instr) {
return AssembleArchLookupSwitchLatency((instr->InputCount() - 2) / 2);
case kArchTableSwitch:
return AssembleArchTableSwitchLatency();
case kArchAbortJS:
case kArchAbortCSAAssert:
return CallLatency() + 1;
case kArchComment:

View File

@ -274,11 +274,6 @@ void InstructionSelector::VisitStackSlot(Node* node) {
sequence()->AddImmediate(Constant(alignment)), 0, nullptr);
}
void InstructionSelector::VisitAbortJS(Node* node) {
MipsOperandGenerator g(this);
Emit(kArchAbortJS, g.NoOutput(), g.UseFixed(node->InputAt(0), a0));
}
void InstructionSelector::VisitAbortCSAAssert(Node* node) {
MipsOperandGenerator g(this);
Emit(kArchAbortCSAAssert, g.NoOutput(), g.UseFixed(node->InputAt(0), a0));

View File

@ -805,17 +805,6 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
case kArchTableSwitch:
AssembleArchTableSwitch(instr);
break;
case kArchAbortJS:
DCHECK(i.InputRegister(0) == a0);
{
// We don't actually want to generate a pile of code for this, so just
// claim there is a stack frame, without generating one.
FrameScope scope(tasm(), StackFrame::NONE);
__ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
RelocInfo::CODE_TARGET);
}
__ stop();
break;
case kArchAbortCSAAssert:
DCHECK(i.InputRegister(0) == a0);
{

View File

@ -1263,7 +1263,6 @@ int InstructionScheduler::GetInstructionLatency(const Instruction* instr) {
return AssembleArchLookupSwitchLatency(instr);
case kArchTableSwitch:
return AssembleArchTableSwitchLatency();
case kArchAbortJS:
case kArchAbortCSAAssert:
return CallLatency() + 1;
case kArchDebugBreak:

View File

@ -334,11 +334,6 @@ void InstructionSelector::VisitStackSlot(Node* node) {
sequence()->AddImmediate(Constant(alignment)), 0, nullptr);
}
void InstructionSelector::VisitAbortJS(Node* node) {
Mips64OperandGenerator g(this);
Emit(kArchAbortJS, g.NoOutput(), g.UseFixed(node->InputAt(0), a0));
}
void InstructionSelector::VisitAbortCSAAssert(Node* node) {
Mips64OperandGenerator g(this);
Emit(kArchAbortCSAAssert, g.NoOutput(), g.UseFixed(node->InputAt(0), a0));

View File

@ -1083,17 +1083,6 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
AssembleArchTableSwitch(instr);
DCHECK_EQ(LeaveRC, i.OutputRCBit());
break;
case kArchAbortJS:
DCHECK(i.InputRegister(0) == r4);
{
// We don't actually want to generate a pile of code for this, so just
// claim there is a stack frame, without generating one.
FrameScope scope(tasm(), StackFrame::NONE);
__ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
RelocInfo::CODE_TARGET);
}
__ stop();
break;
case kArchAbortCSAAssert:
DCHECK(i.InputRegister(0) == r4);
{

View File

@ -173,11 +173,6 @@ void InstructionSelector::VisitStackSlot(Node* node) {
sequence()->AddImmediate(Constant(slot)), 0, nullptr);
}
void InstructionSelector::VisitAbortJS(Node* node) {
PPCOperandGenerator g(this);
Emit(kArchAbortJS, g.NoOutput(), g.UseFixed(node->InputAt(0), r4));
}
void InstructionSelector::VisitAbortCSAAssert(Node* node) {
PPCOperandGenerator g(this);
Emit(kArchAbortCSAAssert, g.NoOutput(), g.UseFixed(node->InputAt(0), r4));

View File

@ -1558,17 +1558,6 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
case kArchTableSwitch:
AssembleArchTableSwitch(instr);
break;
case kArchAbortJS:
DCHECK(i.InputRegister(0) == r3);
{
// We don't actually want to generate a pile of code for this, so just
// claim there is a stack frame, without generating one.
FrameScope scope(tasm(), StackFrame::NONE);
__ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
RelocInfo::CODE_TARGET);
}
__ stop();
break;
case kArchAbortCSAAssert:
DCHECK(i.InputRegister(0) == r3);
{

View File

@ -690,11 +690,6 @@ void InstructionSelector::VisitStackSlot(Node* node) {
sequence()->AddImmediate(Constant(slot)), 0, nullptr);
}
void InstructionSelector::VisitAbortJS(Node* node) {
S390OperandGenerator g(this);
Emit(kArchAbortJS, g.NoOutput(), g.UseFixed(node->InputAt(0), r3));
}
void InstructionSelector::VisitAbortCSAAssert(Node* node) {
S390OperandGenerator g(this);
Emit(kArchAbortCSAAssert, g.NoOutput(), g.UseFixed(node->InputAt(0), r3));

View File

@ -966,18 +966,6 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
case kArchComment:
__ RecordComment(reinterpret_cast<const char*>(i.InputInt64(0)));
break;
case kArchAbortJS:
DCHECK(i.InputRegister(0) == rdx);
{
// We don't actually want to generate a pile of code for this, so just
// claim there is a stack frame, without generating one.
FrameScope scope(tasm(), StackFrame::NONE);
__ Call(isolate()->builtins()->builtin_handle(Builtins::kAbortJS),
RelocInfo::CODE_TARGET);
}
__ int3();
unwinding_info_writer_.MarkBlockWillExit();
break;
case kArchAbortCSAAssert:
DCHECK(i.InputRegister(0) == rdx);
{

View File

@ -309,11 +309,6 @@ void InstructionSelector::VisitStackSlot(Node* node) {
sequence()->AddImmediate(Constant(slot)), 0, nullptr);
}
void InstructionSelector::VisitAbortJS(Node* node) {
X64OperandGenerator g(this);
Emit(kArchAbortJS, g.NoOutput(), g.UseFixed(node->InputAt(0), rdx));
}
void InstructionSelector::VisitAbortCSAAssert(Node* node) {
X64OperandGenerator g(this);
Emit(kArchAbortCSAAssert, g.NoOutput(), g.UseFixed(node->InputAt(0), rdx));

View File

@ -226,11 +226,12 @@ void CodeAssembler::GenerateCheckMaybeObjectIsObject(Node* node,
IntPtrConstant(kHeapObjectTagMask)),
IntPtrConstant(kWeakHeapObjectTag)),
&ok);
Node* message_node = StringConstant(location);
// TODO(clemensh): Avoid {AbortJS} here, as it will be disabled by fuzzers
// (via --disable-abortjs). Remove the {AbortJS} opcode and builtin
// afterwards.
AbortJS(message_node);
EmbeddedVector<char, 1024> message;
SNPrintF(message, "no Object: %s", location);
Node* message_node = StringConstant(message.begin());
// This somewhat misuses the AbortCSAAssert runtime function. This will print
// "abort: CSA_ASSERT failed: <message>", which is good enough.
AbortCSAAssert(message_node);
Unreachable();
Bind(&ok);
}
@ -412,10 +413,6 @@ void CodeAssembler::ReturnRaw(Node* value) {
return raw_assembler()->Return(value);
}
void CodeAssembler::AbortJS(Node* message) {
raw_assembler()->AbortJS(message);
}
void CodeAssembler::AbortCSAAssert(Node* message) {
raw_assembler()->AbortCSAAssert(message);
}

View File

@ -893,7 +893,6 @@ class V8_EXPORT_PRIVATE CodeAssembler {
void ReturnRaw(Node* value);
void AbortJS(Node* message);
void AbortCSAAssert(Node* message);
void DebugBreak();
void Unreachable();

View File

@ -46,7 +46,6 @@ Reduction CsaLoadElimination::Reduce(Node* node) {
case IrOpcode::kStoreToObject:
return ReduceStoreToObject(node, ObjectAccessOf(node->op()));
case IrOpcode::kDebugBreak:
case IrOpcode::kAbortJS:
case IrOpcode::kAbortCSAAssert:
// Avoid changing optimizations in the presence of debug instructions.
return PropagateInputState(node);

View File

@ -558,7 +558,6 @@ class MachineRepresentationChecker {
case IrOpcode::kParameter:
case IrOpcode::kProjection:
break;
case IrOpcode::kAbortJS:
case IrOpcode::kAbortCSAAssert:
CheckValueInputIsTagged(node, 0);
break;

View File

@ -821,13 +821,6 @@ struct MachineOperatorGlobalCache {
};
Word64PoisonOnSpeculation kWord64PoisonOnSpeculation;
struct AbortJSOperator : public Operator {
AbortJSOperator()
: Operator(IrOpcode::kAbortJS, Operator::kNoThrow, "AbortJS", 1, 1, 1,
0, 1, 0) {}
};
AbortJSOperator kAbortJS;
struct AbortCSAAssertOperator : public Operator {
AbortCSAAssertOperator()
: Operator(IrOpcode::kAbortCSAAssert, Operator::kNoThrow,
@ -1026,8 +1019,6 @@ const Operator* MachineOperatorBuilder::BitcastMaybeObjectToWord() {
return &cache_.kBitcastMaybeObjectToWord;
}
const Operator* MachineOperatorBuilder::AbortJS() { return &cache_.kAbortJS; }
const Operator* MachineOperatorBuilder::AbortCSAAssert() {
return &cache_.kAbortCSAAssert;
}

View File

@ -219,7 +219,6 @@ class V8_EXPORT_PRIVATE MachineOperatorBuilder final
AlignmentRequirements::FullUnalignedAccessSupport());
const Operator* Comment(const char* msg);
const Operator* AbortJS();
const Operator* AbortCSAAssert();
const Operator* DebugBreak();
const Operator* UnsafePointerAdd();

View File

@ -99,7 +99,6 @@ bool CanAllocate(const Node* node) {
case IrOpcode::kBitcastTaggedToWord:
case IrOpcode::kBitcastWordToTagged:
case IrOpcode::kComment:
case IrOpcode::kAbortJS:
case IrOpcode::kAbortCSAAssert:
case IrOpcode::kDebugBreak:
case IrOpcode::kDeoptimizeIf:

View File

@ -629,7 +629,6 @@
MACHINE_FLOAT64_BINOP_LIST(V) \
MACHINE_FLOAT64_UNOP_LIST(V) \
MACHINE_WORD64_ATOMIC_OP_LIST(V) \
V(AbortJS) \
V(AbortCSAAssert) \
V(DebugBreak) \
V(Comment) \

View File

@ -556,10 +556,6 @@ void RawMachineAssembler::PopAndReturn(Node* pop, Node* v1, Node* v2, Node* v3,
current_block_ = nullptr;
}
void RawMachineAssembler::AbortJS(Node* message) {
AddNode(machine()->AbortJS(), message);
}
void RawMachineAssembler::AbortCSAAssert(Node* message) {
AddNode(machine()->AbortCSAAssert(), message);
}

View File

@ -1019,7 +1019,6 @@ class V8_EXPORT_PRIVATE RawMachineAssembler {
void PopAndReturn(Node* pop, Node* v1, Node* v2, Node* v3, Node* v4);
void Bind(RawMachineLabel* label);
void Deoptimize(Node* state);
void AbortJS(Node* message);
void AbortCSAAssert(Node* message);
void DebugBreak();
void Unreachable();

View File

@ -934,7 +934,6 @@ void Verifier::Visitor::Check(Node* node, const AllNodes& all) {
break;
case IrOpcode::kComment:
case IrOpcode::kAbortJS:
case IrOpcode::kAbortCSAAssert:
case IrOpcode::kDebugBreak:
case IrOpcode::kRetain:

View File

@ -907,7 +907,6 @@ static bool TransitivelyCalledBuiltinHasNoSideEffect(Builtins::Name caller,
switch (callee) {
// Transitively called Builtins:
case Builtins::kAbort:
case Builtins::kAbortJS:
case Builtins::kAbortCSAAssert:
case Builtins::kAdaptorWithBuiltinExitFrame:
case Builtins::kArrayConstructorImpl: