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 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 std::ostream& operator<<(std::ostream&, LoadNamedParameters const&); | 255 std::ostream& operator<<(std::ostream&, LoadNamedParameters const&); |
256 | 256 |
257 const LoadNamedParameters& LoadNamedParametersOf(const Operator* op); | 257 const LoadNamedParameters& LoadNamedParametersOf(const Operator* op); |
258 | 258 |
259 | 259 |
260 // Defines the property being loaded from an object by a named load. This is | 260 // Defines the property being loaded from an object by a named load. This is |
261 // used as a parameter by JSLoadGlobal operator. | 261 // used as a parameter by JSLoadGlobal operator. |
262 class LoadGlobalParameters final { | 262 class LoadGlobalParameters final { |
263 public: | 263 public: |
264 LoadGlobalParameters(const Handle<Name>& name, const VectorSlotPair& feedback, | 264 LoadGlobalParameters(const Handle<Name>& name, const VectorSlotPair& feedback, |
265 TypeofMode typeof_mode, int slot_index) | 265 TypeofMode typeof_mode) |
266 : name_(name), | 266 : name_(name), feedback_(feedback), typeof_mode_(typeof_mode) {} |
267 feedback_(feedback), | |
268 typeof_mode_(typeof_mode), | |
269 slot_index_(slot_index) {} | |
270 | 267 |
271 const Handle<Name>& name() const { return name_; } | 268 const Handle<Name>& name() const { return name_; } |
272 TypeofMode typeof_mode() const { return typeof_mode_; } | 269 TypeofMode typeof_mode() const { return typeof_mode_; } |
273 | 270 |
274 const VectorSlotPair& feedback() const { return feedback_; } | 271 const VectorSlotPair& feedback() const { return feedback_; } |
275 | 272 |
276 int slot_index() const { return slot_index_; } | |
277 | |
278 private: | 273 private: |
279 const Handle<Name> name_; | 274 const Handle<Name> name_; |
280 const VectorSlotPair feedback_; | 275 const VectorSlotPair feedback_; |
281 const TypeofMode typeof_mode_; | 276 const TypeofMode typeof_mode_; |
282 const int slot_index_; | |
283 }; | 277 }; |
284 | 278 |
285 bool operator==(LoadGlobalParameters const&, LoadGlobalParameters const&); | 279 bool operator==(LoadGlobalParameters const&, LoadGlobalParameters const&); |
286 bool operator!=(LoadGlobalParameters const&, LoadGlobalParameters const&); | 280 bool operator!=(LoadGlobalParameters const&, LoadGlobalParameters const&); |
287 | 281 |
288 size_t hash_value(LoadGlobalParameters const&); | 282 size_t hash_value(LoadGlobalParameters const&); |
289 | 283 |
290 std::ostream& operator<<(std::ostream&, LoadGlobalParameters const&); | 284 std::ostream& operator<<(std::ostream&, LoadGlobalParameters const&); |
291 | 285 |
292 const LoadGlobalParameters& LoadGlobalParametersOf(const Operator* op); | 286 const LoadGlobalParameters& LoadGlobalParametersOf(const Operator* op); |
293 | 287 |
294 | 288 |
295 // Defines the property being stored to an object by a named store. This is | 289 // Defines the property being stored to an object by a named store. This is |
296 // used as a parameter by JSStoreGlobal operator. | 290 // used as a parameter by JSStoreGlobal operator. |
297 class StoreGlobalParameters final { | 291 class StoreGlobalParameters final { |
298 public: | 292 public: |
299 StoreGlobalParameters(LanguageMode language_mode, | 293 StoreGlobalParameters(LanguageMode language_mode, |
300 const VectorSlotPair& feedback, | 294 const VectorSlotPair& feedback, |
301 const Handle<Name>& name, int slot_index) | 295 const Handle<Name>& name) |
302 : language_mode_(language_mode), | 296 : language_mode_(language_mode), name_(name), feedback_(feedback) {} |
303 name_(name), | |
304 feedback_(feedback), | |
305 slot_index_(slot_index) {} | |
306 | 297 |
307 LanguageMode language_mode() const { return language_mode_; } | 298 LanguageMode language_mode() const { return language_mode_; } |
308 const VectorSlotPair& feedback() const { return feedback_; } | 299 const VectorSlotPair& feedback() const { return feedback_; } |
309 const Handle<Name>& name() const { return name_; } | 300 const Handle<Name>& name() const { return name_; } |
310 int slot_index() const { return slot_index_; } | |
311 | 301 |
312 private: | 302 private: |
313 const LanguageMode language_mode_; | 303 const LanguageMode language_mode_; |
314 const Handle<Name> name_; | 304 const Handle<Name> name_; |
315 const VectorSlotPair feedback_; | 305 const VectorSlotPair feedback_; |
316 int slot_index_; | |
317 }; | 306 }; |
318 | 307 |
319 bool operator==(StoreGlobalParameters const&, StoreGlobalParameters const&); | 308 bool operator==(StoreGlobalParameters const&, StoreGlobalParameters const&); |
320 bool operator!=(StoreGlobalParameters const&, StoreGlobalParameters const&); | 309 bool operator!=(StoreGlobalParameters const&, StoreGlobalParameters const&); |
321 | 310 |
322 size_t hash_value(StoreGlobalParameters const&); | 311 size_t hash_value(StoreGlobalParameters const&); |
323 | 312 |
324 std::ostream& operator<<(std::ostream&, StoreGlobalParameters const&); | 313 std::ostream& operator<<(std::ostream&, StoreGlobalParameters const&); |
325 | 314 |
326 const StoreGlobalParameters& StoreGlobalParametersOf(const Operator* op); | 315 const StoreGlobalParameters& StoreGlobalParametersOf(const Operator* op); |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 const Operator* StoreNamed(LanguageMode language_mode, | 513 const Operator* StoreNamed(LanguageMode language_mode, |
525 const Handle<Name>& name, | 514 const Handle<Name>& name, |
526 const VectorSlotPair& feedback); | 515 const VectorSlotPair& feedback); |
527 | 516 |
528 const Operator* DeleteProperty(LanguageMode language_mode); | 517 const Operator* DeleteProperty(LanguageMode language_mode); |
529 | 518 |
530 const Operator* HasProperty(); | 519 const Operator* HasProperty(); |
531 | 520 |
532 const Operator* LoadGlobal(const Handle<Name>& name, | 521 const Operator* LoadGlobal(const Handle<Name>& name, |
533 const VectorSlotPair& feedback, | 522 const VectorSlotPair& feedback, |
534 TypeofMode typeof_mode = NOT_INSIDE_TYPEOF, | 523 TypeofMode typeof_mode = NOT_INSIDE_TYPEOF); |
535 int slot_index = -1); | |
536 const Operator* StoreGlobal(LanguageMode language_mode, | 524 const Operator* StoreGlobal(LanguageMode language_mode, |
537 const Handle<Name>& name, | 525 const Handle<Name>& name, |
538 const VectorSlotPair& feedback, | 526 const VectorSlotPair& feedback); |
539 int slot_index = -1); | |
540 | 527 |
541 const Operator* LoadContext(size_t depth, size_t index, bool immutable); | 528 const Operator* LoadContext(size_t depth, size_t index, bool immutable); |
542 const Operator* StoreContext(size_t depth, size_t index); | 529 const Operator* StoreContext(size_t depth, size_t index); |
543 | 530 |
544 const Operator* LoadDynamicGlobal(const Handle<String>& name, | 531 const Operator* LoadDynamicGlobal(const Handle<String>& name, |
545 uint32_t check_bitset, | 532 uint32_t check_bitset, |
546 const VectorSlotPair& feedback, | 533 const VectorSlotPair& feedback, |
547 TypeofMode typeof_mode); | 534 TypeofMode typeof_mode); |
548 const Operator* LoadDynamicContext(const Handle<String>& name, | 535 const Operator* LoadDynamicContext(const Handle<String>& name, |
549 uint32_t check_bitset, size_t depth, | 536 uint32_t check_bitset, size_t depth, |
(...skipping 23 matching lines...) Expand all Loading... |
573 Zone* const zone_; | 560 Zone* const zone_; |
574 | 561 |
575 DISALLOW_COPY_AND_ASSIGN(JSOperatorBuilder); | 562 DISALLOW_COPY_AND_ASSIGN(JSOperatorBuilder); |
576 }; | 563 }; |
577 | 564 |
578 } // namespace compiler | 565 } // namespace compiler |
579 } // namespace internal | 566 } // namespace internal |
580 } // namespace v8 | 567 } // namespace v8 |
581 | 568 |
582 #endif // V8_COMPILER_JS_OPERATOR_H_ | 569 #endif // V8_COMPILER_JS_OPERATOR_H_ |
OLD | NEW |