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/handles.h" | 10 #include "src/handles.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 bool operator==(ConstructParameters const&, ConstructParameters const&); | 81 bool operator==(ConstructParameters const&, ConstructParameters const&); |
82 bool operator!=(ConstructParameters const&, ConstructParameters const&); | 82 bool operator!=(ConstructParameters const&, ConstructParameters const&); |
83 | 83 |
84 size_t hash_value(ConstructParameters const&); | 84 size_t hash_value(ConstructParameters const&); |
85 | 85 |
86 std::ostream& operator<<(std::ostream&, ConstructParameters const&); | 86 std::ostream& operator<<(std::ostream&, ConstructParameters const&); |
87 | 87 |
88 ConstructParameters const& ConstructParametersOf(Operator const*); | 88 ConstructParameters const& ConstructParametersOf(Operator const*); |
89 | 89 |
90 // Defines the arity for a JavaScript constructor call with a spread as the last | 90 // Defines the arity for JavaScript calls with a spread as the last |
91 // parameters. This is used as a parameter by JSConstructWithSpread | 91 // parameter. This is used as a parameter by JSConstructWithSpread and |
92 // operators. | 92 // JSCallWithSpread operators. |
93 class ConstructWithSpreadParameters final { | 93 class SpreadWithArityParameters final { |
94 public: | 94 public: |
95 explicit ConstructWithSpreadParameters(uint32_t arity) : arity_(arity) {} | 95 explicit SpreadWithArityParameters(uint32_t arity) : arity_(arity) {} |
96 | 96 |
97 uint32_t arity() const { return arity_; } | 97 uint32_t arity() const { return arity_; } |
98 | 98 |
99 private: | 99 private: |
100 uint32_t const arity_; | 100 uint32_t const arity_; |
101 }; | 101 }; |
102 | 102 |
103 bool operator==(ConstructWithSpreadParameters const&, | 103 bool operator==(SpreadWithArityParameters const&, |
104 ConstructWithSpreadParameters const&); | 104 SpreadWithArityParameters const&); |
105 bool operator!=(ConstructWithSpreadParameters const&, | 105 bool operator!=(SpreadWithArityParameters const&, |
106 ConstructWithSpreadParameters const&); | 106 SpreadWithArityParameters const&); |
107 | 107 |
108 size_t hash_value(ConstructWithSpreadParameters const&); | 108 size_t hash_value(SpreadWithArityParameters const&); |
109 | 109 |
110 std::ostream& operator<<(std::ostream&, ConstructWithSpreadParameters const&); | 110 std::ostream& operator<<(std::ostream&, SpreadWithArityParameters const&); |
111 | 111 |
112 ConstructWithSpreadParameters const& ConstructWithSpreadParametersOf( | 112 SpreadWithArityParameters const& SpreadWithArityParametersOf(Operator const*); |
113 Operator const*); | |
114 | 113 |
115 // Defines the flags for a JavaScript call forwarding parameters. This | 114 // Defines the flags for a JavaScript call forwarding parameters. This |
116 // is used as parameter by JSCallForwardVarargs operators. | 115 // is used as parameter by JSCallForwardVarargs operators. |
117 class CallForwardVarargsParameters final { | 116 class CallForwardVarargsParameters final { |
118 public: | 117 public: |
119 CallForwardVarargsParameters(uint32_t start_index, | 118 CallForwardVarargsParameters(uint32_t start_index, |
120 TailCallMode tail_call_mode) | 119 TailCallMode tail_call_mode) |
121 : bit_field_(StartIndexField::encode(start_index) | | 120 : bit_field_(StartIndexField::encode(start_index) | |
122 TailCallModeField::encode(tail_call_mode)) {} | 121 TailCallModeField::encode(tail_call_mode)) {} |
123 | 122 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 float const frequency_; | 190 float const frequency_; |
192 VectorSlotPair const feedback_; | 191 VectorSlotPair const feedback_; |
193 }; | 192 }; |
194 | 193 |
195 size_t hash_value(CallParameters const&); | 194 size_t hash_value(CallParameters const&); |
196 | 195 |
197 std::ostream& operator<<(std::ostream&, CallParameters const&); | 196 std::ostream& operator<<(std::ostream&, CallParameters const&); |
198 | 197 |
199 const CallParameters& CallParametersOf(const Operator* op); | 198 const CallParameters& CallParametersOf(const Operator* op); |
200 | 199 |
201 // Defines the arity for a JavaScript constructor call with a spread as the last | |
202 // parameters. This is used as a parameter by JSConstructWithSpread | |
203 // operators. | |
204 class CallWithSpreadParameters final { | |
205 public: | |
206 explicit CallWithSpreadParameters(uint32_t arity) : arity_(arity) {} | |
207 | |
208 uint32_t arity() const { return arity_; } | |
209 | |
210 private: | |
211 uint32_t const arity_; | |
212 }; | |
213 | |
214 bool operator==(CallWithSpreadParameters const&, | |
215 CallWithSpreadParameters const&); | |
216 bool operator!=(CallWithSpreadParameters const&, | |
217 CallWithSpreadParameters const&); | |
218 | |
219 size_t hash_value(CallWithSpreadParameters const&); | |
220 | |
221 std::ostream& operator<<(std::ostream&, CallWithSpreadParameters const&); | |
222 | |
223 CallWithSpreadParameters const& CallWithSpreadParametersOf(Operator const*); | |
224 | 200 |
225 // Defines the arity and the ID for a runtime function call. This is used as a | 201 // Defines the arity and the ID for a runtime function call. This is used as a |
226 // parameter by JSCallRuntime operators. | 202 // parameter by JSCallRuntime operators. |
227 class CallRuntimeParameters final { | 203 class CallRuntimeParameters final { |
228 public: | 204 public: |
229 CallRuntimeParameters(Runtime::FunctionId id, size_t arity) | 205 CallRuntimeParameters(Runtime::FunctionId id, size_t arity) |
230 : id_(id), arity_(arity) {} | 206 : id_(id), arity_(arity) {} |
231 | 207 |
232 Runtime::FunctionId id() const { return id_; } | 208 Runtime::FunctionId id() const { return id_; } |
233 size_t arity() const { return arity_; } | 209 size_t arity() const { return arity_; } |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
716 Zone* const zone_; | 692 Zone* const zone_; |
717 | 693 |
718 DISALLOW_COPY_AND_ASSIGN(JSOperatorBuilder); | 694 DISALLOW_COPY_AND_ASSIGN(JSOperatorBuilder); |
719 }; | 695 }; |
720 | 696 |
721 } // namespace compiler | 697 } // namespace compiler |
722 } // namespace internal | 698 } // namespace internal |
723 } // namespace v8 | 699 } // namespace v8 |
724 | 700 |
725 #endif // V8_COMPILER_JS_OPERATOR_H_ | 701 #endif // V8_COMPILER_JS_OPERATOR_H_ |
OLD | NEW |