OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_COMPILER_JS_OPERATOR_H_ | 5 #ifndef V8_COMPILER_JS_OPERATOR_H_ |
6 #define V8_COMPILER_JS_OPERATOR_H_ | 6 #define V8_COMPILER_JS_OPERATOR_H_ |
7 | 7 |
8 #include "src/runtime/runtime.h" | 8 #include "src/runtime/runtime.h" |
9 #include "src/unique.h" | 9 #include "src/unique.h" |
10 | 10 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 108 |
109 private: | 109 private: |
110 const Handle<TypeFeedbackVector> vector_; | 110 const Handle<TypeFeedbackVector> vector_; |
111 const FeedbackVectorICSlot slot_; | 111 const FeedbackVectorICSlot slot_; |
112 }; | 112 }; |
113 | 113 |
114 | 114 |
115 bool operator==(VectorSlotPair const& lhs, VectorSlotPair const& rhs); | 115 bool operator==(VectorSlotPair const& lhs, VectorSlotPair const& rhs); |
116 | 116 |
117 | 117 |
| 118 // For (Load|Store)Named operators, the mode of the IC that needs |
| 119 // to be called. This is needed because (Load|Store)Property nodes can be |
| 120 // reduced to named versions, but still need to call the correct original |
| 121 // IC mode because of the layout of feedback vectors. |
| 122 enum PropertyICMode { NAMED, KEYED }; |
| 123 |
118 // Defines the property being loaded from an object by a named load. This is | 124 // Defines the property being loaded from an object by a named load. This is |
119 // used as a parameter by JSLoadNamed operators. | 125 // used as a parameter by JSLoadNamed operators. |
120 class LoadNamedParameters final { | 126 class LoadNamedParameters final { |
121 public: | 127 public: |
122 LoadNamedParameters(const Unique<Name>& name, const VectorSlotPair& feedback, | 128 LoadNamedParameters(const Unique<Name>& name, const VectorSlotPair& feedback, |
123 ContextualMode contextual_mode) | 129 ContextualMode contextual_mode, PropertyICMode load_ic) |
124 : name_(name), contextual_mode_(contextual_mode), feedback_(feedback) {} | 130 : name_(name), |
| 131 feedback_(feedback), |
| 132 contextual_mode_(contextual_mode), |
| 133 load_ic_(load_ic) {} |
125 | 134 |
126 const Unique<Name>& name() const { return name_; } | 135 const Unique<Name>& name() const { return name_; } |
127 ContextualMode contextual_mode() const { return contextual_mode_; } | 136 ContextualMode contextual_mode() const { return contextual_mode_; } |
| 137 PropertyICMode load_ic() const { return load_ic_; } |
128 | 138 |
129 const VectorSlotPair& feedback() const { return feedback_; } | 139 const VectorSlotPair& feedback() const { return feedback_; } |
130 | 140 |
131 private: | 141 private: |
132 const Unique<Name> name_; | 142 const Unique<Name> name_; |
| 143 const VectorSlotPair feedback_; |
133 const ContextualMode contextual_mode_; | 144 const ContextualMode contextual_mode_; |
134 const VectorSlotPair feedback_; | 145 const PropertyICMode load_ic_; |
135 }; | 146 }; |
136 | 147 |
137 bool operator==(LoadNamedParameters const&, LoadNamedParameters const&); | 148 bool operator==(LoadNamedParameters const&, LoadNamedParameters const&); |
138 bool operator!=(LoadNamedParameters const&, LoadNamedParameters const&); | 149 bool operator!=(LoadNamedParameters const&, LoadNamedParameters const&); |
139 | 150 |
140 size_t hash_value(LoadNamedParameters const&); | 151 size_t hash_value(LoadNamedParameters const&); |
141 | 152 |
142 std::ostream& operator<<(std::ostream&, LoadNamedParameters const&); | 153 std::ostream& operator<<(std::ostream&, LoadNamedParameters const&); |
143 | 154 |
144 const LoadNamedParameters& LoadNamedParametersOf(const Operator* op); | 155 const LoadNamedParameters& LoadNamedParametersOf(const Operator* op); |
(...skipping 19 matching lines...) Expand all Loading... |
164 | 175 |
165 std::ostream& operator<<(std::ostream&, LoadPropertyParameters const&); | 176 std::ostream& operator<<(std::ostream&, LoadPropertyParameters const&); |
166 | 177 |
167 const LoadPropertyParameters& LoadPropertyParametersOf(const Operator* op); | 178 const LoadPropertyParameters& LoadPropertyParametersOf(const Operator* op); |
168 | 179 |
169 | 180 |
170 // Defines the property being stored to an object by a named store. This is | 181 // Defines the property being stored to an object by a named store. This is |
171 // used as a parameter by JSStoreNamed operators. | 182 // used as a parameter by JSStoreNamed operators. |
172 class StoreNamedParameters final { | 183 class StoreNamedParameters final { |
173 public: | 184 public: |
174 StoreNamedParameters(LanguageMode language_mode, const Unique<Name>& name) | 185 StoreNamedParameters(LanguageMode language_mode, const Unique<Name>& name, |
175 : language_mode_(language_mode), name_(name) {} | 186 PropertyICMode store_ic) |
| 187 : language_mode_(language_mode), name_(name), store_ic_(store_ic) {} |
176 | 188 |
177 LanguageMode language_mode() const { return language_mode_; } | 189 LanguageMode language_mode() const { return language_mode_; } |
178 const Unique<Name>& name() const { return name_; } | 190 const Unique<Name>& name() const { return name_; } |
| 191 PropertyICMode store_ic() const { return store_ic_; } |
179 | 192 |
180 private: | 193 private: |
181 const LanguageMode language_mode_; | 194 const LanguageMode language_mode_; |
182 const Unique<Name> name_; | 195 const Unique<Name> name_; |
| 196 const PropertyICMode store_ic_; |
183 }; | 197 }; |
184 | 198 |
185 bool operator==(StoreNamedParameters const&, StoreNamedParameters const&); | 199 bool operator==(StoreNamedParameters const&, StoreNamedParameters const&); |
186 bool operator!=(StoreNamedParameters const&, StoreNamedParameters const&); | 200 bool operator!=(StoreNamedParameters const&, StoreNamedParameters const&); |
187 | 201 |
188 size_t hash_value(StoreNamedParameters const&); | 202 size_t hash_value(StoreNamedParameters const&); |
189 | 203 |
190 std::ostream& operator<<(std::ostream&, StoreNamedParameters const&); | 204 std::ostream& operator<<(std::ostream&, StoreNamedParameters const&); |
191 | 205 |
192 const StoreNamedParameters& StoreNamedParametersOf(const Operator* op); | 206 const StoreNamedParameters& StoreNamedParametersOf(const Operator* op); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 const Operator* Create(); | 244 const Operator* Create(); |
231 | 245 |
232 const Operator* CallFunction(size_t arity, CallFunctionFlags flags); | 246 const Operator* CallFunction(size_t arity, CallFunctionFlags flags); |
233 const Operator* CallRuntime(Runtime::FunctionId id, size_t arity); | 247 const Operator* CallRuntime(Runtime::FunctionId id, size_t arity); |
234 | 248 |
235 const Operator* CallConstruct(int arguments); | 249 const Operator* CallConstruct(int arguments); |
236 | 250 |
237 const Operator* LoadProperty(const VectorSlotPair& feedback); | 251 const Operator* LoadProperty(const VectorSlotPair& feedback); |
238 const Operator* LoadNamed(const Unique<Name>& name, | 252 const Operator* LoadNamed(const Unique<Name>& name, |
239 const VectorSlotPair& feedback, | 253 const VectorSlotPair& feedback, |
240 ContextualMode contextual_mode = NOT_CONTEXTUAL); | 254 ContextualMode contextual_mode = NOT_CONTEXTUAL, |
| 255 PropertyICMode load_ic = NAMED); |
241 | 256 |
242 const Operator* StoreProperty(LanguageMode language_mode); | 257 const Operator* StoreProperty(LanguageMode language_mode); |
243 const Operator* StoreNamed(LanguageMode language_mode, | 258 const Operator* StoreNamed(LanguageMode language_mode, |
244 const Unique<Name>& name); | 259 const Unique<Name>& name, |
| 260 PropertyICMode store_ic = NAMED); |
245 | 261 |
246 const Operator* DeleteProperty(LanguageMode language_mode); | 262 const Operator* DeleteProperty(LanguageMode language_mode); |
247 | 263 |
248 const Operator* HasProperty(); | 264 const Operator* HasProperty(); |
249 | 265 |
250 const Operator* LoadContext(size_t depth, size_t index, bool immutable); | 266 const Operator* LoadContext(size_t depth, size_t index, bool immutable); |
251 const Operator* StoreContext(size_t depth, size_t index); | 267 const Operator* StoreContext(size_t depth, size_t index); |
252 | 268 |
253 const Operator* TypeOf(); | 269 const Operator* TypeOf(); |
254 const Operator* InstanceOf(); | 270 const Operator* InstanceOf(); |
(...skipping 15 matching lines...) Expand all Loading... |
270 Zone* const zone_; | 286 Zone* const zone_; |
271 | 287 |
272 DISALLOW_COPY_AND_ASSIGN(JSOperatorBuilder); | 288 DISALLOW_COPY_AND_ASSIGN(JSOperatorBuilder); |
273 }; | 289 }; |
274 | 290 |
275 } // namespace compiler | 291 } // namespace compiler |
276 } // namespace internal | 292 } // namespace internal |
277 } // namespace v8 | 293 } // namespace v8 |
278 | 294 |
279 #endif // V8_COMPILER_JS_OPERATOR_H_ | 295 #endif // V8_COMPILER_JS_OPERATOR_H_ |
OLD | NEW |