Index: src/arm/code-stubs-arm.cc |
diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc |
index d7e1fd54e09d668b1be740a76dd82ddefc75d1f5..691d192baf12633210f7b0698b242a51710faa35 100644 |
--- a/src/arm/code-stubs-arm.cc |
+++ b/src/arm/code-stubs-arm.cc |
@@ -19,146 +19,23 @@ namespace v8 { |
namespace internal { |
-void FastNewClosureStub::InitializeInterfaceDescriptor( |
- CodeStubInterfaceDescriptor* descriptor) { |
- Register registers[] = { cp, r2 }; |
- descriptor->Initialize( |
- MajorKey(), arraysize(registers), registers, |
- Runtime::FunctionForId(Runtime::kNewClosureFromStubFailure)->entry); |
-} |
- |
- |
-void FastNewContextStub::InitializeInterfaceDescriptor( |
- CodeStubInterfaceDescriptor* descriptor) { |
- Register registers[] = { cp, r1 }; |
- descriptor->Initialize(MajorKey(), arraysize(registers), registers); |
-} |
- |
- |
-void ToNumberStub::InitializeInterfaceDescriptor( |
- CodeStubInterfaceDescriptor* descriptor) { |
- Register registers[] = { cp, r0 }; |
- descriptor->Initialize(MajorKey(), arraysize(registers), registers); |
-} |
- |
- |
-void NumberToStringStub::InitializeInterfaceDescriptor( |
- CodeStubInterfaceDescriptor* descriptor) { |
- Register registers[] = { cp, r0 }; |
- descriptor->Initialize( |
- MajorKey(), arraysize(registers), registers, |
- Runtime::FunctionForId(Runtime::kNumberToStringRT)->entry); |
-} |
- |
- |
-void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( |
- CodeStubInterfaceDescriptor* descriptor) { |
- Register registers[] = { cp, r3, r2, r1 }; |
- Representation representations[] = { |
- Representation::Tagged(), |
- Representation::Tagged(), |
- Representation::Smi(), |
- Representation::Tagged() }; |
- descriptor->Initialize( |
- MajorKey(), arraysize(registers), registers, |
- Runtime::FunctionForId(Runtime::kCreateArrayLiteralStubBailout)->entry, |
- representations); |
-} |
- |
- |
-void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( |
- CodeStubInterfaceDescriptor* descriptor) { |
- Register registers[] = { cp, r3, r2, r1, r0 }; |
- descriptor->Initialize( |
- MajorKey(), arraysize(registers), registers, |
- Runtime::FunctionForId(Runtime::kCreateObjectLiteral)->entry); |
-} |
- |
- |
-void CreateAllocationSiteStub::InitializeInterfaceDescriptor( |
- CodeStubInterfaceDescriptor* descriptor) { |
- Register registers[] = { cp, r2, r3 }; |
- descriptor->Initialize(MajorKey(), arraysize(registers), registers); |
-} |
- |
- |
-void CallFunctionStub::InitializeInterfaceDescriptor( |
- CodeStubInterfaceDescriptor* descriptor) { |
- // r1 function the function to call |
- Register registers[] = {cp, r1}; |
- descriptor->Initialize(MajorKey(), arraysize(registers), registers); |
-} |
- |
- |
-void CallConstructStub::InitializeInterfaceDescriptor( |
- CodeStubInterfaceDescriptor* descriptor) { |
- // r0 : number of arguments |
- // r1 : the function to call |
- // r2 : feedback vector |
- // r3 : (only if r2 is not the megamorphic symbol) slot in feedback |
- // vector (Smi) |
- // TODO(turbofan): So far we don't gather type feedback and hence skip the |
- // slot parameter, but ArrayConstructStub needs the vector to be undefined. |
- Register registers[] = {cp, r0, r1, r2}; |
- descriptor->Initialize(MajorKey(), arraysize(registers), registers); |
-} |
- |
- |
-void RegExpConstructResultStub::InitializeInterfaceDescriptor( |
- CodeStubInterfaceDescriptor* descriptor) { |
- Register registers[] = { cp, r2, r1, r0 }; |
- descriptor->Initialize( |
- MajorKey(), arraysize(registers), registers, |
- Runtime::FunctionForId(Runtime::kRegExpConstructResult)->entry); |
-} |
- |
- |
-void TransitionElementsKindStub::InitializeInterfaceDescriptor( |
- CodeStubInterfaceDescriptor* descriptor) { |
- Register registers[] = { cp, r0, r1 }; |
- Address entry = |
- Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry; |
- descriptor->Initialize(MajorKey(), arraysize(registers), registers, |
- FUNCTION_ADDR(entry)); |
-} |
- |
- |
-void CompareNilICStub::InitializeInterfaceDescriptor( |
- CodeStubInterfaceDescriptor* descriptor) { |
- Register registers[] = { cp, r0 }; |
- descriptor->Initialize(MajorKey(), arraysize(registers), registers, |
- FUNCTION_ADDR(CompareNilIC_Miss)); |
- descriptor->SetMissHandler( |
- ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate())); |
-} |
- |
- |
static void InitializeArrayConstructorDescriptor( |
- CodeStub::Major major, CodeStubInterfaceDescriptor* descriptor, |
+ Isolate* isolate, CodeStub::Major major, |
+ CodeStubInterfaceDescriptor* descriptor, |
int constant_stack_parameter_count) { |
- // register state |
- // cp -- context |
- // r0 -- number of arguments |
- // r1 -- function |
- // r2 -- allocation site with elements kind |
Address deopt_handler = Runtime::FunctionForId( |
Runtime::kArrayConstructor)->entry; |
if (constant_stack_parameter_count == 0) { |
- Register registers[] = { cp, r1, r2 }; |
- descriptor->Initialize(major, arraysize(registers), registers, |
- deopt_handler, NULL, constant_stack_parameter_count, |
+ CallInterfaceDescriptor* call_descriptor = isolate->call_descriptor( |
+ CallDescriptorKey::ArrayConstructorConstantArgCountCall); |
+ descriptor->Initialize(major, call_descriptor, deopt_handler, |
+ constant_stack_parameter_count, |
JS_FUNCTION_STUB_MODE); |
} else { |
- // stack param count needs (constructor pointer, and single argument) |
- Register registers[] = { cp, r1, r2, r0 }; |
- Representation representations[] = { |
- Representation::Tagged(), |
- Representation::Tagged(), |
- Representation::Tagged(), |
- Representation::Integer32() }; |
- descriptor->Initialize(major, arraysize(registers), registers, r0, |
- deopt_handler, representations, |
+ CallInterfaceDescriptor* call_descriptor = |
+ isolate->call_descriptor(CallDescriptorKey::ArrayConstructorCall); |
+ descriptor->Initialize(major, call_descriptor, r0, deopt_handler, |
constant_stack_parameter_count, |
JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS); |
} |
@@ -166,29 +43,22 @@ static void InitializeArrayConstructorDescriptor( |
static void InitializeInternalArrayConstructorDescriptor( |
- CodeStub::Major major, CodeStubInterfaceDescriptor* descriptor, |
+ Isolate* isolate, CodeStub::Major major, |
+ CodeStubInterfaceDescriptor* descriptor, |
int constant_stack_parameter_count) { |
- // register state |
- // cp -- context |
- // r0 -- number of arguments |
- // r1 -- constructor function |
Address deopt_handler = Runtime::FunctionForId( |
Runtime::kInternalArrayConstructor)->entry; |
if (constant_stack_parameter_count == 0) { |
- Register registers[] = { cp, r1 }; |
- descriptor->Initialize(major, arraysize(registers), registers, |
- deopt_handler, NULL, constant_stack_parameter_count, |
+ CallInterfaceDescriptor* call_descriptor = isolate->call_descriptor( |
+ CallDescriptorKey::InternalArrayConstructorConstantArgCountCall); |
+ descriptor->Initialize(major, call_descriptor, deopt_handler, |
+ constant_stack_parameter_count, |
JS_FUNCTION_STUB_MODE); |
} else { |
- // stack param count needs (constructor pointer, and single argument) |
- Register registers[] = { cp, r1, r0 }; |
- Representation representations[] = { |
- Representation::Tagged(), |
- Representation::Tagged(), |
- Representation::Integer32() }; |
- descriptor->Initialize(major, arraysize(registers), registers, r0, |
- deopt_handler, representations, |
+ CallInterfaceDescriptor* call_descriptor = isolate->call_descriptor( |
+ CallDescriptorKey::InternalArrayConstructorCall); |
+ descriptor->Initialize(major, call_descriptor, r0, deopt_handler, |
constant_stack_parameter_count, |
JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS); |
} |
@@ -197,73 +67,40 @@ static void InitializeInternalArrayConstructorDescriptor( |
void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( |
CodeStubInterfaceDescriptor* descriptor) { |
- InitializeArrayConstructorDescriptor(MajorKey(), descriptor, 0); |
+ InitializeArrayConstructorDescriptor(isolate(), MajorKey(), descriptor, 0); |
} |
void ArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( |
CodeStubInterfaceDescriptor* descriptor) { |
- InitializeArrayConstructorDescriptor(MajorKey(), descriptor, 1); |
+ InitializeArrayConstructorDescriptor(isolate(), MajorKey(), descriptor, 1); |
} |
void ArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( |
CodeStubInterfaceDescriptor* descriptor) { |
- InitializeArrayConstructorDescriptor(MajorKey(), descriptor, -1); |
-} |
- |
- |
-void ToBooleanStub::InitializeInterfaceDescriptor( |
- CodeStubInterfaceDescriptor* descriptor) { |
- Register registers[] = { cp, r0 }; |
- descriptor->Initialize(MajorKey(), arraysize(registers), registers, |
- FUNCTION_ADDR(ToBooleanIC_Miss)); |
- descriptor->SetMissHandler( |
- ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate())); |
+ InitializeArrayConstructorDescriptor(isolate(), MajorKey(), descriptor, -1); |
} |
void InternalArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( |
CodeStubInterfaceDescriptor* descriptor) { |
- InitializeInternalArrayConstructorDescriptor(MajorKey(), descriptor, 0); |
+ InitializeInternalArrayConstructorDescriptor(isolate(), MajorKey(), |
+ descriptor, 0); |
} |
void InternalArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( |
CodeStubInterfaceDescriptor* descriptor) { |
- InitializeInternalArrayConstructorDescriptor(MajorKey(), descriptor, 1); |
+ InitializeInternalArrayConstructorDescriptor(isolate(), MajorKey(), |
+ descriptor, 1); |
} |
void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( |
CodeStubInterfaceDescriptor* descriptor) { |
- InitializeInternalArrayConstructorDescriptor(MajorKey(), descriptor, -1); |
-} |
- |
- |
-void BinaryOpICStub::InitializeInterfaceDescriptor( |
- CodeStubInterfaceDescriptor* descriptor) { |
- Register registers[] = { cp, r1, r0 }; |
- descriptor->Initialize(MajorKey(), arraysize(registers), registers, |
- FUNCTION_ADDR(BinaryOpIC_Miss)); |
- descriptor->SetMissHandler( |
- ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate())); |
-} |
- |
- |
-void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor( |
- CodeStubInterfaceDescriptor* descriptor) { |
- Register registers[] = { cp, r2, r1, r0 }; |
- descriptor->Initialize(MajorKey(), arraysize(registers), registers, |
- FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite)); |
-} |
- |
- |
-void StringAddStub::InitializeInterfaceDescriptor( |
- CodeStubInterfaceDescriptor* descriptor) { |
- Register registers[] = { cp, r1, r0 }; |
- descriptor->Initialize(MajorKey(), arraysize(registers), registers, |
- Runtime::FunctionForId(Runtime::kStringAdd)->entry); |
+ InitializeInternalArrayConstructorDescriptor(isolate(), MajorKey(), |
+ descriptor, -1); |
} |
@@ -1797,12 +1634,6 @@ void FunctionPrototypeStub::Generate(MacroAssembler* masm) { |
} |
-Register InstanceofStub::left() { return r0; } |
- |
- |
-Register InstanceofStub::right() { return r1; } |
- |
- |
void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) { |
// The displacement is the offset of the last parameter (if any) |
// relative to the frame pointer. |