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

Unified Diff: src/interface-descriptors.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/interface-descriptors.cc
diff --git a/src/interface-descriptors.cc b/src/interface-descriptors.cc
index 2661b09bc6d347853529319a1a2700f2e88942c1..a953337c151d6164157c0b0cab103dbe25a52bfe 100644
--- a/src/interface-descriptors.cc
+++ b/src/interface-descriptors.cc
@@ -4,13 +4,12 @@
#include "src/v8.h"
-#include "src/ic/ic-conventions.h"
#include "src/interface-descriptors.h"
namespace v8 {
namespace internal {
-void CallInterfaceDescriptor::Initialize(
+void CallInterfaceDescriptorData::Initialize(
int register_parameter_count, Register* registers,
Representation* register_param_representations,
PlatformInterfaceDescriptor* platform_descriptor) {
@@ -18,7 +17,8 @@ void CallInterfaceDescriptor::Initialize(
register_param_count_ = register_parameter_count;
// An interface descriptor must have a context register.
- DCHECK(register_parameter_count > 0 && registers[0].is(ContextRegister()));
+ DCHECK(register_parameter_count > 0 &&
+ registers[0].is(CallInterfaceDescriptor::ContextRegister()));
// InterfaceDescriptor owns a copy of the registers array.
register_params_.Reset(NewArray<Register>(register_parameter_count));
@@ -42,51 +42,50 @@ void CallInterfaceDescriptor::Initialize(
}
-void CallDescriptors::InitializeForIsolateAllPlatforms(Isolate* isolate) {
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::LoadICCall);
- Register registers[] = {CallInterfaceDescriptor::ContextRegister(),
- LoadConvention::ReceiverRegister(),
- LoadConvention::NameRegister()};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::StoreICCall);
- Register registers[] = {CallInterfaceDescriptor::ContextRegister(),
- StoreConvention::ReceiverRegister(),
- StoreConvention::NameRegister(),
- StoreConvention::ValueRegister()};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor = isolate->call_descriptor(
- CallDescriptorKey::ElementTransitionAndStoreCall);
- Register registers[] = {
- CallInterfaceDescriptor::ContextRegister(),
- StoreConvention::ValueRegister(), StoreConvention::MapRegister(),
- StoreConvention::NameRegister(), StoreConvention::ReceiverRegister()};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::InstanceofCall);
- Register registers[] = {CallInterfaceDescriptor::ContextRegister(),
- InstanceofConvention::left(),
- InstanceofConvention::right()};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
- {
- CallInterfaceDescriptor* descriptor =
- isolate->call_descriptor(CallDescriptorKey::VectorLoadICCall);
- Register registers[] = {CallInterfaceDescriptor::ContextRegister(),
- FullVectorLoadConvention::ReceiverRegister(),
- FullVectorLoadConvention::NameRegister(),
- FullVectorLoadConvention::SlotRegister(),
- FullVectorLoadConvention::VectorRegister()};
- descriptor->Initialize(arraysize(registers), registers, NULL);
- }
+void LoadDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {ContextRegister(), ReceiverRegister(),
+ NameRegister()};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void StoreDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {ContextRegister(), ReceiverRegister(), NameRegister(),
+ ValueRegister()};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void ElementTransitionAndStoreDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {ContextRegister(), ValueRegister(), MapRegister(),
+ NameRegister(), ReceiverRegister()};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void InstanceofDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {ContextRegister(), left(), right()};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void VectorLoadICDescriptor::Initialize(Isolate* isolate) {
+ Register registers[] = {ContextRegister(), ReceiverRegister(), NameRegister(),
+ SlotRegister(), VectorRegister()};
+ InitializeData(isolate, key(), arraysize(registers), registers, NULL);
+}
+
+
+void CallDescriptors::InitializeForIsolate(Isolate* isolate) {
+// Mechanically initialize all descriptors. The DCHECK makes sure that the
+// Initialize() method did what it is supposed to do.
+
+#define INITIALIZE_DESCRIPTOR(D) \
+ D##Descriptor::Initialize(isolate); \
+ DCHECK(D##Descriptor(isolate).IsInitialized());
+
+ INTERFACE_DESCRIPTOR_LIST(INITIALIZE_DESCRIPTOR)
+#undef INITIALIZE_DESCRIPTOR
}
}
} // namespace v8::internal
« src/interface-descriptors.h ('K') | « src/interface-descriptors.h ('k') | src/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698