OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ | 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ |
6 #define VM_INTERMEDIATE_LANGUAGE_H_ | 6 #define VM_INTERMEDIATE_LANGUAGE_H_ |
7 | 7 |
8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
9 #include "vm/ast.h" | 9 #include "vm/ast.h" |
10 #include "vm/growable_array.h" | 10 #include "vm/growable_array.h" |
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 M(PolymorphicInstanceCall) \ | 613 M(PolymorphicInstanceCall) \ |
614 M(StaticCall) \ | 614 M(StaticCall) \ |
615 M(LoadLocal) \ | 615 M(LoadLocal) \ |
616 M(PushTemp) \ | 616 M(PushTemp) \ |
617 M(DropTemps) \ | 617 M(DropTemps) \ |
618 M(StoreLocal) \ | 618 M(StoreLocal) \ |
619 M(StrictCompare) \ | 619 M(StrictCompare) \ |
620 M(EqualityCompare) \ | 620 M(EqualityCompare) \ |
621 M(RelationalOp) \ | 621 M(RelationalOp) \ |
622 M(NativeCall) \ | 622 M(NativeCall) \ |
| 623 M(DebugStepCheck) \ |
623 M(LoadIndexed) \ | 624 M(LoadIndexed) \ |
624 M(StoreIndexed) \ | 625 M(StoreIndexed) \ |
625 M(StoreInstanceField) \ | 626 M(StoreInstanceField) \ |
626 M(LoadStaticField) \ | 627 M(LoadStaticField) \ |
627 M(StoreStaticField) \ | 628 M(StoreStaticField) \ |
628 M(BooleanNegate) \ | 629 M(BooleanNegate) \ |
629 M(InstanceOf) \ | 630 M(InstanceOf) \ |
630 M(CreateArray) \ | 631 M(CreateArray) \ |
631 M(CreateClosure) \ | 632 M(CreateClosure) \ |
632 M(AllocateObject) \ | 633 M(AllocateObject) \ |
(...skipping 29 matching lines...) Expand all Loading... |
662 M(UnboxFloat32x4) \ | 663 M(UnboxFloat32x4) \ |
663 M(BoxInt32x4) \ | 664 M(BoxInt32x4) \ |
664 M(UnboxInt32x4) \ | 665 M(UnboxInt32x4) \ |
665 M(UnboxInteger) \ | 666 M(UnboxInteger) \ |
666 M(BoxInteger) \ | 667 M(BoxInteger) \ |
667 M(BinaryMintOp) \ | 668 M(BinaryMintOp) \ |
668 M(ShiftMintOp) \ | 669 M(ShiftMintOp) \ |
669 M(UnaryMintOp) \ | 670 M(UnaryMintOp) \ |
670 M(CheckArrayBound) \ | 671 M(CheckArrayBound) \ |
671 M(Constraint) \ | 672 M(Constraint) \ |
| 673 M(StringToCharCode) \ |
672 M(StringFromCharCode) \ | 674 M(StringFromCharCode) \ |
673 M(StringInterpolate) \ | 675 M(StringInterpolate) \ |
674 M(InvokeMathCFunction) \ | 676 M(InvokeMathCFunction) \ |
675 M(MergedMath) \ | 677 M(MergedMath) \ |
676 M(GuardField) \ | 678 M(GuardField) \ |
677 M(IfThenElse) \ | 679 M(IfThenElse) \ |
678 M(BinaryFloat32x4Op) \ | 680 M(BinaryFloat32x4Op) \ |
679 M(Simd32x4Shuffle) \ | 681 M(Simd32x4Shuffle) \ |
680 M(Simd32x4ShuffleMix) \ | 682 M(Simd32x4ShuffleMix) \ |
681 M(Simd32x4GetSignMask) \ | 683 M(Simd32x4GetSignMask) \ |
(...skipping 2726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3408 return true; | 3410 return true; |
3409 } | 3411 } |
3410 | 3412 |
3411 private: | 3413 private: |
3412 const NativeBodyNode& ast_node_; | 3414 const NativeBodyNode& ast_node_; |
3413 | 3415 |
3414 DISALLOW_COPY_AND_ASSIGN(NativeCallInstr); | 3416 DISALLOW_COPY_AND_ASSIGN(NativeCallInstr); |
3415 }; | 3417 }; |
3416 | 3418 |
3417 | 3419 |
| 3420 class DebugStepCheckInstr : public TemplateInstruction<0> { |
| 3421 public: |
| 3422 explicit DebugStepCheckInstr(intptr_t token_pos) |
| 3423 : token_pos_(token_pos) { |
| 3424 } |
| 3425 |
| 3426 DECLARE_INSTRUCTION(DebugStepCheck) |
| 3427 |
| 3428 intptr_t token_pos() const { return token_pos_; } |
| 3429 virtual bool MayThrow() const { return false; } |
| 3430 virtual bool CanDeoptimize() const { return false; } |
| 3431 virtual EffectSet Effects() const { return EffectSet::All(); } |
| 3432 virtual intptr_t ArgumentCount() const { return 0; } |
| 3433 virtual Instruction* Canonicalize(FlowGraph* flow_graph); |
| 3434 |
| 3435 private: |
| 3436 const intptr_t token_pos_; |
| 3437 |
| 3438 DISALLOW_COPY_AND_ASSIGN(DebugStepCheckInstr); |
| 3439 }; |
| 3440 |
| 3441 |
3418 enum StoreBarrierType { | 3442 enum StoreBarrierType { |
3419 kNoStoreBarrier, | 3443 kNoStoreBarrier, |
3420 kEmitStoreBarrier | 3444 kEmitStoreBarrier |
3421 }; | 3445 }; |
3422 | 3446 |
3423 | 3447 |
3424 class StoreInstanceFieldInstr : public TemplateDefinition<2> { | 3448 class StoreInstanceFieldInstr : public TemplateDefinition<2> { |
3425 public: | 3449 public: |
3426 StoreInstanceFieldInstr(const Field& field, | 3450 StoreInstanceFieldInstr(const Field& field, |
3427 Value* instance, | 3451 Value* instance, |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3690 | 3714 |
3691 virtual bool MayThrow() const { return false; } | 3715 virtual bool MayThrow() const { return false; } |
3692 | 3716 |
3693 private: | 3717 private: |
3694 const intptr_t cid_; | 3718 const intptr_t cid_; |
3695 | 3719 |
3696 DISALLOW_COPY_AND_ASSIGN(StringFromCharCodeInstr); | 3720 DISALLOW_COPY_AND_ASSIGN(StringFromCharCodeInstr); |
3697 }; | 3721 }; |
3698 | 3722 |
3699 | 3723 |
| 3724 class StringToCharCodeInstr : public TemplateDefinition<1> { |
| 3725 public: |
| 3726 StringToCharCodeInstr(Value* str, intptr_t cid) : cid_(cid) { |
| 3727 ASSERT(str != NULL); |
| 3728 SetInputAt(0, str); |
| 3729 } |
| 3730 |
| 3731 DECLARE_INSTRUCTION(StringToCharCode) |
| 3732 virtual CompileType ComputeType() const; |
| 3733 |
| 3734 Value* str() const { return inputs_[0]; } |
| 3735 |
| 3736 virtual bool CanDeoptimize() const { return false; } |
| 3737 |
| 3738 virtual bool AllowsCSE() const { return true; } |
| 3739 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 3740 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 3741 virtual bool AttributesEqual(Instruction* other) const { |
| 3742 return other->AsStringToCharCode()->cid_ == cid_; |
| 3743 } |
| 3744 |
| 3745 virtual bool MayThrow() const { return false; } |
| 3746 |
| 3747 private: |
| 3748 const intptr_t cid_; |
| 3749 |
| 3750 DISALLOW_COPY_AND_ASSIGN(StringToCharCodeInstr); |
| 3751 }; |
| 3752 |
| 3753 |
3700 class StringInterpolateInstr : public TemplateDefinition<1> { | 3754 class StringInterpolateInstr : public TemplateDefinition<1> { |
3701 public: | 3755 public: |
3702 StringInterpolateInstr(Value* value, intptr_t token_pos) | 3756 StringInterpolateInstr(Value* value, intptr_t token_pos) |
3703 : token_pos_(token_pos), function_(Function::Handle()) { | 3757 : token_pos_(token_pos), function_(Function::Handle()) { |
3704 SetInputAt(0, value); | 3758 SetInputAt(0, value); |
3705 } | 3759 } |
3706 | 3760 |
3707 Value* value() const { return inputs_[0]; } | 3761 Value* value() const { return inputs_[0]; } |
3708 intptr_t token_pos() const { return token_pos_; } | 3762 intptr_t token_pos() const { return token_pos_; } |
3709 | 3763 |
(...skipping 3344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7054 ForwardInstructionIterator* current_iterator_; | 7108 ForwardInstructionIterator* current_iterator_; |
7055 | 7109 |
7056 private: | 7110 private: |
7057 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 7111 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
7058 }; | 7112 }; |
7059 | 7113 |
7060 | 7114 |
7061 } // namespace dart | 7115 } // namespace dart |
7062 | 7116 |
7063 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 7117 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
OLD | NEW |