| 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 3603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3614 const AbstractType& type_; | 3614 const AbstractType& type_; |
| 3615 | 3615 |
| 3616 DISALLOW_COPY_AND_ASSIGN(StoreVMFieldInstr); | 3616 DISALLOW_COPY_AND_ASSIGN(StoreVMFieldInstr); |
| 3617 }; | 3617 }; |
| 3618 | 3618 |
| 3619 | 3619 |
| 3620 class InstantiateTypeArgumentsInstr : public TemplateDefinition<1> { | 3620 class InstantiateTypeArgumentsInstr : public TemplateDefinition<1> { |
| 3621 public: | 3621 public: |
| 3622 InstantiateTypeArgumentsInstr(intptr_t token_pos, | 3622 InstantiateTypeArgumentsInstr(intptr_t token_pos, |
| 3623 const AbstractTypeArguments& type_arguments, | 3623 const AbstractTypeArguments& type_arguments, |
| 3624 const Class& instantiator_class, |
| 3624 Value* instantiator) | 3625 Value* instantiator) |
| 3625 : token_pos_(token_pos), | 3626 : token_pos_(token_pos), |
| 3626 type_arguments_(type_arguments) { | 3627 type_arguments_(type_arguments), |
| 3628 instantiator_class_(instantiator_class) { |
| 3627 ASSERT(type_arguments.IsZoneHandle()); | 3629 ASSERT(type_arguments.IsZoneHandle()); |
| 3628 SetInputAt(0, instantiator); | 3630 SetInputAt(0, instantiator); |
| 3629 } | 3631 } |
| 3630 | 3632 |
| 3631 DECLARE_INSTRUCTION(InstantiateTypeArguments) | 3633 DECLARE_INSTRUCTION(InstantiateTypeArguments) |
| 3632 | 3634 |
| 3633 Value* instantiator() const { return inputs_[0]; } | 3635 Value* instantiator() const { return inputs_[0]; } |
| 3634 const AbstractTypeArguments& type_arguments() const { | 3636 const AbstractTypeArguments& type_arguments() const { |
| 3635 return type_arguments_; | 3637 return type_arguments_; |
| 3636 } | 3638 } |
| 3639 const Class& instantiator_class() const { return instantiator_class_; } |
| 3637 intptr_t token_pos() const { return token_pos_; } | 3640 intptr_t token_pos() const { return token_pos_; } |
| 3638 | 3641 |
| 3639 virtual void PrintOperandsTo(BufferFormatter* f) const; | 3642 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 3640 | 3643 |
| 3641 virtual bool CanDeoptimize() const { return true; } | 3644 virtual bool CanDeoptimize() const { return true; } |
| 3642 | 3645 |
| 3643 virtual bool HasSideEffect() const { return true; } | 3646 virtual bool HasSideEffect() const { return true; } |
| 3644 | 3647 |
| 3645 private: | 3648 private: |
| 3646 const intptr_t token_pos_; | 3649 const intptr_t token_pos_; |
| 3647 const AbstractTypeArguments& type_arguments_; | 3650 const AbstractTypeArguments& type_arguments_; |
| 3651 const Class& instantiator_class_; |
| 3648 | 3652 |
| 3649 DISALLOW_COPY_AND_ASSIGN(InstantiateTypeArgumentsInstr); | 3653 DISALLOW_COPY_AND_ASSIGN(InstantiateTypeArgumentsInstr); |
| 3650 }; | 3654 }; |
| 3651 | 3655 |
| 3652 | 3656 |
| 3653 class ExtractConstructorTypeArgumentsInstr : public TemplateDefinition<1> { | 3657 class ExtractConstructorTypeArgumentsInstr : public TemplateDefinition<1> { |
| 3654 public: | 3658 public: |
| 3655 ExtractConstructorTypeArgumentsInstr( | 3659 ExtractConstructorTypeArgumentsInstr( |
| 3656 intptr_t token_pos, | 3660 intptr_t token_pos, |
| 3657 const AbstractTypeArguments& type_arguments, | 3661 const AbstractTypeArguments& type_arguments, |
| 3662 const Class& instantiator_class, |
| 3658 Value* instantiator) | 3663 Value* instantiator) |
| 3659 : token_pos_(token_pos), | 3664 : token_pos_(token_pos), |
| 3660 type_arguments_(type_arguments) { | 3665 type_arguments_(type_arguments), |
| 3666 instantiator_class_(instantiator_class) { |
| 3661 SetInputAt(0, instantiator); | 3667 SetInputAt(0, instantiator); |
| 3662 } | 3668 } |
| 3663 | 3669 |
| 3664 DECLARE_INSTRUCTION(ExtractConstructorTypeArguments) | 3670 DECLARE_INSTRUCTION(ExtractConstructorTypeArguments) |
| 3665 | 3671 |
| 3666 Value* instantiator() const { return inputs_[0]; } | 3672 Value* instantiator() const { return inputs_[0]; } |
| 3667 const AbstractTypeArguments& type_arguments() const { | 3673 const AbstractTypeArguments& type_arguments() const { |
| 3668 return type_arguments_; | 3674 return type_arguments_; |
| 3669 } | 3675 } |
| 3676 const Class& instantiator_class() const { return instantiator_class_; } |
| 3670 intptr_t token_pos() const { return token_pos_; } | 3677 intptr_t token_pos() const { return token_pos_; } |
| 3671 | 3678 |
| 3672 virtual void PrintOperandsTo(BufferFormatter* f) const; | 3679 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 3673 | 3680 |
| 3674 virtual bool CanDeoptimize() const { return false; } | 3681 virtual bool CanDeoptimize() const { return false; } |
| 3675 | 3682 |
| 3676 virtual bool HasSideEffect() const { return false; } | 3683 virtual bool HasSideEffect() const { return false; } |
| 3677 | 3684 |
| 3678 private: | 3685 private: |
| 3679 const intptr_t token_pos_; | 3686 const intptr_t token_pos_; |
| 3680 const AbstractTypeArguments& type_arguments_; | 3687 const AbstractTypeArguments& type_arguments_; |
| 3688 const Class& instantiator_class_; |
| 3681 | 3689 |
| 3682 DISALLOW_COPY_AND_ASSIGN(ExtractConstructorTypeArgumentsInstr); | 3690 DISALLOW_COPY_AND_ASSIGN(ExtractConstructorTypeArgumentsInstr); |
| 3683 }; | 3691 }; |
| 3684 | 3692 |
| 3685 | 3693 |
| 3686 class ExtractConstructorInstantiatorInstr : public TemplateDefinition<1> { | 3694 class ExtractConstructorInstantiatorInstr : public TemplateDefinition<1> { |
| 3687 public: | 3695 public: |
| 3688 ExtractConstructorInstantiatorInstr(ConstructorCallNode* ast_node, | 3696 ExtractConstructorInstantiatorInstr(ConstructorCallNode* ast_node, |
| 3697 const Class& instantiator_class, |
| 3689 Value* instantiator) | 3698 Value* instantiator) |
| 3690 : ast_node_(*ast_node) { | 3699 : ast_node_(*ast_node), instantiator_class_(instantiator_class) { |
| 3691 SetInputAt(0, instantiator); | 3700 SetInputAt(0, instantiator); |
| 3692 } | 3701 } |
| 3693 | 3702 |
| 3694 DECLARE_INSTRUCTION(ExtractConstructorInstantiator) | 3703 DECLARE_INSTRUCTION(ExtractConstructorInstantiator) |
| 3695 | 3704 |
| 3696 Value* instantiator() const { return inputs_[0]; } | 3705 Value* instantiator() const { return inputs_[0]; } |
| 3697 const AbstractTypeArguments& type_arguments() const { | 3706 const AbstractTypeArguments& type_arguments() const { |
| 3698 return ast_node_.type_arguments(); | 3707 return ast_node_.type_arguments(); |
| 3699 } | 3708 } |
| 3700 const Function& constructor() const { return ast_node_.constructor(); } | 3709 const Function& constructor() const { return ast_node_.constructor(); } |
| 3710 const Class& instantiator_class() const { return instantiator_class_; } |
| 3701 intptr_t token_pos() const { return ast_node_.token_pos(); } | 3711 intptr_t token_pos() const { return ast_node_.token_pos(); } |
| 3702 | 3712 |
| 3703 virtual bool CanDeoptimize() const { return false; } | 3713 virtual bool CanDeoptimize() const { return false; } |
| 3704 | 3714 |
| 3705 virtual bool HasSideEffect() const { return false; } | 3715 virtual bool HasSideEffect() const { return false; } |
| 3706 | 3716 |
| 3707 private: | 3717 private: |
| 3708 const ConstructorCallNode& ast_node_; | 3718 const ConstructorCallNode& ast_node_; |
| 3719 const Class& instantiator_class_; |
| 3709 | 3720 |
| 3710 DISALLOW_COPY_AND_ASSIGN(ExtractConstructorInstantiatorInstr); | 3721 DISALLOW_COPY_AND_ASSIGN(ExtractConstructorInstantiatorInstr); |
| 3711 }; | 3722 }; |
| 3712 | 3723 |
| 3713 | 3724 |
| 3714 class AllocateContextInstr : public TemplateDefinition<0> { | 3725 class AllocateContextInstr : public TemplateDefinition<0> { |
| 3715 public: | 3726 public: |
| 3716 AllocateContextInstr(intptr_t token_pos, | 3727 AllocateContextInstr(intptr_t token_pos, |
| 3717 intptr_t num_context_variables) | 3728 intptr_t num_context_variables) |
| 3718 : token_pos_(token_pos), | 3729 : token_pos_(token_pos), |
| (...skipping 1565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5284 ForwardInstructionIterator* current_iterator_; | 5295 ForwardInstructionIterator* current_iterator_; |
| 5285 | 5296 |
| 5286 private: | 5297 private: |
| 5287 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 5298 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 5288 }; | 5299 }; |
| 5289 | 5300 |
| 5290 | 5301 |
| 5291 } // namespace dart | 5302 } // namespace dart |
| 5292 | 5303 |
| 5293 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 5304 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |