Index: src/ia32/code-stubs-ia32.cc |
diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc |
index 88d2c9eeb222d1250455a05dbab72b43540f1c7f..25299ef6950bcb77d52c6d6ed47f9be587e78d0f 100644 |
--- a/src/ia32/code-stubs-ia32.cc |
+++ b/src/ia32/code-stubs-ia32.cc |
@@ -19,110 +19,6 @@ namespace v8 { |
namespace internal { |
-void FastNewClosureStub::InitializeInterfaceDescriptor( |
- CodeStubInterfaceDescriptor* descriptor) { |
- Register registers[] = { esi, ebx }; |
- descriptor->Initialize( |
- MajorKey(), arraysize(registers), registers, |
- Runtime::FunctionForId(Runtime::kNewClosureFromStubFailure)->entry); |
-} |
- |
- |
-void FastNewContextStub::InitializeInterfaceDescriptor( |
- CodeStubInterfaceDescriptor* descriptor) { |
- Register registers[] = { esi, edi }; |
- descriptor->Initialize(MajorKey(), arraysize(registers), registers); |
-} |
- |
- |
-void ToNumberStub::InitializeInterfaceDescriptor( |
- CodeStubInterfaceDescriptor* descriptor) { |
- // ToNumberStub invokes a function, and therefore needs a context. |
- Register registers[] = { esi, eax }; |
- descriptor->Initialize(MajorKey(), arraysize(registers), registers); |
-} |
- |
- |
-void NumberToStringStub::InitializeInterfaceDescriptor( |
- CodeStubInterfaceDescriptor* descriptor) { |
- Register registers[] = { esi, eax }; |
- descriptor->Initialize( |
- MajorKey(), arraysize(registers), registers, |
- Runtime::FunctionForId(Runtime::kNumberToStringRT)->entry); |
-} |
- |
- |
-void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( |
- CodeStubInterfaceDescriptor* descriptor) { |
- Register registers[] = { esi, eax, ebx, ecx }; |
- 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[] = { esi, eax, ebx, ecx, edx }; |
- descriptor->Initialize( |
- MajorKey(), arraysize(registers), registers, |
- Runtime::FunctionForId(Runtime::kCreateObjectLiteral)->entry); |
-} |
- |
- |
-void CreateAllocationSiteStub::InitializeInterfaceDescriptor( |
- CodeStubInterfaceDescriptor* descriptor) { |
- Register registers[] = { esi, ebx, edx }; |
- descriptor->Initialize(MajorKey(), arraysize(registers), registers); |
-} |
- |
- |
-void CallFunctionStub::InitializeInterfaceDescriptor( |
- CodeStubInterfaceDescriptor* descriptor) { |
- Register registers[] = {esi, edi}; |
- descriptor->Initialize(MajorKey(), arraysize(registers), registers); |
-} |
- |
- |
-void CallConstructStub::InitializeInterfaceDescriptor( |
- CodeStubInterfaceDescriptor* descriptor) { |
- // eax : number of arguments |
- // ebx : feedback vector |
- // edx : (only if ebx is not the megamorphic symbol) slot in feedback |
- // vector (Smi) |
- // edi : constructor function |
- // 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[] = {esi, eax, edi, ebx}; |
- descriptor->Initialize(MajorKey(), arraysize(registers), registers); |
-} |
- |
- |
-void RegExpConstructResultStub::InitializeInterfaceDescriptor( |
- CodeStubInterfaceDescriptor* descriptor) { |
- Register registers[] = { esi, ecx, ebx, eax }; |
- descriptor->Initialize( |
- MajorKey(), arraysize(registers), registers, |
- Runtime::FunctionForId(Runtime::kRegExpConstructResult)->entry); |
-} |
- |
- |
-void TransitionElementsKindStub::InitializeInterfaceDescriptor( |
- CodeStubInterfaceDescriptor* descriptor) { |
- Register registers[] = { esi, eax, ebx }; |
- descriptor->Initialize( |
- MajorKey(), arraysize(registers), registers, |
- Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry); |
-} |
- |
- |
static void InitializeArrayConstructorDescriptor( |
Isolate* isolate, CodeStub::Major major, |
CodeStubInterfaceDescriptor* descriptor, |
@@ -135,20 +31,15 @@ static void InitializeArrayConstructorDescriptor( |
Runtime::kArrayConstructor)->entry; |
if (constant_stack_parameter_count == 0) { |
- Register registers[] = { esi, edi, ebx }; |
- 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[] = { esi, edi, ebx, eax }; |
- Representation representations[] = { |
- Representation::Tagged(), |
- Representation::Tagged(), |
- Representation::Tagged(), |
- Representation::Integer32() }; |
- descriptor->Initialize(major, arraysize(registers), registers, eax, |
- deopt_handler, representations, |
+ CallInterfaceDescriptor* call_descriptor = |
+ isolate->call_descriptor(CallDescriptorKey::ArrayConstructorCall); |
+ descriptor->Initialize(major, call_descriptor, eax, deopt_handler, |
constant_stack_parameter_count, |
JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS); |
} |
@@ -156,7 +47,8 @@ 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 |
// eax -- number of arguments |
@@ -165,19 +57,15 @@ static void InitializeInternalArrayConstructorDescriptor( |
Runtime::kInternalArrayConstructor)->entry; |
if (constant_stack_parameter_count == 0) { |
- Register registers[] = { esi, edi }; |
- 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[] = { esi, edi, eax }; |
- Representation representations[] = { |
- Representation::Tagged(), |
- Representation::Tagged(), |
- Representation::Integer32() }; |
- descriptor->Initialize(major, arraysize(registers), registers, eax, |
- deopt_handler, representations, |
+ CallInterfaceDescriptor* call_descriptor = isolate->call_descriptor( |
+ CallDescriptorKey::InternalArrayConstructorCall); |
+ descriptor->Initialize(major, call_descriptor, eax, deopt_handler, |
constant_stack_parameter_count, |
JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS); |
} |
@@ -204,64 +92,22 @@ void ArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( |
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 CompareNilICStub::InitializeInterfaceDescriptor( |
- CodeStubInterfaceDescriptor* descriptor) { |
- Register registers[] = { esi, eax }; |
- descriptor->Initialize(MajorKey(), arraysize(registers), registers, |
- FUNCTION_ADDR(CompareNilIC_Miss)); |
- descriptor->SetMissHandler( |
- ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate())); |
-} |
- |
-void ToBooleanStub::InitializeInterfaceDescriptor( |
- CodeStubInterfaceDescriptor* descriptor) { |
- Register registers[] = { esi, eax }; |
- descriptor->Initialize(MajorKey(), arraysize(registers), registers, |
- FUNCTION_ADDR(ToBooleanIC_Miss)); |
- descriptor->SetMissHandler( |
- ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate())); |
-} |
- |
- |
-void BinaryOpICStub::InitializeInterfaceDescriptor( |
- CodeStubInterfaceDescriptor* descriptor) { |
- Register registers[] = { esi, edx, eax }; |
- 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[] = { esi, ecx, edx, eax }; |
- descriptor->Initialize(MajorKey(), arraysize(registers), registers, |
- FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite)); |
-} |
- |
- |
-void StringAddStub::InitializeInterfaceDescriptor( |
- CodeStubInterfaceDescriptor* descriptor) { |
- Register registers[] = { esi, edx, eax }; |
- descriptor->Initialize(MajorKey(), arraysize(registers), registers, |
- Runtime::FunctionForId(Runtime::kStringAdd)->entry); |
+ InitializeInternalArrayConstructorDescriptor(isolate(), MajorKey(), |
+ descriptor, -1); |
} |
@@ -2888,12 +2734,6 @@ void InstanceofStub::Generate(MacroAssembler* masm) { |
} |
-Register InstanceofStub::left() { return eax; } |
- |
- |
-Register InstanceofStub::right() { return edx; } |
- |
- |
// ------------------------------------------------------------------------- |
// StringCharCodeAtGenerator |