[csa][builtins] Port Abort builtin to CSA.
Bug: v8:5269, v8:7754 Change-Id: I5cde20c269b60145b20e9cfbbd94bcaf3fac6feb Reviewed-on: https://chromium-review.googlesource.com/1110132 Reviewed-by: Jakob Gruber <jgruber@chromium.org> Commit-Queue: Igor Sheludko <ishell@chromium.org> Cr-Commit-Position: refs/heads/master@{#53960}
This commit is contained in:
parent
76ac6372fa
commit
be9fd5b123
@ -170,7 +170,7 @@ void ConstructStubDescriptor::InitializePlatformSpecific(
|
||||
data->InitializePlatformSpecific(arraysize(registers), registers);
|
||||
}
|
||||
|
||||
void AbortJSDescriptor::InitializePlatformSpecific(
|
||||
void AbortDescriptor::InitializePlatformSpecific(
|
||||
CallInterfaceDescriptorData* data) {
|
||||
Register registers[] = {r1};
|
||||
data->InitializePlatformSpecific(arraysize(registers), registers);
|
||||
|
@ -171,7 +171,7 @@ void ConstructStubDescriptor::InitializePlatformSpecific(
|
||||
data->InitializePlatformSpecific(arraysize(registers), registers);
|
||||
}
|
||||
|
||||
void AbortJSDescriptor::InitializePlatformSpecific(
|
||||
void AbortDescriptor::InitializePlatformSpecific(
|
||||
CallInterfaceDescriptorData* data) {
|
||||
Register registers[] = {x1};
|
||||
data->InitializePlatformSpecific(arraysize(registers), registers);
|
||||
|
@ -2150,17 +2150,6 @@ void Builtins::Generate_Construct(MacroAssembler* masm) {
|
||||
RelocInfo::CODE_TARGET);
|
||||
}
|
||||
|
||||
// static
|
||||
void Builtins::Generate_Abort(MacroAssembler* masm) {
|
||||
// ----------- S t a t e -------------
|
||||
// -- r1 : message_id as Smi
|
||||
// -- lr : return address
|
||||
// -----------------------------------
|
||||
__ Push(r1);
|
||||
__ Move(cp, Smi::kZero);
|
||||
__ TailCallRuntime(Runtime::kAbort);
|
||||
}
|
||||
|
||||
void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
|
||||
// ----------- S t a t e -------------
|
||||
// -- r0 : actual number of arguments
|
||||
|
@ -2540,19 +2540,6 @@ void Builtins::Generate_Construct(MacroAssembler* masm) {
|
||||
RelocInfo::CODE_TARGET);
|
||||
}
|
||||
|
||||
// static
|
||||
void Builtins::Generate_Abort(MacroAssembler* masm) {
|
||||
ASM_LOCATION("Builtins::Generate_Abort");
|
||||
// ----------- S t a t e -------------
|
||||
// -- x1 : message_id as Smi
|
||||
// -- lr : return address
|
||||
// -----------------------------------
|
||||
MacroAssembler::NoUseRealAbortsScope no_use_real_aborts(masm);
|
||||
__ PushArgument(x1);
|
||||
__ Move(cp, Smi::kZero);
|
||||
__ TailCallRuntime(Runtime::kAbort);
|
||||
}
|
||||
|
||||
void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
|
||||
ASM_LOCATION("Builtins::Generate_ArgumentsAdaptorTrampoline");
|
||||
// ----------- S t a t e -------------
|
||||
|
@ -223,8 +223,8 @@ namespace internal {
|
||||
TFS(DeleteProperty, kObject, kKey, kLanguageMode) \
|
||||
\
|
||||
/* Abort */ \
|
||||
ASM(Abort) \
|
||||
TFC(AbortJS, AbortJS, 1) \
|
||||
TFC(Abort, Abort, 1) \
|
||||
TFC(AbortJS, Abort, 1) \
|
||||
\
|
||||
/* Built-in functions for Javascript */ \
|
||||
/* Special internal builtins */ \
|
||||
|
@ -1105,10 +1105,14 @@ TF_BUILTIN(AllocateInOldSpace, CodeStubAssembler) {
|
||||
SmiFromInt32(requested_size), SmiConstant(flags));
|
||||
}
|
||||
|
||||
TF_BUILTIN(Abort, CodeStubAssembler) {
|
||||
TNode<Smi> message_id = CAST(Parameter(Descriptor::kMessageOrMessageId));
|
||||
TailCallRuntime(Runtime::kAbort, NoContextConstant(), message_id);
|
||||
}
|
||||
|
||||
TF_BUILTIN(AbortJS, CodeStubAssembler) {
|
||||
Node* message = Parameter(Descriptor::kObject);
|
||||
Node* reason = SmiConstant(0);
|
||||
TailCallRuntime(Runtime::kAbortJS, reason, message);
|
||||
TNode<String> message = CAST(Parameter(Descriptor::kMessageOrMessageId));
|
||||
TailCallRuntime(Runtime::kAbortJS, NoContextConstant(), message);
|
||||
}
|
||||
|
||||
void Builtins::Generate_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit(
|
||||
|
@ -2294,19 +2294,6 @@ void Builtins::Generate_Construct(MacroAssembler* masm) {
|
||||
RelocInfo::CODE_TARGET);
|
||||
}
|
||||
|
||||
// static
|
||||
void Builtins::Generate_Abort(MacroAssembler* masm) {
|
||||
// ----------- S t a t e -------------
|
||||
// -- edx : message_id as Smi
|
||||
// -- esp[0] : return address
|
||||
// -----------------------------------
|
||||
__ PopReturnAddressTo(ecx);
|
||||
__ Push(edx);
|
||||
__ PushReturnAddressFrom(ecx);
|
||||
__ Move(esi, Smi::kZero);
|
||||
__ TailCallRuntime(Runtime::kAbort);
|
||||
}
|
||||
|
||||
void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
|
||||
// ----------- S t a t e -------------
|
||||
// -- eax : actual number of arguments
|
||||
|
@ -2204,17 +2204,6 @@ void Builtins::Generate_Construct(MacroAssembler* masm) {
|
||||
RelocInfo::CODE_TARGET);
|
||||
}
|
||||
|
||||
// static
|
||||
void Builtins::Generate_Abort(MacroAssembler* masm) {
|
||||
// ----------- S t a t e -------------
|
||||
// -- a0 : message_id as Smi
|
||||
// -- ra : return address
|
||||
// -----------------------------------
|
||||
__ Push(a0);
|
||||
__ Move(cp, Smi::kZero);
|
||||
__ TailCallRuntime(Runtime::kAbort);
|
||||
}
|
||||
|
||||
void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
|
||||
// State setup as expected by MacroAssembler::InvokePrologue.
|
||||
// ----------- S t a t e -------------
|
||||
|
@ -2219,17 +2219,6 @@ void Builtins::Generate_Construct(MacroAssembler* masm) {
|
||||
RelocInfo::CODE_TARGET);
|
||||
}
|
||||
|
||||
// static
|
||||
void Builtins::Generate_Abort(MacroAssembler* masm) {
|
||||
// ----------- S t a t e -------------
|
||||
// -- a0 : message_id as Smi
|
||||
// -- ra : return address
|
||||
// -----------------------------------
|
||||
__ Push(a0);
|
||||
__ Move(cp, Smi::kZero);
|
||||
__ TailCallRuntime(Runtime::kAbort);
|
||||
}
|
||||
|
||||
void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
|
||||
// State setup as expected by MacroAssembler::InvokePrologue.
|
||||
// ----------- S t a t e -------------
|
||||
|
@ -2223,17 +2223,6 @@ void Builtins::Generate_Construct(MacroAssembler* masm) {
|
||||
RelocInfo::CODE_TARGET);
|
||||
}
|
||||
|
||||
// static
|
||||
void Builtins::Generate_Abort(MacroAssembler* masm) {
|
||||
// ----------- S t a t e -------------
|
||||
// -- r4 : message_id as Smi
|
||||
// -- lr : return address
|
||||
// -----------------------------------
|
||||
__ push(r4);
|
||||
__ LoadSmiLiteral(cp, Smi::kZero);
|
||||
__ TailCallRuntime(Runtime::kAbort);
|
||||
}
|
||||
|
||||
void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
|
||||
// ----------- S t a t e -------------
|
||||
// -- r3 : actual number of arguments
|
||||
|
@ -2229,17 +2229,6 @@ void Builtins::Generate_Construct(MacroAssembler* masm) {
|
||||
RelocInfo::CODE_TARGET);
|
||||
}
|
||||
|
||||
// static
|
||||
void Builtins::Generate_Abort(MacroAssembler* masm) {
|
||||
// ----------- S t a t e -------------
|
||||
// -- r3 : message_id as Smi
|
||||
// -- lr : return address
|
||||
// -----------------------------------
|
||||
__ push(r3);
|
||||
__ LoadSmiLiteral(cp, Smi::kZero);
|
||||
__ TailCallRuntime(Runtime::kAbort);
|
||||
}
|
||||
|
||||
void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
|
||||
// ----------- S t a t e -------------
|
||||
// -- r2 : actual number of arguments
|
||||
|
@ -1732,19 +1732,6 @@ static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) {
|
||||
__ PushReturnAddressFrom(rcx);
|
||||
}
|
||||
|
||||
// static
|
||||
void Builtins::Generate_Abort(MacroAssembler* masm) {
|
||||
// ----------- S t a t e -------------
|
||||
// -- rdx : message_id as Smi
|
||||
// -- rsp[0] : return address
|
||||
// -----------------------------------
|
||||
__ PopReturnAddressTo(rcx);
|
||||
__ Push(rdx);
|
||||
__ PushReturnAddressFrom(rcx);
|
||||
__ Move(rsi, Smi::kZero);
|
||||
__ TailCallRuntime(Runtime::kAbort);
|
||||
}
|
||||
|
||||
void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
|
||||
// ----------- S t a t e -------------
|
||||
// -- rax : actual number of arguments
|
||||
|
@ -171,7 +171,7 @@ void ConstructStubDescriptor::InitializePlatformSpecific(
|
||||
data->InitializePlatformSpecific(arraysize(registers), registers);
|
||||
}
|
||||
|
||||
void AbortJSDescriptor::InitializePlatformSpecific(
|
||||
void AbortDescriptor::InitializePlatformSpecific(
|
||||
CallInterfaceDescriptorData* data) {
|
||||
Register registers[] = {edx};
|
||||
data->InitializePlatformSpecific(arraysize(registers), registers);
|
||||
|
@ -56,6 +56,7 @@ void CallDescriptors::InitializeOncePerProcess() {
|
||||
DCHECK(!NoContextDescriptor{}.HasContextParameter());
|
||||
DCHECK(!AllocateDescriptor{}.HasContextParameter());
|
||||
DCHECK(!AllocateHeapNumberDescriptor{}.HasContextParameter());
|
||||
DCHECK(!AbortDescriptor{}.HasContextParameter());
|
||||
}
|
||||
|
||||
void CallDescriptors::TearDown() {
|
||||
|
@ -47,7 +47,7 @@ namespace internal {
|
||||
V(ConstructWithSpread) \
|
||||
V(ConstructWithArrayLike) \
|
||||
V(JSTrampoline) \
|
||||
V(AbortJS) \
|
||||
V(Abort) \
|
||||
V(AllocateHeapNumber) \
|
||||
V(ArrayConstructor) \
|
||||
V(ArrayNoArgumentConstructor) \
|
||||
@ -748,11 +748,11 @@ class CallFunctionDescriptor : public CallInterfaceDescriptor {
|
||||
DECLARE_DESCRIPTOR(CallFunctionDescriptor, CallInterfaceDescriptor)
|
||||
};
|
||||
|
||||
class AbortJSDescriptor : public CallInterfaceDescriptor {
|
||||
class AbortDescriptor : public CallInterfaceDescriptor {
|
||||
public:
|
||||
DEFINE_PARAMETERS(kObject)
|
||||
DEFINE_PARAMETERS_NO_CONTEXT(kMessageOrMessageId)
|
||||
DEFINE_PARAMETER_TYPES(MachineType::AnyTagged())
|
||||
DECLARE_DESCRIPTOR(AbortJSDescriptor, CallInterfaceDescriptor)
|
||||
DECLARE_DESCRIPTOR(AbortDescriptor, CallInterfaceDescriptor)
|
||||
};
|
||||
|
||||
class AllocateHeapNumberDescriptor : public CallInterfaceDescriptor {
|
||||
|
@ -170,7 +170,7 @@ void ConstructStubDescriptor::InitializePlatformSpecific(
|
||||
data->InitializePlatformSpecific(arraysize(registers), registers);
|
||||
}
|
||||
|
||||
void AbortJSDescriptor::InitializePlatformSpecific(
|
||||
void AbortDescriptor::InitializePlatformSpecific(
|
||||
CallInterfaceDescriptorData* data) {
|
||||
Register registers[] = {a0};
|
||||
data->InitializePlatformSpecific(arraysize(registers), registers);
|
||||
|
@ -170,7 +170,7 @@ void ConstructStubDescriptor::InitializePlatformSpecific(
|
||||
data->InitializePlatformSpecific(arraysize(registers), registers);
|
||||
}
|
||||
|
||||
void AbortJSDescriptor::InitializePlatformSpecific(
|
||||
void AbortDescriptor::InitializePlatformSpecific(
|
||||
CallInterfaceDescriptorData* data) {
|
||||
Register registers[] = {a0};
|
||||
data->InitializePlatformSpecific(arraysize(registers), registers);
|
||||
|
@ -170,7 +170,7 @@ void ConstructStubDescriptor::InitializePlatformSpecific(
|
||||
data->InitializePlatformSpecific(arraysize(registers), registers);
|
||||
}
|
||||
|
||||
void AbortJSDescriptor::InitializePlatformSpecific(
|
||||
void AbortDescriptor::InitializePlatformSpecific(
|
||||
CallInterfaceDescriptorData* data) {
|
||||
Register registers[] = {r4};
|
||||
data->InitializePlatformSpecific(arraysize(registers), registers);
|
||||
|
@ -169,7 +169,7 @@ void ConstructStubDescriptor::InitializePlatformSpecific(
|
||||
data->InitializePlatformSpecific(arraysize(registers), registers);
|
||||
}
|
||||
|
||||
void AbortJSDescriptor::InitializePlatformSpecific(
|
||||
void AbortDescriptor::InitializePlatformSpecific(
|
||||
CallInterfaceDescriptorData* data) {
|
||||
Register registers[] = {r3};
|
||||
data->InitializePlatformSpecific(arraysize(registers), registers);
|
||||
|
@ -172,7 +172,7 @@ void ConstructStubDescriptor::InitializePlatformSpecific(
|
||||
data->InitializePlatformSpecific(arraysize(registers), registers);
|
||||
}
|
||||
|
||||
void AbortJSDescriptor::InitializePlatformSpecific(
|
||||
void AbortDescriptor::InitializePlatformSpecific(
|
||||
CallInterfaceDescriptorData* data) {
|
||||
Register registers[] = {rdx};
|
||||
data->InitializePlatformSpecific(arraysize(registers), registers);
|
||||
|
Loading…
Reference in New Issue
Block a user