OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/interface-descriptors.h" | 7 #include "src/interface-descriptors.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 24 matching lines...) Expand all Loading... |
35 // If there is a context register, the representation must be tagged. | 35 // If there is a context register, the representation must be tagged. |
36 DCHECK( | 36 DCHECK( |
37 i != 0 || | 37 i != 0 || |
38 register_param_representations[i].Equals(Representation::Tagged())); | 38 register_param_representations[i].Equals(Representation::Tagged())); |
39 register_param_representations_[i] = register_param_representations[i]; | 39 register_param_representations_[i] = register_param_representations[i]; |
40 } | 40 } |
41 } | 41 } |
42 } | 42 } |
43 | 43 |
44 | 44 |
45 void LoadDescriptor::Initialize(Isolate* isolate) { | 45 void LoadDescriptor::Initialize(CallInterfaceDescriptorData* data) { |
46 Register registers[] = {ContextRegister(), ReceiverRegister(), | 46 Register registers[] = {ContextRegister(), ReceiverRegister(), |
47 NameRegister()}; | 47 NameRegister()}; |
48 InitializeData(isolate, key(), arraysize(registers), registers, NULL); | 48 data->Initialize(arraysize(registers), registers, NULL); |
49 } | 49 } |
50 | 50 |
51 | 51 |
52 void StoreDescriptor::Initialize(Isolate* isolate) { | 52 void StoreDescriptor::Initialize(CallInterfaceDescriptorData* data) { |
53 Register registers[] = {ContextRegister(), ReceiverRegister(), NameRegister(), | 53 Register registers[] = {ContextRegister(), ReceiverRegister(), NameRegister(), |
54 ValueRegister()}; | 54 ValueRegister()}; |
55 InitializeData(isolate, key(), arraysize(registers), registers, NULL); | 55 data->Initialize(arraysize(registers), registers, NULL); |
56 } | 56 } |
57 | 57 |
58 | 58 |
59 void ElementTransitionAndStoreDescriptor::Initialize(Isolate* isolate) { | 59 void ElementTransitionAndStoreDescriptor::Initialize( |
| 60 CallInterfaceDescriptorData* data) { |
60 Register registers[] = {ContextRegister(), ValueRegister(), MapRegister(), | 61 Register registers[] = {ContextRegister(), ValueRegister(), MapRegister(), |
61 NameRegister(), ReceiverRegister()}; | 62 NameRegister(), ReceiverRegister()}; |
62 InitializeData(isolate, key(), arraysize(registers), registers, NULL); | 63 data->Initialize(arraysize(registers), registers, NULL); |
63 } | 64 } |
64 | 65 |
65 | 66 |
66 void InstanceofDescriptor::Initialize(Isolate* isolate) { | 67 void InstanceofDescriptor::Initialize(CallInterfaceDescriptorData* data) { |
67 Register registers[] = {ContextRegister(), left(), right()}; | 68 Register registers[] = {ContextRegister(), left(), right()}; |
68 InitializeData(isolate, key(), arraysize(registers), registers, NULL); | 69 data->Initialize(arraysize(registers), registers, NULL); |
69 } | 70 } |
70 | 71 |
71 | 72 |
72 void VectorLoadICDescriptor::Initialize(Isolate* isolate) { | 73 void VectorLoadICDescriptor::Initialize(CallInterfaceDescriptorData* data) { |
73 Register registers[] = {ContextRegister(), ReceiverRegister(), NameRegister(), | 74 Register registers[] = {ContextRegister(), ReceiverRegister(), NameRegister(), |
74 SlotRegister(), VectorRegister()}; | 75 SlotRegister(), VectorRegister()}; |
75 InitializeData(isolate, key(), arraysize(registers), registers, NULL); | 76 data->Initialize(arraysize(registers), registers, NULL); |
76 } | 77 } |
77 | 78 |
78 | |
79 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { | |
80 // Mechanically initialize all descriptors. The DCHECK makes sure that the | |
81 // Initialize() method did what it is supposed to do. | |
82 | |
83 #define INITIALIZE_DESCRIPTOR(D) \ | |
84 D##Descriptor::Initialize(isolate); \ | |
85 DCHECK(D##Descriptor(isolate).IsInitialized()); | |
86 | |
87 INTERFACE_DESCRIPTOR_LIST(INITIALIZE_DESCRIPTOR) | |
88 #undef INITIALIZE_DESCRIPTOR | |
89 } | |
90 } | 79 } |
91 } // namespace v8::internal | 80 } // namespace v8::internal |
OLD | NEW |