OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef V8_SRC_IC_ACCESSOR_ASSEMBLER_H_ | 5 #ifndef V8_SRC_IC_ACCESSOR_ASSEMBLER_H_ |
6 #define V8_SRC_IC_ACCESSOR_ASSEMBLER_H_ | 6 #define V8_SRC_IC_ACCESSOR_ASSEMBLER_H_ |
7 | 7 |
8 #include "src/code-stub-assembler.h" | 8 #include "src/code-stub-assembler.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
11 namespace internal { | 11 namespace internal { |
12 | 12 |
13 namespace compiler { | 13 namespace compiler { |
14 class CodeAssemblerState; | 14 class CodeAssemblerState; |
15 } | 15 } |
16 | 16 |
17 class ExitPoint; | 17 class ExitPoint; |
18 | 18 |
19 class AccessorAssembler : public CodeStubAssembler { | 19 class AccessorAssembler : public CodeStubAssembler { |
20 public: | 20 public: |
21 typedef compiler::Node Node; | 21 typedef compiler::Node Node; |
22 | 22 |
23 explicit AccessorAssembler(compiler::CodeAssemblerState* state) | 23 explicit AccessorAssembler(compiler::CodeAssemblerState* state) |
24 : CodeStubAssembler(state) {} | 24 : CodeStubAssembler(state) {} |
25 | 25 |
26 void GenerateLoadIC(); | 26 void GenerateLoadIC(); |
| 27 void GenerateLoadIC_Noninlined(); |
27 void GenerateLoadIC_Uninitialized(); | 28 void GenerateLoadIC_Uninitialized(); |
28 void GenerateLoadField(); | 29 void GenerateLoadField(); |
29 void GenerateLoadICTrampoline(); | 30 void GenerateLoadICTrampoline(); |
30 void GenerateKeyedLoadIC(); | 31 void GenerateKeyedLoadIC(); |
31 void GenerateKeyedLoadICTrampoline(); | 32 void GenerateKeyedLoadICTrampoline(); |
32 void GenerateKeyedLoadIC_Megamorphic(); | 33 void GenerateKeyedLoadIC_Megamorphic(); |
33 void GenerateStoreIC(LanguageMode language_mode); | 34 void GenerateStoreIC(LanguageMode language_mode); |
34 void GenerateStoreICTrampoline(LanguageMode language_mode); | 35 void GenerateStoreICTrampoline(LanguageMode language_mode); |
35 | 36 |
36 void GenerateLoadICProtoArray(bool throw_reference_error_if_nonexistent); | 37 void GenerateLoadICProtoArray(bool throw_reference_error_if_nonexistent); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 }; | 70 }; |
70 | 71 |
71 void LoadGlobalIC_TryPropertyCellCase( | 72 void LoadGlobalIC_TryPropertyCellCase( |
72 Node* vector, Node* slot, ExitPoint* exit_point, Label* try_handler, | 73 Node* vector, Node* slot, ExitPoint* exit_point, Label* try_handler, |
73 Label* miss, ParameterMode slot_mode = SMI_PARAMETERS); | 74 Label* miss, ParameterMode slot_mode = SMI_PARAMETERS); |
74 void LoadGlobalIC_TryHandlerCase(const LoadICParameters* p, | 75 void LoadGlobalIC_TryHandlerCase(const LoadICParameters* p, |
75 TypeofMode typeof_mode, | 76 TypeofMode typeof_mode, |
76 ExitPoint* exit_point, Label* miss); | 77 ExitPoint* exit_point, Label* miss); |
77 void LoadGlobalIC_MissCase(const LoadICParameters* p, ExitPoint* exit_point); | 78 void LoadGlobalIC_MissCase(const LoadICParameters* p, ExitPoint* exit_point); |
78 | 79 |
| 80 // Specialized LoadIC for inlined bytecode handler, hand-tuned to omit frame |
| 81 // construction on common paths. |
| 82 void LoadIC_BytecodeHandler(const LoadICParameters* p, ExitPoint* exit_point); |
| 83 |
79 protected: | 84 protected: |
80 struct StoreICParameters : public LoadICParameters { | 85 struct StoreICParameters : public LoadICParameters { |
81 StoreICParameters(Node* context, Node* receiver, Node* name, Node* value, | 86 StoreICParameters(Node* context, Node* receiver, Node* name, Node* value, |
82 Node* slot, Node* vector) | 87 Node* slot, Node* vector) |
83 : LoadICParameters(context, receiver, name, slot, vector), | 88 : LoadICParameters(context, receiver, name, slot, vector), |
84 value(value) {} | 89 value(value) {} |
85 Node* value; | 90 Node* value; |
86 }; | 91 }; |
87 | 92 |
88 enum ElementSupport { kOnlyProperties, kSupportElements }; | 93 enum ElementSupport { kOnlyProperties, kSupportElements }; |
89 void HandleStoreICHandlerCase( | 94 void HandleStoreICHandlerCase( |
90 const StoreICParameters* p, Node* handler, Label* miss, | 95 const StoreICParameters* p, Node* handler, Label* miss, |
91 ElementSupport support_elements = kOnlyProperties); | 96 ElementSupport support_elements = kOnlyProperties); |
92 void JumpIfDataProperty(Node* details, Label* writable, Label* readonly); | 97 void JumpIfDataProperty(Node* details, Label* writable, Label* readonly); |
93 | 98 |
94 private: | 99 private: |
95 // Stub generation entry points. | 100 // Stub generation entry points. |
96 | 101 |
| 102 // LoadIC contains the full LoadIC logic, while LoadIC_Noninlined contains |
| 103 // logic not inlined into Ignition bytecode handlers. |
97 void LoadIC(const LoadICParameters* p); | 104 void LoadIC(const LoadICParameters* p); |
| 105 void LoadIC_Noninlined(const LoadICParameters* p, Node* receiver_map, |
| 106 Node* feedback, Variable* var_handler, |
| 107 Label* if_handler, Label* miss, ExitPoint* exit_point); |
| 108 |
98 void LoadIC_Uninitialized(const LoadICParameters* p); | 109 void LoadIC_Uninitialized(const LoadICParameters* p); |
99 void LoadICProtoArray(const LoadICParameters* p, Node* handler, | 110 void LoadICProtoArray(const LoadICParameters* p, Node* handler, |
100 bool throw_reference_error_if_nonexistent); | 111 bool throw_reference_error_if_nonexistent); |
101 void LoadGlobalIC(const LoadICParameters* p, TypeofMode typeof_mode); | 112 void LoadGlobalIC(const LoadICParameters* p, TypeofMode typeof_mode); |
102 void KeyedLoadIC(const LoadICParameters* p); | 113 void KeyedLoadIC(const LoadICParameters* p); |
103 void KeyedLoadICGeneric(const LoadICParameters* p); | 114 void KeyedLoadICGeneric(const LoadICParameters* p); |
104 void StoreIC(const StoreICParameters* p); | 115 void StoreIC(const StoreICParameters* p); |
105 void KeyedStoreIC(const StoreICParameters* p, LanguageMode language_mode); | 116 void KeyedStoreIC(const StoreICParameters* p, LanguageMode language_mode); |
106 | 117 |
107 // IC dispatcher behavior. | 118 // IC dispatcher behavior. |
108 | 119 |
109 // Checks monomorphic case. Returns {feedback} entry of the vector. | 120 // Checks monomorphic case. Returns {feedback} entry of the vector. |
110 Node* TryMonomorphicCase(Node* slot, Node* vector, Node* receiver_map, | 121 Node* TryMonomorphicCase(Node* slot, Node* vector, Node* receiver_map, |
111 Label* if_handler, Variable* var_handler, | 122 Label* if_handler, Variable* var_handler, |
112 Label* if_miss); | 123 Label* if_miss); |
113 void HandlePolymorphicCase(Node* receiver_map, Node* feedback, | 124 void HandlePolymorphicCase(Node* receiver_map, Node* feedback, |
114 Label* if_handler, Variable* var_handler, | 125 Label* if_handler, Variable* var_handler, |
115 Label* if_miss, int unroll_count); | 126 Label* if_miss, int unroll_count); |
116 void HandleKeyedStorePolymorphicCase(Node* receiver_map, Node* feedback, | 127 void HandleKeyedStorePolymorphicCase(Node* receiver_map, Node* feedback, |
117 Label* if_handler, Variable* var_handler, | 128 Label* if_handler, Variable* var_handler, |
118 Label* if_transition_handler, | 129 Label* if_transition_handler, |
119 Variable* var_transition_map_cell, | 130 Variable* var_transition_map_cell, |
120 Label* if_miss); | 131 Label* if_miss); |
121 | 132 |
122 // LoadIC implementation. | 133 // LoadIC implementation. |
123 | 134 |
124 void HandleLoadICHandlerCase( | 135 void HandleLoadICHandlerCase( |
125 const LoadICParameters* p, Node* handler, Label* miss, | 136 const LoadICParameters* p, Node* handler, Label* miss, |
126 ElementSupport support_elements = kOnlyProperties); | 137 ExitPoint* exit_point, ElementSupport support_elements = kOnlyProperties); |
127 | 138 |
128 void HandleLoadICSmiHandlerCase(const LoadICParameters* p, Node* holder, | 139 void HandleLoadICSmiHandlerCase(const LoadICParameters* p, Node* holder, |
129 Node* smi_handler, Label* miss, | 140 Node* smi_handler, Label* miss, |
130 ExitPoint* exit_point, | 141 ExitPoint* exit_point, |
131 ElementSupport support_elements); | 142 ElementSupport support_elements); |
132 | 143 |
133 void HandleLoadICProtoHandlerCase(const LoadICParameters* p, Node* handler, | 144 void HandleLoadICProtoHandlerCase(const LoadICParameters* p, Node* handler, |
134 Variable* var_holder, | 145 Variable* var_holder, |
135 Variable* var_smi_handler, | 146 Variable* var_smi_handler, |
136 Label* if_smi_handler, Label* miss, | 147 Label* if_smi_handler, Label* miss, |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 | 295 |
285 CodeAssemblerLabel* const out_; | 296 CodeAssemblerLabel* const out_; |
286 CodeAssemblerVariable* const var_result_; | 297 CodeAssemblerVariable* const var_result_; |
287 CodeStubAssembler* const asm_; | 298 CodeStubAssembler* const asm_; |
288 }; | 299 }; |
289 | 300 |
290 } // namespace internal | 301 } // namespace internal |
291 } // namespace v8 | 302 } // namespace v8 |
292 | 303 |
293 #endif // V8_SRC_IC_ACCESSOR_ASSEMBLER_H_ | 304 #endif // V8_SRC_IC_ACCESSOR_ASSEMBLER_H_ |
OLD | NEW |