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

Unified Diff: src/arm/interface-descriptors-arm.cc

Issue 527093002: Make concrete classes for individual call descriptors. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE. Created 6 years, 3 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
Index: src/arm/interface-descriptors-arm.cc
diff --git a/src/arm/interface-descriptors-arm.cc b/src/arm/interface-descriptors-arm.cc
index 969d4ae95786f64666fea03ee49d871701663e25..70edccc295a0d96857dad5363ed0ae1e5f27794f 100644
--- a/src/arm/interface-descriptors-arm.cc
+++ b/src/arm/interface-descriptors-arm.cc
@@ -14,243 +14,285 @@ namespace internal {
const Register CallInterfaceDescriptor::ContextRegister() { return cp; }
-void CallDescriptors::InitializeForIsolate(Isolate* isolate) {
- static PlatformInterfaceDescriptor default_descriptor =
- PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS);
+const Register LoadDescriptor::ReceiverRegister() { return r1; }
+const Register LoadDescriptor::NameRegister() { return r2; }
+
+const Register VectorLoadICDescriptor::ReceiverRegister() {
+ return LoadDescriptor::ReceiverRegister();
Yang 2014/09/03 09:24:34 Looks like you could just subclass VectorLoadICDes
+}
+
+
+const Register VectorLoadICDescriptor::NameRegister() {
+ return LoadDescriptor::NameRegister();
+}
+
+
+const Register VectorLoadICDescriptor::SlotRegister() { return r0; }
+const Register VectorLoadICDescriptor::VectorRegister() { return r3; }
+
+
+const Register StoreDescriptor::ReceiverRegister() { return r1; }
+const Register StoreDescriptor::NameRegister() { return r2; }
+const Register StoreDescriptor::ValueRegister() { return r0; }
+
+
+const Register ElementTransitionAndStoreDescriptor::ReceiverRegister() {
+ return StoreDescriptor::ReceiverRegister();
Yang 2014/09/03 09:24:34 Same here with ElementTransitionAndStoreDescriptor
+}
+
+
+const Register ElementTransitionAndStoreDescriptor::NameRegister() {
+ return StoreDescriptor::NameRegister();
+}
+
+
+const Register ElementTransitionAndStoreDescriptor::ValueRegister() {
+ return StoreDescriptor::ValueRegister();
+}
+
+
+const Register ElementTransitionAndStoreDescriptor::MapRegister() { return r3; }
+
+
+const Register InstanceofDescriptor::left() { return r0; }
+const Register InstanceofDescriptor::right() { return r1; }
+
+
+void FastNewClosureDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {cp, r2};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void FastNewContextDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {cp, r1};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void ToNumberDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {cp, r0};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void NumberToStringDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {cp, r0};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void FastCloneShallowArrayDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {cp, r3, r2, r1};
+ Representation representations[] = {
+ Representation::Tagged(), Representation::Tagged(), Representation::Smi(),
+ Representation::Tagged()};
+ InitializeData(isolate, key(), arraysize(registers), registers,
+ representations);
+}
+
+
+void FastCloneShallowObjectDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {cp, r3, r2, r1, r0};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void CreateAllocationSiteDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {cp, r2, r3};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void CallFunctionDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {cp, r1};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void CallConstructDescriptor::Initialize(Isolate* isolate) {
+ // 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};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void RegExpConstructResultDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {cp, r2, r1, r0};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void TransitionElementsKindDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {cp, r0, r1};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void ArrayConstructorConstantArgCountDescriptor::Initialize(Isolate* isolate) {
+ // register state
+ // cp -- context
+ // r0 -- number of arguments
+ // r1 -- function
+ // r2 -- allocation site with elements kind
+ Register registers[] = {cp, r1, r2};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void ArrayConstructorDescriptor::Initialize(Isolate* isolate) {
+ // 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()};
+ InitializeData(isolate, key(), arraysize(registers), registers,
+ representations);
+}
+
+
+void InternalArrayConstructorConstantArgCountDescriptor::Initialize(
+ Isolate* isolate) {
+ // register state
+ // cp -- context
+ // r0 -- number of arguments
+ // r1 -- constructor function
+ Register registers[] = {cp, r1};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void InternalArrayConstructorDescriptor::Initialize(Isolate* isolate) {
+ // stack param count needs (constructor pointer, and single argument)
+ Register registers[] = {cp, r1, r0};
+ Representation representations[] = {Representation::Tagged(),
+ Representation::Tagged(),
+ Representation::Integer32()};
+ InitializeData(isolate, key(), arraysize(registers), registers,
+ representations);
+}
+
+
+void CompareNilDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {cp, r0};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void ToBooleanDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {cp, r0};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void BinaryOpDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {cp, r1, r0};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void BinaryOpWithAllocationSiteDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {cp, r2, r1, r0};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void StringAddDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {cp, r1, r0};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void KeyedDescriptor::Initialize(Isolate* isolate) {
+ static PlatformInterfaceDescriptor noInlineDescriptor =
+ PlatformInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS);
+
+ Register registers[] = {
+ cp, // context
+ r2, // key
+ };
+ Representation representations[] = {
+ Representation::Tagged(), // context
+ Representation::Tagged(), // key
+ };
+ InitializeData(isolate, key(), arraysize(registers), registers,
+ representations, &noInlineDescriptor);
+}
+
+
+void NamedDescriptor::Initialize(Isolate* isolate) {
static PlatformInterfaceDescriptor noInlineDescriptor =
PlatformInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS);
- InitializeForIsolateAllPlatforms(isolate);
-
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::FastNewClosureCall);
- Register registers[] = {cp, r2};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::FastNewContextCall);
- Register registers[] = {cp, r1};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::ToNumberCall);
- Register registers[] = {cp, r0};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::NumberToStringCall);
- Register registers[] = {cp, r0};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::FastCloneShallowArrayCall);
- Register registers[] = {cp, r3, r2, r1};
- 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[] = {cp, r3, r2, r1, r0};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::CreateAllocationSiteCall);
- Register registers[] = {cp, r2, r3};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::CallFunctionCall);
- Register registers[] = {cp, r1};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::CallConstructCall);
- // 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(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::RegExpConstructResultCall);
- Register registers[] = {cp, r2, r1, r0};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::TransitionElementsKindCall);
- Register registers[] = {cp, r0, r1};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor = isolate->call_descriptor(
- CallDescriptorKey::ArrayConstructorConstantArgCountCall);
- // register state
- // cp -- context
- // r0 -- number of arguments
- // r1 -- function
- // r2 -- allocation site with elements kind
- Register registers[] = {cp, r1, r2};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::ArrayConstructorCall);
- // 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(arraysize(registers), registers, representations);
- }
- {
- CallInterfaceDescriptor* descriptor = isolate->call_descriptor(
- CallDescriptorKey::InternalArrayConstructorConstantArgCountCall);
- // register state
- // cp -- context
- // r0 -- number of arguments
- // r1 -- constructor function
- Register registers[] = {cp, r1};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor = isolate->call_descriptor(
- CallDescriptorKey::InternalArrayConstructorCall);
- // stack param count needs (constructor pointer, and single argument)
- Register registers[] = {cp, r1, r0};
- Representation representations[] = {Representation::Tagged(),
- Representation::Tagged(),
- Representation::Integer32()};
- descriptor->Initialize(arraysize(registers), registers, representations);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::CompareNilCall);
- Register registers[] = {cp, r0};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::ToBooleanCall);
- Register registers[] = {cp, r0};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::BinaryOpCall);
- Register registers[] = {cp, r1, r0};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor = isolate->call_descriptor(
- CallDescriptorKey::BinaryOpWithAllocationSiteCall);
- Register registers[] = {cp, r2, r1, r0};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::StringAddCall);
- Register registers[] = {cp, r1, r0};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
-
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::ArgumentAdaptorCall);
- Register registers[] = {
- cp, // context
- r1, // JSFunction
- r0, // actual number of arguments
- r2, // 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,
- &default_descriptor);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::KeyedCall);
- Register registers[] = {
- cp, // context
- r2, // key
- };
- Representation representations[] = {
- Representation::Tagged(), // context
- Representation::Tagged(), // key
- };
- descriptor->Initialize(arraysize(registers), registers, representations,
- &noInlineDescriptor);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::NamedCall);
- Register registers[] = {
- cp, // context
- r2, // name
- };
- Representation representations[] = {
- Representation::Tagged(), // context
- Representation::Tagged(), // name
- };
- descriptor->Initialize(arraysize(registers), registers, representations,
- &noInlineDescriptor);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::CallHandler);
- Register registers[] = {
- cp, // context
- r0, // receiver
- };
- Representation representations[] = {
- Representation::Tagged(), // context
- Representation::Tagged(), // receiver
- };
- descriptor->Initialize(arraysize(registers), registers, representations,
- &default_descriptor);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::ApiFunctionCall);
- Register registers[] = {
- cp, // context
- r0, // callee
- r4, // call_data
- r2, // holder
- r1, // 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,
- &default_descriptor);
- }
+ Register registers[] = {
+ cp, // context
+ r2, // name
+ };
+ Representation representations[] = {
+ Representation::Tagged(), // context
+ Representation::Tagged(), // name
+ };
+ InitializeData(isolate, key(), arraysize(registers), registers,
+ representations, &noInlineDescriptor);
+}
+
+
+void CallHandlerDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {
+ cp, // context
+ r0, // receiver
+ };
+ Representation representations[] = {
+ Representation::Tagged(), // context
+ Representation::Tagged(), // receiver
+ };
+ InitializeData(isolate, key(), arraysize(registers), registers,
+ representations);
+}
+
+
+void ArgumentAdaptorDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {
+ cp, // context
+ r1, // JSFunction
+ r0, // actual number of arguments
+ r2, // 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[] = {
+ cp, // context
+ r0, // callee
+ r4, // call_data
+ r2, // holder
+ r1, // 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
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/arm/lithium-arm.h » ('j') | src/code-stubs.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698