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

Unified Diff: src/arm64/interface-descriptors-arm64.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/arm64/interface-descriptors-arm64.cc
diff --git a/src/arm64/interface-descriptors-arm64.cc b/src/arm64/interface-descriptors-arm64.cc
index fb490a7d39e89a3fac167b6294eef80badbb9bf5..afa35bb3d67fa63f172ff96c93618ba5c7c9c748 100644
--- a/src/arm64/interface-descriptors-arm64.cc
+++ b/src/arm64/interface-descriptors-arm64.cc
@@ -14,282 +14,332 @@ 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 x1; }
+const Register LoadDescriptor::NameRegister() { return x2; }
+
+const Register VectorLoadICDescriptor::ReceiverRegister() {
+ return LoadDescriptor::ReceiverRegister();
+}
+
+
+const Register VectorLoadICDescriptor::NameRegister() {
+ return LoadDescriptor::NameRegister();
+}
+
+
+const Register VectorLoadICDescriptor::SlotRegister() { return x0; }
+const Register VectorLoadICDescriptor::VectorRegister() { return x3; }
+
+
+const Register StoreDescriptor::ReceiverRegister() { return x1; }
+const Register StoreDescriptor::NameRegister() { return x2; }
+const Register StoreDescriptor::ValueRegister() { return x0; }
+
+
+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 x3; }
+
+
+const Register InstanceofDescriptor::left() {
+ // Object to check (instanceof lhs).
+ return x11;
+}
+
+
+const Register InstanceofDescriptor::right() {
+ // Constructor function (instanceof rhs).
+ return x10;
+}
+
+
+void FastNewClosureDescriptor::Initialize(Isolate* isolate) {
+ // cp: context
+ // x2: function info
+ Register registers[] = {cp, x2};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void FastNewContextDescriptor::Initialize(Isolate* isolate) {
+ // cp: context
+ // x1: function
+ Register registers[] = {cp, x1};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void ToNumberDescriptor::Initialize(Isolate* isolate) {
+ // cp: context
+ // x0: value
+ Register registers[] = {cp, x0};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void NumberToStringDescriptor::Initialize(Isolate* isolate) {
+ // cp: context
+ // x0: value
+ Register registers[] = {cp, x0};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void FastCloneShallowArrayDescriptor::Initialize(Isolate* isolate) {
+ // cp: context
+ // x3: array literals array
+ // x2: array literal index
+ // x1: constant elements
+ Register registers[] = {cp, x3, x2, x1};
+ Representation representations[] = {
+ Representation::Tagged(), Representation::Tagged(), Representation::Smi(),
+ Representation::Tagged()};
+ InitializeData(isolate, key(), arraysize(registers), registers,
+ representations);
+}
+
+
+void FastCloneShallowObjectDescriptor::Initialize(Isolate* isolate) {
+ // cp: context
+ // x3: object literals array
+ // x2: object literal index
+ // x1: constant properties
+ // x0: object literal flags
+ Register registers[] = {cp, x3, x2, x1, x0};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void CreateAllocationSiteDescriptor::Initialize(Isolate* isolate) {
+ // cp: context
+ // x2: feedback vector
+ // x3: call feedback slot
+ Register registers[] = {cp, x2, x3};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void CallFunctionDescriptor::Initialize(Isolate* isolate) {
+ // x1 function the function to call
+ Register registers[] = {cp, x1};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void CallConstructDescriptor::Initialize(Isolate* isolate) {
+ // x0 : number of arguments
+ // x1 : the function to call
+ // x2 : feedback vector
+ // x3 : slot in feedback vector (smi) (if r2 is not the megamorphic symbol)
+ // 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, x0, x1, x2};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void RegExpConstructResultDescriptor::Initialize(Isolate* isolate) {
+ // cp: context
+ // x2: length
+ // x1: index (of last match)
+ // x0: string
+ Register registers[] = {cp, x2, x1, x0};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void TransitionElementsKindDescriptor::Initialize(Isolate* isolate) {
+ // cp: context
+ // x0: value (js_array)
+ // x1: to_map
+ Register registers[] = {cp, x0, x1};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void ArrayConstructorConstantArgCountDescriptor::Initialize(Isolate* isolate) {
+ // cp: context
+ // x1: function
+ // x2: allocation site with elements kind
+ // x0: number of arguments to the constructor function
+ Register registers[] = {cp, x1, x2};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void ArrayConstructorDescriptor::Initialize(Isolate* isolate) {
+ // stack param count needs (constructor pointer, and single argument)
+ Register registers[] = {cp, x1, x2, x0};
+ Representation representations[] = {
+ Representation::Tagged(), Representation::Tagged(),
+ Representation::Tagged(), Representation::Integer32()};
+ InitializeData(isolate, key(), arraysize(registers), registers,
+ representations);
+}
+
+
+void InternalArrayConstructorConstantArgCountDescriptor::Initialize(
+ Isolate* isolate) {
+ // cp: context
+ // x1: constructor function
+ // x0: number of arguments to the constructor function
+ Register registers[] = {cp, x1};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void InternalArrayConstructorDescriptor::Initialize(Isolate* isolate) {
+ // stack param count needs (constructor pointer, and single argument)
+ Register registers[] = {cp, x1, x0};
+ Representation representations[] = {Representation::Tagged(),
+ Representation::Tagged(),
+ Representation::Integer32()};
+ InitializeData(isolate, key(), arraysize(registers), registers,
+ representations);
+}
+
+
+void CompareNilDescriptor::Initialize(Isolate* isolate) {
+ // cp: context
+ // x0: value to compare
+ Register registers[] = {cp, x0};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void ToBooleanDescriptor::Initialize(Isolate* isolate) {
+ // cp: context
+ // x0: value
+ Register registers[] = {cp, x0};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void BinaryOpDescriptor::Initialize(Isolate* isolate) {
+ // cp: context
+ // x1: left operand
+ // x0: right operand
+ Register registers[] = {cp, x1, x0};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void BinaryOpWithAllocationSiteDescriptor::Initialize(Isolate* isolate) {
+ // cp: context
+ // x2: allocation site
+ // x1: left operand
+ // x0: right operand
+ Register registers[] = {cp, x2, x1, x0};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void StringAddDescriptor::Initialize(Isolate* isolate) {
+ // cp: context
+ // x1: left operand
+ // x0: right operand
+ Register registers[] = {cp, x1, x0};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void KeyedDescriptor::Initialize(Isolate* isolate) {
static PlatformInterfaceDescriptor noInlineDescriptor =
PlatformInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS);
- InitializeForIsolateAllPlatforms(isolate);
-
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::FastNewClosureCall);
- // cp: context
- // x2: function info
- Register registers[] = {cp, x2};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::FastNewContextCall);
- // cp: context
- // x1: function
- Register registers[] = {cp, x1};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::ToNumberCall);
- // cp: context
- // x0: value
- Register registers[] = {cp, x0};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::NumberToStringCall);
- // cp: context
- // x0: value
- Register registers[] = {cp, x0};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::FastCloneShallowArrayCall);
- // cp: context
- // x3: array literals array
- // x2: array literal index
- // x1: constant elements
- Register registers[] = {cp, x3, x2, x1};
- Representation representations[] = {
- Representation::Tagged(), Representation::Tagged(),
- Representation::Smi(), Representation::Tagged()};
- descriptor->Initialize(arraysize(registers), registers, representations);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::FastCloneShallowObjectCall);
- // cp: context
- // x3: object literals array
- // x2: object literal index
- // x1: constant properties
- // x0: object literal flags
- Register registers[] = {cp, x3, x2, x1, x0};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::CreateAllocationSiteCall);
- // cp: context
- // x2: feedback vector
- // x3: call feedback slot
- Register registers[] = {cp, x2, x3};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::CallFunctionCall);
- // x1 function the function to call
- Register registers[] = {cp, x1};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::CallConstructCall);
- // x0 : number of arguments
- // x1 : the function to call
- // x2 : feedback vector
- // x3 : slot in feedback vector (smi) (if r2 is not the megamorphic symbol)
- // 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, x0, x1, x2};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::RegExpConstructResultCall);
- // cp: context
- // x2: length
- // x1: index (of last match)
- // x0: string
- Register registers[] = {cp, x2, x1, x0};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::TransitionElementsKindCall);
- // cp: context
- // x0: value (js_array)
- // x1: to_map
- Register registers[] = {cp, x0, x1};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor = isolate->call_descriptor(
- CallDescriptorKey::ArrayConstructorConstantArgCountCall);
- // cp: context
- // x1: function
- // x2: allocation site with elements kind
- // x0: number of arguments to the constructor function
- Register registers[] = {cp, x1, x2};
- 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, x1, x2, x0};
- Representation representations[] = {
- Representation::Tagged(), Representation::Tagged(),
- Representation::Tagged(), Representation::Integer32()};
- descriptor->Initialize(arraysize(registers), registers, representations);
- }
- {
- CallInterfaceDescriptor* descriptor = isolate->call_descriptor(
- CallDescriptorKey::InternalArrayConstructorConstantArgCountCall);
- // cp: context
- // x1: constructor function
- // x0: number of arguments to the constructor function
- Register registers[] = {cp, x1};
- 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, x1, x0};
- Representation representations[] = {Representation::Tagged(),
- Representation::Tagged(),
- Representation::Integer32()};
- descriptor->Initialize(arraysize(registers), registers, representations);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::CompareNilCall);
- // cp: context
- // x0: value to compare
- Register registers[] = {cp, x0};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::ToBooleanCall);
- // cp: context
- // x0: value
- Register registers[] = {cp, x0};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::BinaryOpCall);
- // cp: context
- // x1: left operand
- // x0: right operand
- Register registers[] = {cp, x1, x0};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor = isolate->call_descriptor(
- CallDescriptorKey::BinaryOpWithAllocationSiteCall);
- // cp: context
- // x2: allocation site
- // x1: left operand
- // x0: right operand
- Register registers[] = {cp, x2, x1, x0};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::StringAddCall);
- // cp: context
- // x1: left operand
- // x0: right operand
- Register registers[] = {cp, x1, x0};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
-
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::ArgumentAdaptorCall);
- Register registers[] = {
- cp, // context
- x1, // JSFunction
- x0, // actual number of arguments
- x2, // 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
- x2, // 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
- x2, // 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
- x0, // 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
- x0, // callee
- x4, // call_data
- x2, // holder
- x1, // 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
+ x2, // 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);
+
+ Register registers[] = {
+ cp, // context
+ x2, // 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
+ x0, // 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
+ x1, // JSFunction
+ x0, // actual number of arguments
+ x2, // 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
+ x0, // callee
+ x4, // call_data
+ x2, // holder
+ x1, // 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

Powered by Google App Engine
This is Rietveld 408576698