Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(466)

Unified Diff: src/ia32/code-stubs-ia32.cc

Issue 523583002: Multiple stubs can point to the same calling convention. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Ports. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/js-generic-lowering.cc ('k') | src/ia32/interface-descriptors-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « src/compiler/js-generic-lowering.cc ('k') | src/ia32/interface-descriptors-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698