Index: src/x64/interface-descriptors-x64.cc |
diff --git a/src/x64/interface-descriptors-x64.cc b/src/x64/interface-descriptors-x64.cc |
index e8908843b74cd03ba8987e3a270a8cc1e052d670..2d18ade7e4a67feccd5df8c61a0fb3ea22904e8e 100644 |
--- a/src/x64/interface-descriptors-x64.cc |
+++ b/src/x64/interface-descriptors-x64.cc |
@@ -14,232 +14,281 @@ namespace internal { |
const Register CallInterfaceDescriptor::ContextRegister() { return rsi; } |
-void CallDescriptors::InitializeForIsolate(Isolate* isolate) { |
- InitializeForIsolateAllPlatforms(isolate); |
- |
- { |
- CallInterfaceDescriptor* descriptor = |
- isolate->call_descriptor(CallDescriptorKey::FastNewClosureCall); |
- Register registers[] = {rsi, rbx}; |
- descriptor->Initialize(arraysize(registers), registers, NULL); |
- } |
- { |
- CallInterfaceDescriptor* descriptor = |
- isolate->call_descriptor(CallDescriptorKey::FastNewContextCall); |
- Register registers[] = {rsi, rdi}; |
- descriptor->Initialize(arraysize(registers), registers, NULL); |
- } |
- { |
- CallInterfaceDescriptor* descriptor = |
- isolate->call_descriptor(CallDescriptorKey::ToNumberCall); |
- // ToNumberStub invokes a function, and therefore needs a context. |
- Register registers[] = {rsi, rax}; |
- descriptor->Initialize(arraysize(registers), registers, NULL); |
- } |
- { |
- CallInterfaceDescriptor* descriptor = |
- isolate->call_descriptor(CallDescriptorKey::NumberToStringCall); |
- Register registers[] = {rsi, rax}; |
- descriptor->Initialize(arraysize(registers), registers, NULL); |
- } |
- { |
- CallInterfaceDescriptor* descriptor = |
- isolate->call_descriptor(CallDescriptorKey::FastCloneShallowArrayCall); |
- Register registers[] = {rsi, rax, rbx, rcx}; |
- Representation representations[] = { |
- Representation::Tagged(), Representation::Tagged(), |
- Representation::Smi(), Representation::Tagged()}; |
- descriptor->Initialize(arraysize(registers), registers, representations); |
- } |
- { |
- CallInterfaceDescriptor* descriptor = |
- isolate->call_descriptor(CallDescriptorKey::FastCloneShallowObjectCall); |
- Register registers[] = {rsi, rax, rbx, rcx, rdx}; |
- descriptor->Initialize(arraysize(registers), registers, NULL); |
- } |
- { |
- CallInterfaceDescriptor* descriptor = |
- isolate->call_descriptor(CallDescriptorKey::CreateAllocationSiteCall); |
- Register registers[] = {rsi, rbx, rdx}; |
- descriptor->Initialize(arraysize(registers), registers, NULL); |
- } |
- { |
- CallInterfaceDescriptor* descriptor = |
- isolate->call_descriptor(CallDescriptorKey::CallFunctionCall); |
- Register registers[] = {rsi, rdi}; |
- descriptor->Initialize(arraysize(registers), registers, NULL); |
- } |
- { |
- CallInterfaceDescriptor* descriptor = |
- isolate->call_descriptor(CallDescriptorKey::CallConstructCall); |
- // 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(arraysize(registers), registers, NULL); |
- } |
- { |
- CallInterfaceDescriptor* descriptor = |
- isolate->call_descriptor(CallDescriptorKey::RegExpConstructResultCall); |
- Register registers[] = {rsi, rcx, rbx, rax}; |
- descriptor->Initialize(arraysize(registers), registers, NULL); |
- } |
- { |
- CallInterfaceDescriptor* descriptor = |
- isolate->call_descriptor(CallDescriptorKey::TransitionElementsKindCall); |
- Register registers[] = {rsi, rax, rbx}; |
- descriptor->Initialize(arraysize(registers), registers, NULL); |
- } |
- { |
- CallInterfaceDescriptor* descriptor = isolate->call_descriptor( |
- CallDescriptorKey::ArrayConstructorConstantArgCountCall); |
- // register state |
- // rax -- number of arguments |
- // rdi -- function |
- // rbx -- allocation site with elements kind |
- Register registers[] = {rsi, rdi, rbx}; |
- descriptor->Initialize(arraysize(registers), registers, NULL); |
- } |
- { |
- CallInterfaceDescriptor* descriptor = |
- isolate->call_descriptor(CallDescriptorKey::ArrayConstructorCall); |
- // 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(arraysize(registers), registers, representations); |
- } |
- { |
- CallInterfaceDescriptor* descriptor = isolate->call_descriptor( |
- CallDescriptorKey::InternalArrayConstructorConstantArgCountCall); |
- // register state |
- // rsi -- context |
- // rax -- number of arguments |
- // rdi -- constructor function |
- Register registers[] = {rsi, rdi}; |
- descriptor->Initialize(arraysize(registers), registers, NULL); |
- } |
- { |
- CallInterfaceDescriptor* descriptor = isolate->call_descriptor( |
- CallDescriptorKey::InternalArrayConstructorCall); |
- // stack param count needs (constructor pointer, and single argument) |
- Register registers[] = {rsi, rdi, rax}; |
- Representation representations[] = {Representation::Tagged(), |
- Representation::Tagged(), |
- Representation::Integer32()}; |
- descriptor->Initialize(arraysize(registers), registers, representations); |
- } |
- { |
- CallInterfaceDescriptor* descriptor = |
- isolate->call_descriptor(CallDescriptorKey::CompareNilCall); |
- Register registers[] = {rsi, rax}; |
- descriptor->Initialize(arraysize(registers), registers, NULL); |
- } |
- { |
- CallInterfaceDescriptor* descriptor = |
- isolate->call_descriptor(CallDescriptorKey::ToBooleanCall); |
- Register registers[] = {rsi, rax}; |
- descriptor->Initialize(arraysize(registers), registers, NULL); |
- } |
- { |
- CallInterfaceDescriptor* descriptor = |
- isolate->call_descriptor(CallDescriptorKey::BinaryOpCall); |
- Register registers[] = {rsi, rdx, rax}; |
- descriptor->Initialize(arraysize(registers), registers, NULL); |
- } |
- { |
- CallInterfaceDescriptor* descriptor = isolate->call_descriptor( |
- CallDescriptorKey::BinaryOpWithAllocationSiteCall); |
- Register registers[] = {rsi, rcx, rdx, rax}; |
- descriptor->Initialize(arraysize(registers), registers, NULL); |
- } |
- { |
- CallInterfaceDescriptor* descriptor = |
- isolate->call_descriptor(CallDescriptorKey::StringAddCall); |
- Register registers[] = {rsi, rdx, rax}; |
- descriptor->Initialize(arraysize(registers), registers, NULL); |
- } |
- |
- { |
- CallInterfaceDescriptor* descriptor = |
- isolate->call_descriptor(CallDescriptorKey::ArgumentAdaptorCall); |
- Register registers[] = { |
- rsi, // context |
- rdi, // JSFunction |
- rax, // actual number of arguments |
- rbx, // expected number of arguments |
- }; |
- Representation representations[] = { |
- Representation::Tagged(), // context |
- Representation::Tagged(), // JSFunction |
- Representation::Integer32(), // actual number of arguments |
- Representation::Integer32(), // expected number of arguments |
- }; |
- descriptor->Initialize(arraysize(registers), registers, representations); |
- } |
- { |
- CallInterfaceDescriptor* descriptor = |
- isolate->call_descriptor(CallDescriptorKey::KeyedCall); |
- Register registers[] = { |
- rsi, // context |
- rcx, // key |
- }; |
- Representation representations[] = { |
- Representation::Tagged(), // context |
- Representation::Tagged(), // key |
- }; |
- descriptor->Initialize(arraysize(registers), registers, representations); |
- } |
- { |
- CallInterfaceDescriptor* descriptor = |
- isolate->call_descriptor(CallDescriptorKey::NamedCall); |
- Register registers[] = { |
- rsi, // context |
- rcx, // name |
- }; |
- Representation representations[] = { |
- Representation::Tagged(), // context |
- Representation::Tagged(), // name |
- }; |
- descriptor->Initialize(arraysize(registers), registers, representations); |
- } |
- { |
- CallInterfaceDescriptor* descriptor = |
- isolate->call_descriptor(CallDescriptorKey::CallHandler); |
- Register registers[] = { |
- rsi, // context |
- rdx, // receiver |
- }; |
- Representation representations[] = { |
- Representation::Tagged(), // context |
- Representation::Tagged(), // receiver |
- }; |
- descriptor->Initialize(arraysize(registers), registers, representations); |
- } |
- { |
- CallInterfaceDescriptor* descriptor = |
- isolate->call_descriptor(CallDescriptorKey::ApiFunctionCall); |
- Register registers[] = { |
- rsi, // context |
- rax, // callee |
- rbx, // call_data |
- rcx, // holder |
- rdx, // api_function_address |
- }; |
- Representation representations[] = { |
- Representation::Tagged(), // context |
- Representation::Tagged(), // callee |
- Representation::Tagged(), // call_data |
- Representation::Tagged(), // holder |
- Representation::External(), // api_function_address |
- }; |
- descriptor->Initialize(arraysize(registers), registers, representations); |
- } |
+const Register LoadDescriptor::ReceiverRegister() { return rdx; } |
+const Register LoadDescriptor::NameRegister() { return rcx; } |
+ |
+ |
+const Register VectorLoadICDescriptor::ReceiverRegister() { |
+ return LoadDescriptor::ReceiverRegister(); |
+} |
+ |
+ |
+const Register VectorLoadICDescriptor::NameRegister() { |
+ return LoadDescriptor::NameRegister(); |
+} |
+ |
+ |
+const Register VectorLoadICDescriptor::SlotRegister() { return rax; } |
+const Register VectorLoadICDescriptor::VectorRegister() { return rbx; } |
+ |
+ |
+const Register StoreDescriptor::ReceiverRegister() { return rdx; } |
+const Register StoreDescriptor::NameRegister() { return rcx; } |
+const Register StoreDescriptor::ValueRegister() { return rax; } |
+ |
+ |
+const Register ElementTransitionAndStoreDescriptor::ReceiverRegister() { |
+ return StoreDescriptor::ReceiverRegister(); |
+} |
+ |
+ |
+const Register ElementTransitionAndStoreDescriptor::NameRegister() { |
+ return StoreDescriptor::NameRegister(); |
+} |
+ |
+ |
+const Register ElementTransitionAndStoreDescriptor::ValueRegister() { |
+ return StoreDescriptor::ValueRegister(); |
+} |
+ |
+ |
+const Register ElementTransitionAndStoreDescriptor::MapRegister() { |
+ return rbx; |
+} |
+ |
+ |
+const Register InstanceofDescriptor::left() { return rax; } |
+const Register InstanceofDescriptor::right() { return rdx; } |
+ |
+ |
+void FastNewClosureDescriptor::Initialize(Isolate* isolate) { |
+ Register registers[] = {rsi, rbx}; |
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL); |
+} |
+ |
+ |
+void FastNewContextDescriptor::Initialize(Isolate* isolate) { |
+ Register registers[] = {rsi, rdi}; |
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL); |
+} |
+ |
+ |
+void ToNumberDescriptor::Initialize(Isolate* isolate) { |
+ // ToNumberStub invokes a function, and therefore needs a context. |
+ Register registers[] = {rsi, rax}; |
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL); |
+} |
+ |
+ |
+void NumberToStringDescriptor::Initialize(Isolate* isolate) { |
+ Register registers[] = {rsi, rax}; |
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL); |
+} |
+ |
+ |
+void FastCloneShallowArrayDescriptor::Initialize(Isolate* isolate) { |
+ Register registers[] = {rsi, rax, rbx, rcx}; |
+ Representation representations[] = { |
+ Representation::Tagged(), Representation::Tagged(), Representation::Smi(), |
+ Representation::Tagged()}; |
+ InitializeData(isolate, key(), arraysize(registers), registers, |
+ representations); |
+} |
+ |
+ |
+void FastCloneShallowObjectDescriptor::Initialize(Isolate* isolate) { |
+ Register registers[] = {rsi, rax, rbx, rcx, rdx}; |
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL); |
+} |
+ |
+ |
+void CreateAllocationSiteDescriptor::Initialize(Isolate* isolate) { |
+ Register registers[] = {rsi, rbx, rdx}; |
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL); |
+} |
+ |
+ |
+void CallFunctionDescriptor::Initialize(Isolate* isolate) { |
+ Register registers[] = {rsi, rdi}; |
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL); |
+} |
+ |
+ |
+void CallConstructDescriptor::Initialize(Isolate* isolate) { |
+ // 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}; |
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL); |
+} |
+ |
+ |
+void RegExpConstructResultDescriptor::Initialize(Isolate* isolate) { |
+ Register registers[] = {rsi, rcx, rbx, rax}; |
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL); |
+} |
+ |
+ |
+void TransitionElementsKindDescriptor::Initialize(Isolate* isolate) { |
+ Register registers[] = {rsi, rax, rbx}; |
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL); |
+} |
+ |
+ |
+void ArrayConstructorConstantArgCountDescriptor::Initialize(Isolate* isolate) { |
+ // register state |
+ // rax -- number of arguments |
+ // rdi -- function |
+ // rbx -- allocation site with elements kind |
+ Register registers[] = {rsi, rdi, rbx}; |
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL); |
+} |
+ |
+ |
+void ArrayConstructorDescriptor::Initialize(Isolate* isolate) { |
+ // 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()}; |
+ InitializeData(isolate, key(), arraysize(registers), registers, |
+ representations); |
+} |
+ |
+ |
+void InternalArrayConstructorConstantArgCountDescriptor::Initialize( |
+ Isolate* isolate) { |
+ // register state |
+ // rsi -- context |
+ // rax -- number of arguments |
+ // rdi -- constructor function |
+ Register registers[] = {rsi, rdi}; |
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL); |
+} |
+ |
+ |
+void InternalArrayConstructorDescriptor::Initialize(Isolate* isolate) { |
+ // stack param count needs (constructor pointer, and single argument) |
+ Register registers[] = {rsi, rdi, rax}; |
+ Representation representations[] = {Representation::Tagged(), |
+ Representation::Tagged(), |
+ Representation::Integer32()}; |
+ InitializeData(isolate, key(), arraysize(registers), registers, |
+ representations); |
+} |
+ |
+ |
+void CompareNilDescriptor::Initialize(Isolate* isolate) { |
+ Register registers[] = {rsi, rax}; |
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL); |
+} |
+ |
+ |
+void ToBooleanDescriptor::Initialize(Isolate* isolate) { |
+ Register registers[] = {rsi, rax}; |
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL); |
+} |
+ |
+ |
+void BinaryOpDescriptor::Initialize(Isolate* isolate) { |
+ Register registers[] = {rsi, rdx, rax}; |
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL); |
+} |
+ |
+ |
+void BinaryOpWithAllocationSiteDescriptor::Initialize(Isolate* isolate) { |
+ Register registers[] = {rsi, rcx, rdx, rax}; |
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL); |
+} |
+ |
+ |
+void StringAddDescriptor::Initialize(Isolate* isolate) { |
+ Register registers[] = {rsi, rdx, rax}; |
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL); |
+} |
+ |
+ |
+void KeyedDescriptor::Initialize(Isolate* isolate) { |
+ Register registers[] = { |
+ rsi, // context |
+ rcx, // key |
+ }; |
+ Representation representations[] = { |
+ Representation::Tagged(), // context |
+ Representation::Tagged(), // key |
+ }; |
+ InitializeData(isolate, key(), arraysize(registers), registers, |
+ representations); |
+} |
+ |
+ |
+void NamedDescriptor::Initialize(Isolate* isolate) { |
+ Register registers[] = { |
+ rsi, // context |
+ rcx, // name |
+ }; |
+ Representation representations[] = { |
+ Representation::Tagged(), // context |
+ Representation::Tagged(), // name |
+ }; |
+ InitializeData(isolate, key(), arraysize(registers), registers, |
+ representations); |
+} |
+ |
+ |
+void CallHandlerDescriptor::Initialize(Isolate* isolate) { |
+ Register registers[] = { |
+ rsi, // context |
+ rdx, // receiver |
+ }; |
+ Representation representations[] = { |
+ Representation::Tagged(), // context |
+ Representation::Tagged(), // receiver |
+ }; |
+ InitializeData(isolate, key(), arraysize(registers), registers, |
+ representations); |
+} |
+ |
+ |
+void ArgumentAdaptorDescriptor::Initialize(Isolate* isolate) { |
+ Register registers[] = { |
+ rsi, // context |
+ rdi, // JSFunction |
+ rax, // actual number of arguments |
+ rbx, // expected number of arguments |
+ }; |
+ Representation representations[] = { |
+ Representation::Tagged(), // context |
+ Representation::Tagged(), // JSFunction |
+ Representation::Integer32(), // actual number of arguments |
+ Representation::Integer32(), // expected number of arguments |
+ }; |
+ InitializeData(isolate, key(), arraysize(registers), registers, |
+ representations); |
+} |
+ |
+ |
+void ApiFunctionDescriptor::Initialize(Isolate* isolate) { |
+ Register registers[] = { |
+ rsi, // context |
+ rax, // callee |
+ rbx, // call_data |
+ rcx, // holder |
+ rdx, // api_function_address |
+ }; |
+ Representation representations[] = { |
+ Representation::Tagged(), // context |
+ Representation::Tagged(), // callee |
+ Representation::Tagged(), // call_data |
+ Representation::Tagged(), // holder |
+ Representation::External(), // api_function_address |
+ }; |
+ InitializeData(isolate, key(), arraysize(registers), registers, |
+ representations); |
} |
} |
} // namespace v8::internal |