CallDescriptors::InitializeForIsolate() is no longer needed.

CallInterfaceDescriptors initialize themselves lazily. Soon we can also tear
down the CodeStubInterfaceDescriptor explicit initialization step.

R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/535103002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23652 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 3e032ad9
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -42,50 +42,39 @@ void CallInterfaceDescriptorData::Initialize( ...@@ -42,50 +42,39 @@ void CallInterfaceDescriptorData::Initialize(
} }
void LoadDescriptor::Initialize(Isolate* isolate) { void LoadDescriptor::Initialize(CallInterfaceDescriptorData* data) {
Register registers[] = {ContextRegister(), ReceiverRegister(), Register registers[] = {ContextRegister(), ReceiverRegister(),
NameRegister()}; NameRegister()};
InitializeData(isolate, key(), arraysize(registers), registers, NULL); data->Initialize(arraysize(registers), registers, NULL);
} }
void StoreDescriptor::Initialize(Isolate* isolate) { void StoreDescriptor::Initialize(CallInterfaceDescriptorData* data) {
Register registers[] = {ContextRegister(), ReceiverRegister(), NameRegister(), Register registers[] = {ContextRegister(), ReceiverRegister(), NameRegister(),
ValueRegister()}; ValueRegister()};
InitializeData(isolate, key(), arraysize(registers), registers, NULL); data->Initialize(arraysize(registers), registers, NULL);
} }
void ElementTransitionAndStoreDescriptor::Initialize(Isolate* isolate) { void ElementTransitionAndStoreDescriptor::Initialize(
CallInterfaceDescriptorData* data) {
Register registers[] = {ContextRegister(), ValueRegister(), MapRegister(), Register registers[] = {ContextRegister(), ValueRegister(), MapRegister(),
NameRegister(), ReceiverRegister()}; NameRegister(), ReceiverRegister()};
InitializeData(isolate, key(), arraysize(registers), registers, NULL); data->Initialize(arraysize(registers), registers, NULL);
} }
void InstanceofDescriptor::Initialize(Isolate* isolate) { void InstanceofDescriptor::Initialize(CallInterfaceDescriptorData* data) {
Register registers[] = {ContextRegister(), left(), right()}; Register registers[] = {ContextRegister(), left(), right()};
InitializeData(isolate, key(), arraysize(registers), registers, NULL); data->Initialize(arraysize(registers), registers, NULL);
} }
void VectorLoadICDescriptor::Initialize(Isolate* isolate) { void VectorLoadICDescriptor::Initialize(CallInterfaceDescriptorData* data) {
Register registers[] = {ContextRegister(), ReceiverRegister(), NameRegister(), Register registers[] = {ContextRegister(), ReceiverRegister(), NameRegister(),
SlotRegister(), VectorRegister()}; SlotRegister(), VectorRegister()};
InitializeData(isolate, key(), arraysize(registers), registers, NULL); data->Initialize(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 } // namespace v8::internal
...@@ -104,8 +104,6 @@ class CallDescriptors { ...@@ -104,8 +104,6 @@ class CallDescriptors {
#undef DEF_ENUM #undef DEF_ENUM
NUMBER_OF_DESCRIPTORS NUMBER_OF_DESCRIPTORS
}; };
static void InitializeForIsolate(Isolate* isolate);
}; };
...@@ -163,24 +161,18 @@ class CallInterfaceDescriptor { ...@@ -163,24 +161,18 @@ class CallInterfaceDescriptor {
protected: protected:
const CallInterfaceDescriptorData* data() const { return data_; } const CallInterfaceDescriptorData* data() const { return data_; }
static void InitializeData(
Isolate* isolate, CallDescriptors::Key key, int register_parameter_count,
Register* registers, Representation* param_representations,
PlatformInterfaceDescriptor* platform_descriptor = NULL) {
isolate->call_descriptor_data(key)
->Initialize(register_parameter_count, registers, param_representations,
platform_descriptor);
}
private: private:
const CallInterfaceDescriptorData* data_; const CallInterfaceDescriptorData* data_;
}; };
#define DECLARE_DESCRIPTOR(name) \ #define DECLARE_DESCRIPTOR(name) \
explicit name(Isolate* isolate) : CallInterfaceDescriptor(isolate, key()) {} \ explicit name(Isolate* isolate) : CallInterfaceDescriptor(isolate, key()) { \
static inline CallDescriptors::Key key(); \ if (!data()->IsInitialized()) \
static void Initialize(Isolate* isolate); Initialize(isolate->call_descriptor_data(key())); \
} \
static inline CallDescriptors::Key key(); \
void Initialize(CallInterfaceDescriptorData* data);
class LoadDescriptor : public CallInterfaceDescriptor { class LoadDescriptor : public CallInterfaceDescriptor {
......
...@@ -1917,8 +1917,6 @@ bool Isolate::Init(Deserializer* des) { ...@@ -1917,8 +1917,6 @@ bool Isolate::Init(Deserializer* des) {
deoptimizer_data_ = new DeoptimizerData(memory_allocator_); deoptimizer_data_ = new DeoptimizerData(memory_allocator_);
CallDescriptors::InitializeForIsolate(this);
const bool create_heap_objects = (des == NULL); const bool create_heap_objects = (des == NULL);
if (create_heap_objects && !heap_.CreateHeapObjects()) { if (create_heap_objects && !heap_.CreateHeapObjects()) {
V8::FatalProcessOutOfMemory("heap object creation"); V8::FatalProcessOutOfMemory("heap object creation");
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment