Commit be9fd5b1 authored by Igor Sheludko's avatar Igor Sheludko Committed by Commit Bot

[csa][builtins] Port Abort builtin to CSA.

Bug: v8:5269, v8:7754
Change-Id: I5cde20c269b60145b20e9cfbbd94bcaf3fac6feb
Reviewed-on: https://chromium-review.googlesource.com/1110132Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53960}
parent 76ac6372
...@@ -170,7 +170,7 @@ void ConstructStubDescriptor::InitializePlatformSpecific( ...@@ -170,7 +170,7 @@ void ConstructStubDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void AbortJSDescriptor::InitializePlatformSpecific( void AbortDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {r1}; Register registers[] = {r1};
data->InitializePlatformSpecific(arraysize(registers), registers); data->InitializePlatformSpecific(arraysize(registers), registers);
......
...@@ -171,7 +171,7 @@ void ConstructStubDescriptor::InitializePlatformSpecific( ...@@ -171,7 +171,7 @@ void ConstructStubDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void AbortJSDescriptor::InitializePlatformSpecific( void AbortDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {x1}; Register registers[] = {x1};
data->InitializePlatformSpecific(arraysize(registers), registers); data->InitializePlatformSpecific(arraysize(registers), registers);
......
...@@ -2150,17 +2150,6 @@ void Builtins::Generate_Construct(MacroAssembler* masm) { ...@@ -2150,17 +2150,6 @@ void Builtins::Generate_Construct(MacroAssembler* masm) {
RelocInfo::CODE_TARGET); 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) { void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
// ----------- S t a t e ------------- // ----------- S t a t e -------------
// -- r0 : actual number of arguments // -- r0 : actual number of arguments
......
...@@ -2540,19 +2540,6 @@ void Builtins::Generate_Construct(MacroAssembler* masm) { ...@@ -2540,19 +2540,6 @@ void Builtins::Generate_Construct(MacroAssembler* masm) {
RelocInfo::CODE_TARGET); 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) { void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
ASM_LOCATION("Builtins::Generate_ArgumentsAdaptorTrampoline"); ASM_LOCATION("Builtins::Generate_ArgumentsAdaptorTrampoline");
// ----------- S t a t e ------------- // ----------- S t a t e -------------
......
...@@ -223,8 +223,8 @@ namespace internal { ...@@ -223,8 +223,8 @@ namespace internal {
TFS(DeleteProperty, kObject, kKey, kLanguageMode) \ TFS(DeleteProperty, kObject, kKey, kLanguageMode) \
\ \
/* Abort */ \ /* Abort */ \
ASM(Abort) \ TFC(Abort, Abort, 1) \
TFC(AbortJS, AbortJS, 1) \ TFC(AbortJS, Abort, 1) \
\ \
/* Built-in functions for Javascript */ \ /* Built-in functions for Javascript */ \
/* Special internal builtins */ \ /* Special internal builtins */ \
......
...@@ -1105,10 +1105,14 @@ TF_BUILTIN(AllocateInOldSpace, CodeStubAssembler) { ...@@ -1105,10 +1105,14 @@ TF_BUILTIN(AllocateInOldSpace, CodeStubAssembler) {
SmiFromInt32(requested_size), SmiConstant(flags)); 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) { TF_BUILTIN(AbortJS, CodeStubAssembler) {
Node* message = Parameter(Descriptor::kObject); TNode<String> message = CAST(Parameter(Descriptor::kMessageOrMessageId));
Node* reason = SmiConstant(0); TailCallRuntime(Runtime::kAbortJS, NoContextConstant(), message);
TailCallRuntime(Runtime::kAbortJS, reason, message);
} }
void Builtins::Generate_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit( void Builtins::Generate_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit(
......
...@@ -2294,19 +2294,6 @@ void Builtins::Generate_Construct(MacroAssembler* masm) { ...@@ -2294,19 +2294,6 @@ void Builtins::Generate_Construct(MacroAssembler* masm) {
RelocInfo::CODE_TARGET); 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) { void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
// ----------- S t a t e ------------- // ----------- S t a t e -------------
// -- eax : actual number of arguments // -- eax : actual number of arguments
......
...@@ -2204,17 +2204,6 @@ void Builtins::Generate_Construct(MacroAssembler* masm) { ...@@ -2204,17 +2204,6 @@ void Builtins::Generate_Construct(MacroAssembler* masm) {
RelocInfo::CODE_TARGET); 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) { void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
// State setup as expected by MacroAssembler::InvokePrologue. // State setup as expected by MacroAssembler::InvokePrologue.
// ----------- S t a t e ------------- // ----------- S t a t e -------------
......
...@@ -2219,17 +2219,6 @@ void Builtins::Generate_Construct(MacroAssembler* masm) { ...@@ -2219,17 +2219,6 @@ void Builtins::Generate_Construct(MacroAssembler* masm) {
RelocInfo::CODE_TARGET); 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) { void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
// State setup as expected by MacroAssembler::InvokePrologue. // State setup as expected by MacroAssembler::InvokePrologue.
// ----------- S t a t e ------------- // ----------- S t a t e -------------
......
...@@ -2223,17 +2223,6 @@ void Builtins::Generate_Construct(MacroAssembler* masm) { ...@@ -2223,17 +2223,6 @@ void Builtins::Generate_Construct(MacroAssembler* masm) {
RelocInfo::CODE_TARGET); 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) { void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
// ----------- S t a t e ------------- // ----------- S t a t e -------------
// -- r3 : actual number of arguments // -- r3 : actual number of arguments
......
...@@ -2229,17 +2229,6 @@ void Builtins::Generate_Construct(MacroAssembler* masm) { ...@@ -2229,17 +2229,6 @@ void Builtins::Generate_Construct(MacroAssembler* masm) {
RelocInfo::CODE_TARGET); 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) { void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
// ----------- S t a t e ------------- // ----------- S t a t e -------------
// -- r2 : actual number of arguments // -- r2 : actual number of arguments
......
...@@ -1732,19 +1732,6 @@ static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) { ...@@ -1732,19 +1732,6 @@ static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) {
__ PushReturnAddressFrom(rcx); __ 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) { void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
// ----------- S t a t e ------------- // ----------- S t a t e -------------
// -- rax : actual number of arguments // -- rax : actual number of arguments
......
...@@ -171,7 +171,7 @@ void ConstructStubDescriptor::InitializePlatformSpecific( ...@@ -171,7 +171,7 @@ void ConstructStubDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void AbortJSDescriptor::InitializePlatformSpecific( void AbortDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {edx}; Register registers[] = {edx};
data->InitializePlatformSpecific(arraysize(registers), registers); data->InitializePlatformSpecific(arraysize(registers), registers);
......
...@@ -56,6 +56,7 @@ void CallDescriptors::InitializeOncePerProcess() { ...@@ -56,6 +56,7 @@ void CallDescriptors::InitializeOncePerProcess() {
DCHECK(!NoContextDescriptor{}.HasContextParameter()); DCHECK(!NoContextDescriptor{}.HasContextParameter());
DCHECK(!AllocateDescriptor{}.HasContextParameter()); DCHECK(!AllocateDescriptor{}.HasContextParameter());
DCHECK(!AllocateHeapNumberDescriptor{}.HasContextParameter()); DCHECK(!AllocateHeapNumberDescriptor{}.HasContextParameter());
DCHECK(!AbortDescriptor{}.HasContextParameter());
} }
void CallDescriptors::TearDown() { void CallDescriptors::TearDown() {
......
...@@ -47,7 +47,7 @@ namespace internal { ...@@ -47,7 +47,7 @@ namespace internal {
V(ConstructWithSpread) \ V(ConstructWithSpread) \
V(ConstructWithArrayLike) \ V(ConstructWithArrayLike) \
V(JSTrampoline) \ V(JSTrampoline) \
V(AbortJS) \ V(Abort) \
V(AllocateHeapNumber) \ V(AllocateHeapNumber) \
V(ArrayConstructor) \ V(ArrayConstructor) \
V(ArrayNoArgumentConstructor) \ V(ArrayNoArgumentConstructor) \
...@@ -748,11 +748,11 @@ class CallFunctionDescriptor : public CallInterfaceDescriptor { ...@@ -748,11 +748,11 @@ class CallFunctionDescriptor : public CallInterfaceDescriptor {
DECLARE_DESCRIPTOR(CallFunctionDescriptor, CallInterfaceDescriptor) DECLARE_DESCRIPTOR(CallFunctionDescriptor, CallInterfaceDescriptor)
}; };
class AbortJSDescriptor : public CallInterfaceDescriptor { class AbortDescriptor : public CallInterfaceDescriptor {
public: public:
DEFINE_PARAMETERS(kObject) DEFINE_PARAMETERS_NO_CONTEXT(kMessageOrMessageId)
DEFINE_PARAMETER_TYPES(MachineType::AnyTagged()) DEFINE_PARAMETER_TYPES(MachineType::AnyTagged())
DECLARE_DESCRIPTOR(AbortJSDescriptor, CallInterfaceDescriptor) DECLARE_DESCRIPTOR(AbortDescriptor, CallInterfaceDescriptor)
}; };
class AllocateHeapNumberDescriptor : public CallInterfaceDescriptor { class AllocateHeapNumberDescriptor : public CallInterfaceDescriptor {
......
...@@ -170,7 +170,7 @@ void ConstructStubDescriptor::InitializePlatformSpecific( ...@@ -170,7 +170,7 @@ void ConstructStubDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void AbortJSDescriptor::InitializePlatformSpecific( void AbortDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {a0}; Register registers[] = {a0};
data->InitializePlatformSpecific(arraysize(registers), registers); data->InitializePlatformSpecific(arraysize(registers), registers);
......
...@@ -170,7 +170,7 @@ void ConstructStubDescriptor::InitializePlatformSpecific( ...@@ -170,7 +170,7 @@ void ConstructStubDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void AbortJSDescriptor::InitializePlatformSpecific( void AbortDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {a0}; Register registers[] = {a0};
data->InitializePlatformSpecific(arraysize(registers), registers); data->InitializePlatformSpecific(arraysize(registers), registers);
......
...@@ -170,7 +170,7 @@ void ConstructStubDescriptor::InitializePlatformSpecific( ...@@ -170,7 +170,7 @@ void ConstructStubDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void AbortJSDescriptor::InitializePlatformSpecific( void AbortDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {r4}; Register registers[] = {r4};
data->InitializePlatformSpecific(arraysize(registers), registers); data->InitializePlatformSpecific(arraysize(registers), registers);
......
...@@ -169,7 +169,7 @@ void ConstructStubDescriptor::InitializePlatformSpecific( ...@@ -169,7 +169,7 @@ void ConstructStubDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void AbortJSDescriptor::InitializePlatformSpecific( void AbortDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {r3}; Register registers[] = {r3};
data->InitializePlatformSpecific(arraysize(registers), registers); data->InitializePlatformSpecific(arraysize(registers), registers);
......
...@@ -172,7 +172,7 @@ void ConstructStubDescriptor::InitializePlatformSpecific( ...@@ -172,7 +172,7 @@ void ConstructStubDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void AbortJSDescriptor::InitializePlatformSpecific( void AbortDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
Register registers[] = {rdx}; Register registers[] = {rdx};
data->InitializePlatformSpecific(arraysize(registers), registers); data->InitializePlatformSpecific(arraysize(registers), registers);
......
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