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

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

Issue 538573002: MIPS: Make concrete classes for individual call descriptors. - internal (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: mips64 port added. 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
« no previous file with comments | « src/mips/full-codegen-mips.cc ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips/interface-descriptors-mips.cc
diff --git a/src/mips/interface-descriptors-mips.cc b/src/mips/interface-descriptors-mips.cc
index d6d66ca1f3c76e3b5373d7df6ba9934f3282a009..b2693764e2f2f30f12693858288968cb32a9d07f 100644
--- a/src/mips/interface-descriptors-mips.cc
+++ b/src/mips/interface-descriptors-mips.cc
@@ -14,208 +14,279 @@ namespace internal {
const Register CallInterfaceDescriptor::ContextRegister() { return cp; }
-void CallDescriptors::InitializeForIsolate(Isolate* isolate) {
- InitializeForIsolateAllPlatforms(isolate);
-
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::FastNewClosureCall);
- Register registers[] = {cp, a2};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::FastNewContextCall);
- Register registers[] = {cp, a1};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::ToNumberCall);
- Register registers[] = {cp, a0};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::NumberToStringCall);
- Register registers[] = {cp, a0};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::FastCloneShallowArrayCall);
- Register registers[] = {cp, a3, a2, a1};
- 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, a3, a2, a1, a0};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::CreateAllocationSiteCall);
- Register registers[] = {cp, a2, a3};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::RegExpConstructResultCall);
- Register registers[] = {cp, a2, a1, a0};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::TransitionElementsKindCall);
- Register registers[] = {cp, a0, a1};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor = isolate->call_descriptor(
- CallDescriptorKey::ArrayConstructorConstantArgCountCall);
- // register state
- // cp -- context
- // a0 -- number of arguments
- // a1 -- function
- // a2 -- allocation site with elements kind
- Register registers[] = {cp, a1, a2};
- 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, a1, a2, a0};
- 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
- // a0 -- number of arguments
- // a1 -- constructor function
- Register registers[] = {cp, a1};
- 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, a1, a0};
- Representation representations[] = {Representation::Tagged(),
- Representation::Tagged(),
- Representation::Integer32()};
- descriptor->Initialize(arraysize(registers), registers, representations);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::CompareNilCall);
- Register registers[] = {cp, a0};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::ToBooleanCall);
- Register registers[] = {cp, a0};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::BinaryOpCall);
- Register registers[] = {cp, a1, a0};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor = isolate->call_descriptor(
- CallDescriptorKey::BinaryOpWithAllocationSiteCall);
- Register registers[] = {cp, a2, a1, a0};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::StringAddCall);
- Register registers[] = {cp, a1, a0};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
-
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::ArgumentAdaptorCall);
- Register registers[] = { cp, // context,
- a1, // JSFunction
- a0, // actual number of arguments
- a2, // 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[] = { cp, // context
- a2, // key
- };
- Representation representations[] = {
- Representation::Tagged(), // context
- Representation::Tagged(), // key
- };
- descriptor->Initialize(arraysize(registers), registers, representations);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::NamedCall);
- Register registers[] = { cp, // context
- a2, // name
- };
- Representation representations[] = {
- Representation::Tagged(), // context
- Representation::Tagged(), // name
- };
- descriptor->Initialize(arraysize(registers), registers, representations);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::CallHandler);
- Register registers[] = { cp, // context
- a0, // receiver
- };
- Representation representations[] = {
- Representation::Tagged(), // context
- Representation::Tagged(), // receiver
- };
- descriptor->Initialize(arraysize(registers), registers, representations);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::ApiFunctionCall);
- Register registers[] = { cp, // context
- a0, // callee
- t0, // call_data
- a2, // holder
- a1, // 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 a1; }
+const Register LoadDescriptor::NameRegister() { return a2; }
+
+
+const Register VectorLoadICDescriptor::ReceiverRegister() {
+ return LoadDescriptor::ReceiverRegister();
+}
+
+
+const Register VectorLoadICDescriptor::NameRegister() {
+ return LoadDescriptor::NameRegister();
+}
+
+
+const Register VectorLoadICDescriptor::SlotRegister() { return a0; }
+const Register VectorLoadICDescriptor::VectorRegister() { return a3; }
+
+
+const Register StoreDescriptor::ReceiverRegister() { return a1; }
+const Register StoreDescriptor::NameRegister() { return a2; }
+const Register StoreDescriptor::ValueRegister() { return a0; }
+
+
+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 a3; }
+
+
+const Register InstanceofDescriptor::left() { return a0; }
+const Register InstanceofDescriptor::right() { return a1; }
+
+
+void FastNewClosureDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {cp, a2};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void FastNewContextDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {cp, a1};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void ToNumberDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {cp, a0};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void NumberToStringDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {cp, a0};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void FastCloneShallowArrayDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {cp, a3, a2, a1};
+ 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, a3, a2, a1, a0};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void CreateAllocationSiteDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {cp, a2, a3};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void CallFunctionDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {cp, a1};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void CallConstructDescriptor::Initialize(Isolate* isolate) {
+ // a0 : number of arguments
+ // a1 : the function to call
+ // a2 : feedback vector
+ // a3 : (only if a2 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, a0, a1, a2};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void RegExpConstructResultDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {cp, a2, a1, a0};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void TransitionElementsKindDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {cp, a0, a1};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void ArrayConstructorConstantArgCountDescriptor::Initialize(Isolate* isolate) {
+ // register state
+ // cp -- context
+ // a0 -- number of arguments
+ // a1 -- function
+ // a2 -- allocation site with elements kind
+ Register registers[] = {cp, a1, a2};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void ArrayConstructorDescriptor::Initialize(Isolate* isolate) {
+ // stack param count needs (constructor pointer, and single argument)
+ Register registers[] = {cp, a1, a2, a0};
+ 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
+ // a0 -- number of arguments
+ // a1 -- constructor function
+ Register registers[] = {cp, a1};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void InternalArrayConstructorDescriptor::Initialize(Isolate* isolate) {
+ // stack param count needs (constructor pointer, and single argument)
+ Register registers[] = {cp, a1, a0};
+ Representation representations[] = {Representation::Tagged(),
+ Representation::Tagged(),
+ Representation::Integer32()};
+ InitializeData(isolate, key(), arraysize(registers), registers,
+ representations);
+}
+
+
+void CompareNilDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {cp, a0};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void ToBooleanDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {cp, a0};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void BinaryOpDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {cp, a1, a0};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void BinaryOpWithAllocationSiteDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {cp, a2, a1, a0};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void StringAddDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {cp, a1, a0};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void KeyedDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {
+ cp, // context
+ a2, // key
+ };
+ Representation representations[] = {
+ Representation::Tagged(), // context
+ Representation::Tagged(), // key
+ };
+ InitializeData(isolate, key(), arraysize(registers), registers,
+ representations);
+}
+
+
+void NamedDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {
+ cp, // context
+ a2, // name
+ };
+ Representation representations[] = {
+ Representation::Tagged(), // context
+ Representation::Tagged(), // name
+ };
+ InitializeData(isolate, key(), arraysize(registers), registers,
+ representations);
+}
+
+
+void CallHandlerDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {
+ cp, // context
+ a0, // 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
+ a1, // JSFunction
+ a0, // actual number of arguments
+ a2, // 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
+ a0, // callee
+ t0, // call_data
+ a2, // holder
+ a1, // 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/mips/full-codegen-mips.cc ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698