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

Unified Diff: src/x64/code-stubs-x64.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/isolate.cc ('k') | src/x64/interface-descriptors-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/code-stubs-x64.cc
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc
index 3a50e635c858e3ac44a370058c0e0c3ac4a8efe8..3f364e755926da7f2e2b9414eee923cf1666c753 100644
--- a/src/x64/code-stubs-x64.cc
+++ b/src/x64/code-stubs-x64.cc
@@ -19,134 +19,23 @@ namespace v8 {
namespace internal {
-void FastNewClosureStub::InitializeInterfaceDescriptor(
- CodeStubInterfaceDescriptor* descriptor) {
- Register registers[] = { rsi, rbx };
- descriptor->Initialize(
- MajorKey(), arraysize(registers), registers,
- Runtime::FunctionForId(Runtime::kNewClosureFromStubFailure)->entry);
-}
-
-
-void FastNewContextStub::InitializeInterfaceDescriptor(
- CodeStubInterfaceDescriptor* descriptor) {
- Register registers[] = { rsi, rdi };
- descriptor->Initialize(MajorKey(), arraysize(registers), registers);
-}
-
-
-void ToNumberStub::InitializeInterfaceDescriptor(
- CodeStubInterfaceDescriptor* descriptor) {
- Register registers[] = { rsi, rax };
- descriptor->Initialize(MajorKey(), arraysize(registers), registers);
-}
-
-
-void NumberToStringStub::InitializeInterfaceDescriptor(
- CodeStubInterfaceDescriptor* descriptor) {
- Register registers[] = { rsi, rax };
- descriptor->Initialize(
- MajorKey(), arraysize(registers), registers,
- Runtime::FunctionForId(Runtime::kNumberToStringRT)->entry);
-}
-
-
-void FastCloneShallowArrayStub::InitializeInterfaceDescriptor(
- CodeStubInterfaceDescriptor* descriptor) {
- Register registers[] = { rsi, rax, rbx, rcx };
- 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[] = { rsi, rax, rbx, rcx, rdx };
- descriptor->Initialize(
- MajorKey(), arraysize(registers), registers,
- Runtime::FunctionForId(Runtime::kCreateObjectLiteral)->entry);
-}
-
-
-void CreateAllocationSiteStub::InitializeInterfaceDescriptor(
- CodeStubInterfaceDescriptor* descriptor) {
- Register registers[] = { rsi, rbx, rdx };
- descriptor->Initialize(MajorKey(), arraysize(registers), registers);
-}
-
-
-void CallFunctionStub::InitializeInterfaceDescriptor(
- CodeStubInterfaceDescriptor* descriptor) {
- Register registers[] = {rsi, rdi};
- descriptor->Initialize(MajorKey(), arraysize(registers), registers);
-}
-
-
-void CallConstructStub::InitializeInterfaceDescriptor(
- CodeStubInterfaceDescriptor* descriptor) {
- // rax : number of arguments
- // rbx : feedback vector
- // rdx : (only if rbx is not the megamorphic symbol) slot in feedback
- // vector (Smi)
- // rdi : 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[] = {rsi, rax, rdi, rbx};
- descriptor->Initialize(MajorKey(), arraysize(registers), registers);
-}
-
-
-void RegExpConstructResultStub::InitializeInterfaceDescriptor(
- CodeStubInterfaceDescriptor* descriptor) {
- Register registers[] = { rsi, rcx, rbx, rax };
- descriptor->Initialize(
- MajorKey(), arraysize(registers), registers,
- Runtime::FunctionForId(Runtime::kRegExpConstructResult)->entry);
-}
-
-
-void TransitionElementsKindStub::InitializeInterfaceDescriptor(
- CodeStubInterfaceDescriptor* descriptor) {
- Register registers[] = { rsi, rax, rbx };
- descriptor->Initialize(
- MajorKey(), arraysize(registers), registers,
- Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry);
-}
-
-
static void InitializeArrayConstructorDescriptor(
- CodeStub::Major major, CodeStubInterfaceDescriptor* descriptor,
+ Isolate* isolate, CodeStub::Major major,
+ CodeStubInterfaceDescriptor* descriptor,
int constant_stack_parameter_count) {
- // register state
- // rax -- number of arguments
- // rdi -- function
- // rbx -- allocation site with elements kind
Address deopt_handler = Runtime::FunctionForId(
Runtime::kArrayConstructor)->entry;
if (constant_stack_parameter_count == 0) {
- Register registers[] = { rsi, rdi, rbx };
- 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[] = { rsi, rdi, rbx, rax };
- Representation representations[] = {
- Representation::Tagged(),
- Representation::Tagged(),
- Representation::Tagged(),
- Representation::Integer32() };
- descriptor->Initialize(major, arraysize(registers), registers, rax,
- deopt_handler, representations,
+ CallInterfaceDescriptor* call_descriptor =
+ isolate->call_descriptor(CallDescriptorKey::ArrayConstructorCall);
+ descriptor->Initialize(major, call_descriptor, rax, deopt_handler,
constant_stack_parameter_count,
JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS);
}
@@ -154,7 +43,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
// rsi -- context
@@ -164,19 +54,15 @@ static void InitializeInternalArrayConstructorDescriptor(
Runtime::kInternalArrayConstructor)->entry;
if (constant_stack_parameter_count == 0) {
- Register registers[] = { rsi, rdi };
- 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[] = { rsi, rdi, rax };
- Representation representations[] = {
- Representation::Tagged(),
- Representation::Tagged(),
- Representation::Integer32() };
- descriptor->Initialize(major, arraysize(registers), registers, rax,
- deopt_handler, representations,
+ CallInterfaceDescriptor* call_descriptor = isolate->call_descriptor(
+ CallDescriptorKey::InternalArrayConstructorCall);
+ descriptor->Initialize(major, call_descriptor, rax, deopt_handler,
constant_stack_parameter_count,
JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS);
}
@@ -185,83 +71,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);
+ 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 CompareNilICStub::InitializeInterfaceDescriptor(
- CodeStubInterfaceDescriptor* descriptor) {
- Register registers[] = { rsi, rax };
- 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[] = { rsi, rax };
- 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[] = { rsi, rdx, rax };
- 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[] = { rsi, rcx, rdx, rax };
- descriptor->Initialize(MajorKey(), arraysize(registers), registers,
- FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite));
-}
-
-
-void StringAddStub::InitializeInterfaceDescriptor(
- CodeStubInterfaceDescriptor* descriptor) {
- Register registers[] = { rsi, rdx, rax };
- descriptor->Initialize(MajorKey(), arraysize(registers), registers,
- Runtime::FunctionForId(Runtime::kStringAdd)->entry);
+ InitializeInternalArrayConstructorDescriptor(isolate(), MajorKey(),
+ descriptor, -1);
}
@@ -2858,13 +2701,6 @@ void InstanceofStub::Generate(MacroAssembler* masm) {
}
-// Passing arguments in registers is not supported.
-Register InstanceofStub::left() { return rax; }
-
-
-Register InstanceofStub::right() { return rdx; }
-
-
// -------------------------------------------------------------------------
// StringCharCodeAtGenerator
« no previous file with comments | « src/isolate.cc ('k') | src/x64/interface-descriptors-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698