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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
199 bool operator==(StoreNamedParameters const&, StoreNamedParameters const&); | 199 bool operator==(StoreNamedParameters const&, StoreNamedParameters const&); |
200 bool operator!=(StoreNamedParameters const&, StoreNamedParameters const&); | 200 bool operator!=(StoreNamedParameters const&, StoreNamedParameters const&); |
201 | 201 |
202 size_t hash_value(StoreNamedParameters const&); | 202 size_t hash_value(StoreNamedParameters const&); |
203 | 203 |
204 std::ostream& operator<<(std::ostream&, StoreNamedParameters const&); | 204 std::ostream& operator<<(std::ostream&, StoreNamedParameters const&); |
205 | 205 |
206 const StoreNamedParameters& StoreNamedParametersOf(const Operator* op); | 206 const StoreNamedParameters& StoreNamedParametersOf(const Operator* op); |
207 | 207 |
208 | 208 |
209 // Defines shared information for the closure that should be created. This is | |
210 // used as a parameter by JSCreateClosure operators. | |
211 class CreateClosureParameters final { | |
titzer
2015/04/27 08:38:48
Make me a struct?
| |
212 public: | |
213 CreateClosureParameters(Handle<SharedFunctionInfo> shared_info, | |
214 PretenureFlag pretenure) | |
215 : shared_info_(shared_info), pretenure_(pretenure) {} | |
216 | |
217 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; } | |
218 PretenureFlag pretenure() const { return pretenure_; } | |
219 | |
220 private: | |
221 const Handle<SharedFunctionInfo> shared_info_; | |
222 const PretenureFlag pretenure_; | |
223 }; | |
224 | |
225 bool operator==(CreateClosureParameters const&, CreateClosureParameters const&); | |
226 bool operator!=(CreateClosureParameters const&, CreateClosureParameters const&); | |
227 | |
228 size_t hash_value(CreateClosureParameters const&); | |
229 | |
230 std::ostream& operator<<(std::ostream&, CreateClosureParameters const&); | |
231 | |
232 const CreateClosureParameters& CreateClosureParametersOf(const Operator* op); | |
233 | |
234 | |
209 // Interface for building JavaScript-level operators, e.g. directly from the | 235 // Interface for building JavaScript-level operators, e.g. directly from the |
210 // AST. Most operators have no parameters, thus can be globally shared for all | 236 // AST. Most operators have no parameters, thus can be globally shared for all |
211 // graphs. | 237 // graphs. |
212 class JSOperatorBuilder final : public ZoneObject { | 238 class JSOperatorBuilder final : public ZoneObject { |
213 public: | 239 public: |
214 explicit JSOperatorBuilder(Zone* zone); | 240 explicit JSOperatorBuilder(Zone* zone); |
215 | 241 |
216 const Operator* Equal(); | 242 const Operator* Equal(); |
217 const Operator* NotEqual(); | 243 const Operator* NotEqual(); |
218 const Operator* StrictEqual(); | 244 const Operator* StrictEqual(); |
(...skipping 16 matching lines...) Expand all Loading... | |
235 | 261 |
236 const Operator* UnaryNot(); | 262 const Operator* UnaryNot(); |
237 const Operator* ToBoolean(); | 263 const Operator* ToBoolean(); |
238 const Operator* ToNumber(); | 264 const Operator* ToNumber(); |
239 const Operator* ToString(); | 265 const Operator* ToString(); |
240 const Operator* ToName(); | 266 const Operator* ToName(); |
241 const Operator* ToObject(); | 267 const Operator* ToObject(); |
242 const Operator* Yield(); | 268 const Operator* Yield(); |
243 | 269 |
244 const Operator* Create(); | 270 const Operator* Create(); |
271 const Operator* CreateClosure(Handle<SharedFunctionInfo> shared_info, | |
272 PretenureFlag pretenure); | |
245 | 273 |
246 const Operator* CallFunction(size_t arity, CallFunctionFlags flags); | 274 const Operator* CallFunction(size_t arity, CallFunctionFlags flags); |
247 const Operator* CallRuntime(Runtime::FunctionId id, size_t arity); | 275 const Operator* CallRuntime(Runtime::FunctionId id, size_t arity); |
248 | 276 |
249 const Operator* CallConstruct(int arguments); | 277 const Operator* CallConstruct(int arguments); |
250 | 278 |
251 const Operator* LoadProperty(const VectorSlotPair& feedback); | 279 const Operator* LoadProperty(const VectorSlotPair& feedback); |
252 const Operator* LoadNamed(const Unique<Name>& name, | 280 const Operator* LoadNamed(const Unique<Name>& name, |
253 const VectorSlotPair& feedback, | 281 const VectorSlotPair& feedback, |
254 ContextualMode contextual_mode = NOT_CONTEXTUAL, | 282 ContextualMode contextual_mode = NOT_CONTEXTUAL, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
286 Zone* const zone_; | 314 Zone* const zone_; |
287 | 315 |
288 DISALLOW_COPY_AND_ASSIGN(JSOperatorBuilder); | 316 DISALLOW_COPY_AND_ASSIGN(JSOperatorBuilder); |
289 }; | 317 }; |
290 | 318 |
291 } // namespace compiler | 319 } // namespace compiler |
292 } // namespace internal | 320 } // namespace internal |
293 } // namespace v8 | 321 } // namespace v8 |
294 | 322 |
295 #endif // V8_COMPILER_JS_OPERATOR_H_ | 323 #endif // V8_COMPILER_JS_OPERATOR_H_ |
OLD | NEW |