| 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/base/compiler-specific.h" | 8 #include "src/base/compiler-specific.h" |
| 9 #include "src/globals.h" | 9 #include "src/globals.h" |
| 10 #include "src/runtime/runtime.h" | 10 #include "src/runtime/runtime.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 73 |
| 74 bool operator==(CallConstructParameters const&, CallConstructParameters const&); | 74 bool operator==(CallConstructParameters const&, CallConstructParameters const&); |
| 75 bool operator!=(CallConstructParameters const&, CallConstructParameters const&); | 75 bool operator!=(CallConstructParameters const&, CallConstructParameters const&); |
| 76 | 76 |
| 77 size_t hash_value(CallConstructParameters const&); | 77 size_t hash_value(CallConstructParameters const&); |
| 78 | 78 |
| 79 std::ostream& operator<<(std::ostream&, CallConstructParameters const&); | 79 std::ostream& operator<<(std::ostream&, CallConstructParameters const&); |
| 80 | 80 |
| 81 CallConstructParameters const& CallConstructParametersOf(Operator const*); | 81 CallConstructParameters const& CallConstructParametersOf(Operator const*); |
| 82 | 82 |
| 83 // Defines the arity for a JavaScript constructor call with a spread as the last |
| 84 // parameters. This is used as a parameter by JSCallConstructWithSpread |
| 85 // operators. |
| 86 class CallConstructWithSpreadParameters final { |
| 87 public: |
| 88 explicit CallConstructWithSpreadParameters(uint32_t arity) : arity_(arity) {} |
| 89 |
| 90 uint32_t arity() const { return arity_; } |
| 91 |
| 92 private: |
| 93 uint32_t const arity_; |
| 94 }; |
| 95 |
| 96 bool operator==(CallConstructWithSpreadParameters const&, |
| 97 CallConstructWithSpreadParameters const&); |
| 98 bool operator!=(CallConstructWithSpreadParameters const&, |
| 99 CallConstructWithSpreadParameters const&); |
| 100 |
| 101 size_t hash_value(CallConstructWithSpreadParameters const&); |
| 102 |
| 103 std::ostream& operator<<(std::ostream&, |
| 104 CallConstructWithSpreadParameters const&); |
| 105 |
| 106 CallConstructWithSpreadParameters const& CallConstructWithSpreadParametersOf( |
| 107 Operator const*); |
| 83 | 108 |
| 84 // Defines the arity and the call flags for a JavaScript function call. This is | 109 // Defines the arity and the call flags for a JavaScript function call. This is |
| 85 // used as a parameter by JSCallFunction operators. | 110 // used as a parameter by JSCallFunction operators. |
| 86 class CallFunctionParameters final { | 111 class CallFunctionParameters final { |
| 87 public: | 112 public: |
| 88 CallFunctionParameters(size_t arity, float frequency, | 113 CallFunctionParameters(size_t arity, float frequency, |
| 89 VectorSlotPair const& feedback, | 114 VectorSlotPair const& feedback, |
| 90 TailCallMode tail_call_mode, | 115 TailCallMode tail_call_mode, |
| 91 ConvertReceiverMode convert_mode) | 116 ConvertReceiverMode convert_mode) |
| 92 : bit_field_(ArityField::encode(arity) | | 117 : bit_field_(ArityField::encode(arity) | |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 const Operator* CallFunction( | 496 const Operator* CallFunction( |
| 472 size_t arity, float frequency = 0.0f, | 497 size_t arity, float frequency = 0.0f, |
| 473 VectorSlotPair const& feedback = VectorSlotPair(), | 498 VectorSlotPair const& feedback = VectorSlotPair(), |
| 474 ConvertReceiverMode convert_mode = ConvertReceiverMode::kAny, | 499 ConvertReceiverMode convert_mode = ConvertReceiverMode::kAny, |
| 475 TailCallMode tail_call_mode = TailCallMode::kDisallow); | 500 TailCallMode tail_call_mode = TailCallMode::kDisallow); |
| 476 const Operator* CallRuntime(Runtime::FunctionId id); | 501 const Operator* CallRuntime(Runtime::FunctionId id); |
| 477 const Operator* CallRuntime(Runtime::FunctionId id, size_t arity); | 502 const Operator* CallRuntime(Runtime::FunctionId id, size_t arity); |
| 478 const Operator* CallRuntime(const Runtime::Function* function, size_t arity); | 503 const Operator* CallRuntime(const Runtime::Function* function, size_t arity); |
| 479 const Operator* CallConstruct(uint32_t arity, float frequency, | 504 const Operator* CallConstruct(uint32_t arity, float frequency, |
| 480 VectorSlotPair const& feedback); | 505 VectorSlotPair const& feedback); |
| 506 const Operator* CallConstructWithSpread(uint32_t arity); |
| 481 | 507 |
| 482 const Operator* ConvertReceiver(ConvertReceiverMode convert_mode); | 508 const Operator* ConvertReceiver(ConvertReceiverMode convert_mode); |
| 483 | 509 |
| 484 const Operator* LoadProperty(VectorSlotPair const& feedback); | 510 const Operator* LoadProperty(VectorSlotPair const& feedback); |
| 485 const Operator* LoadNamed(Handle<Name> name, VectorSlotPair const& feedback); | 511 const Operator* LoadNamed(Handle<Name> name, VectorSlotPair const& feedback); |
| 486 | 512 |
| 487 const Operator* StoreProperty(LanguageMode language_mode, | 513 const Operator* StoreProperty(LanguageMode language_mode, |
| 488 VectorSlotPair const& feedback); | 514 VectorSlotPair const& feedback); |
| 489 const Operator* StoreNamed(LanguageMode language_mode, Handle<Name> name, | 515 const Operator* StoreNamed(LanguageMode language_mode, Handle<Name> name, |
| 490 VectorSlotPair const& feedback); | 516 VectorSlotPair const& feedback); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 Zone* const zone_; | 568 Zone* const zone_; |
| 543 | 569 |
| 544 DISALLOW_COPY_AND_ASSIGN(JSOperatorBuilder); | 570 DISALLOW_COPY_AND_ASSIGN(JSOperatorBuilder); |
| 545 }; | 571 }; |
| 546 | 572 |
| 547 } // namespace compiler | 573 } // namespace compiler |
| 548 } // namespace internal | 574 } // namespace internal |
| 549 } // namespace v8 | 575 } // namespace v8 |
| 550 | 576 |
| 551 #endif // V8_COMPILER_JS_OPERATOR_H_ | 577 #endif // V8_COMPILER_JS_OPERATOR_H_ |
| OLD | NEW |