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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 bool operator==(CreateClosureParameters const&, CreateClosureParameters const&); | 396 bool operator==(CreateClosureParameters const&, CreateClosureParameters const&); |
397 bool operator!=(CreateClosureParameters const&, CreateClosureParameters const&); | 397 bool operator!=(CreateClosureParameters const&, CreateClosureParameters const&); |
398 | 398 |
399 size_t hash_value(CreateClosureParameters const&); | 399 size_t hash_value(CreateClosureParameters const&); |
400 | 400 |
401 std::ostream& operator<<(std::ostream&, CreateClosureParameters const&); | 401 std::ostream& operator<<(std::ostream&, CreateClosureParameters const&); |
402 | 402 |
403 const CreateClosureParameters& CreateClosureParametersOf(const Operator* op); | 403 const CreateClosureParameters& CreateClosureParametersOf(const Operator* op); |
404 | 404 |
405 | 405 |
| 406 // Defines shared information for the literal that should be created. This is |
| 407 // used as parameter by JSCreateLiteralArray and JSCreateLiteralObject |
| 408 // operators. |
| 409 class CreateLiteralParameters final { |
| 410 public: |
| 411 CreateLiteralParameters(Handle<FixedArray> constants, int flags, int index) |
| 412 : constants_(constants), flags_(flags), index_(index) {} |
| 413 |
| 414 Handle<FixedArray> constants() const { return constants_; } |
| 415 int flags() const { return flags_; } |
| 416 int index() const { return index_; } |
| 417 |
| 418 private: |
| 419 Handle<FixedArray> const constants_; |
| 420 int const flags_; |
| 421 int const index_; |
| 422 }; |
| 423 |
| 424 bool operator==(CreateLiteralParameters const&, CreateLiteralParameters const&); |
| 425 bool operator!=(CreateLiteralParameters const&, CreateLiteralParameters const&); |
| 426 |
| 427 size_t hash_value(CreateLiteralParameters const&); |
| 428 |
| 429 std::ostream& operator<<(std::ostream&, CreateLiteralParameters const&); |
| 430 |
| 431 const CreateLiteralParameters& CreateLiteralParametersOf(const Operator* op); |
| 432 |
| 433 |
406 // Interface for building JavaScript-level operators, e.g. directly from the | 434 // Interface for building JavaScript-level operators, e.g. directly from the |
407 // AST. Most operators have no parameters, thus can be globally shared for all | 435 // AST. Most operators have no parameters, thus can be globally shared for all |
408 // graphs. | 436 // graphs. |
409 class JSOperatorBuilder final : public ZoneObject { | 437 class JSOperatorBuilder final : public ZoneObject { |
410 public: | 438 public: |
411 explicit JSOperatorBuilder(Zone* zone); | 439 explicit JSOperatorBuilder(Zone* zone); |
412 | 440 |
413 const Operator* Equal(); | 441 const Operator* Equal(); |
414 const Operator* NotEqual(); | 442 const Operator* NotEqual(); |
415 const Operator* StrictEqual(); | 443 const Operator* StrictEqual(); |
(...skipping 21 matching lines...) Expand all Loading... |
437 const Operator* ToName(); | 465 const Operator* ToName(); |
438 const Operator* ToObject(); | 466 const Operator* ToObject(); |
439 const Operator* Yield(); | 467 const Operator* Yield(); |
440 | 468 |
441 const Operator* Create(); | 469 const Operator* Create(); |
442 const Operator* CreateArguments(CreateArgumentsParameters::Type type, | 470 const Operator* CreateArguments(CreateArgumentsParameters::Type type, |
443 int start_index); | 471 int start_index); |
444 const Operator* CreateArray(size_t arity, Handle<AllocationSite> site); | 472 const Operator* CreateArray(size_t arity, Handle<AllocationSite> site); |
445 const Operator* CreateClosure(Handle<SharedFunctionInfo> shared_info, | 473 const Operator* CreateClosure(Handle<SharedFunctionInfo> shared_info, |
446 PretenureFlag pretenure); | 474 PretenureFlag pretenure); |
447 const Operator* CreateLiteralArray(int literal_flags); | 475 const Operator* CreateLiteralArray(Handle<FixedArray> constant_elements, |
448 const Operator* CreateLiteralObject(int literal_flags); | 476 int literal_flags, int literal_index); |
| 477 const Operator* CreateLiteralObject(Handle<FixedArray> constant_properties, |
| 478 int literal_flags, int literal_index); |
449 | 479 |
450 const Operator* CallFunction( | 480 const Operator* CallFunction( |
451 size_t arity, LanguageMode language_mode, | 481 size_t arity, LanguageMode language_mode, |
452 VectorSlotPair const& feedback = VectorSlotPair(), | 482 VectorSlotPair const& feedback = VectorSlotPair(), |
453 ConvertReceiverMode convert_mode = ConvertReceiverMode::kAny, | 483 ConvertReceiverMode convert_mode = ConvertReceiverMode::kAny, |
454 TailCallMode tail_call_mode = TailCallMode::kDisallow); | 484 TailCallMode tail_call_mode = TailCallMode::kDisallow); |
455 const Operator* CallRuntime(Runtime::FunctionId id, size_t arity); | 485 const Operator* CallRuntime(Runtime::FunctionId id, size_t arity); |
456 const Operator* CallConstruct(size_t arity, VectorSlotPair const& feedback); | 486 const Operator* CallConstruct(size_t arity, VectorSlotPair const& feedback); |
457 | 487 |
458 const Operator* ConvertReceiver(ConvertReceiverMode convert_mode); | 488 const Operator* ConvertReceiver(ConvertReceiverMode convert_mode); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 Zone* const zone_; | 543 Zone* const zone_; |
514 | 544 |
515 DISALLOW_COPY_AND_ASSIGN(JSOperatorBuilder); | 545 DISALLOW_COPY_AND_ASSIGN(JSOperatorBuilder); |
516 }; | 546 }; |
517 | 547 |
518 } // namespace compiler | 548 } // namespace compiler |
519 } // namespace internal | 549 } // namespace internal |
520 } // namespace v8 | 550 } // namespace v8 |
521 | 551 |
522 #endif // V8_COMPILER_JS_OPERATOR_H_ | 552 #endif // V8_COMPILER_JS_OPERATOR_H_ |
OLD | NEW |