| 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 4622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4633 | 4633 |
| 4634 virtual bool HasSideEffect() const { return false; } | 4634 virtual bool HasSideEffect() const { return false; } |
| 4635 | 4635 |
| 4636 private: | 4636 private: |
| 4637 const intptr_t token_pos_; | 4637 const intptr_t token_pos_; |
| 4638 | 4638 |
| 4639 DISALLOW_COPY_AND_ASSIGN(CheckStackOverflowInstr); | 4639 DISALLOW_COPY_AND_ASSIGN(CheckStackOverflowInstr); |
| 4640 }; | 4640 }; |
| 4641 | 4641 |
| 4642 | 4642 |
| 4643 class SmiToDoubleInstr : public TemplateDefinition<0> { | 4643 class SmiToDoubleInstr : public TemplateDefinition<1> { |
| 4644 public: | 4644 public: |
| 4645 explicit SmiToDoubleInstr(InstanceCallInstr* instance_call) | 4645 explicit SmiToDoubleInstr(Value* value) { |
| 4646 : instance_call_(instance_call) { } | 4646 SetInputAt(0, value); |
| 4647 } |
| 4647 | 4648 |
| 4648 InstanceCallInstr* instance_call() const { return instance_call_; } | 4649 Value* value() const { return inputs_[0]; } |
| 4649 | 4650 |
| 4650 DECLARE_INSTRUCTION(SmiToDouble) | 4651 DECLARE_INSTRUCTION(SmiToDouble) |
| 4651 virtual CompileType ComputeType() const; | 4652 virtual CompileType ComputeType() const; |
| 4652 | 4653 |
| 4654 virtual Representation representation() const { |
| 4655 return kUnboxedDouble; |
| 4656 } |
| 4657 |
| 4653 virtual intptr_t ArgumentCount() const { return 1; } | 4658 virtual intptr_t ArgumentCount() const { return 1; } |
| 4654 | 4659 |
| 4655 virtual bool CanDeoptimize() const { return true; } | 4660 virtual bool CanDeoptimize() const { return false; } |
| 4656 | 4661 |
| 4657 virtual bool HasSideEffect() const { return false; } | 4662 virtual bool HasSideEffect() const { return false; } |
| 4663 virtual bool AffectedBySideEffect() const { return false; } |
| 4664 virtual bool AttributesEqual(Instruction* other) const { return true; } |
| 4658 | 4665 |
| 4659 private: | 4666 private: |
| 4660 InstanceCallInstr* instance_call_; | |
| 4661 | |
| 4662 DISALLOW_COPY_AND_ASSIGN(SmiToDoubleInstr); | 4667 DISALLOW_COPY_AND_ASSIGN(SmiToDoubleInstr); |
| 4663 }; | 4668 }; |
| 4664 | 4669 |
| 4665 | 4670 |
| 4666 class DoubleToIntegerInstr : public TemplateDefinition<1> { | 4671 class DoubleToIntegerInstr : public TemplateDefinition<1> { |
| 4667 public: | 4672 public: |
| 4668 DoubleToIntegerInstr(Value* value, InstanceCallInstr* instance_call) | 4673 DoubleToIntegerInstr(Value* value, InstanceCallInstr* instance_call) |
| 4669 : instance_call_(instance_call) { | 4674 : instance_call_(instance_call) { |
| 4670 SetInputAt(0, value); | 4675 SetInputAt(0, value); |
| 4671 } | 4676 } |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4732 Value* value() const { return inputs_[0]; } | 4737 Value* value() const { return inputs_[0]; } |
| 4733 | 4738 |
| 4734 MethodRecognizer::Kind recognized_kind() const { return recognized_kind_; } | 4739 MethodRecognizer::Kind recognized_kind() const { return recognized_kind_; } |
| 4735 | 4740 |
| 4736 DECLARE_INSTRUCTION(DoubleToDouble) | 4741 DECLARE_INSTRUCTION(DoubleToDouble) |
| 4737 virtual CompileType ComputeType() const; | 4742 virtual CompileType ComputeType() const; |
| 4738 | 4743 |
| 4739 virtual bool CanDeoptimize() const { return false; } | 4744 virtual bool CanDeoptimize() const { return false; } |
| 4740 | 4745 |
| 4741 virtual bool HasSideEffect() const { return false; } | 4746 virtual bool HasSideEffect() const { return false; } |
| 4747 virtual bool AffectedBySideEffect() const { return false; } |
| 4748 virtual bool AttributesEqual(Instruction* other) const { |
| 4749 return other->AsDoubleToDouble()->recognized_kind() == recognized_kind(); |
| 4750 } |
| 4742 | 4751 |
| 4743 virtual Representation representation() const { | 4752 virtual Representation representation() const { |
| 4744 return kUnboxedDouble; | 4753 return kUnboxedDouble; |
| 4745 } | 4754 } |
| 4746 | 4755 |
| 4747 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 4756 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
| 4748 ASSERT(idx == 0); | 4757 ASSERT(idx == 0); |
| 4749 return kUnboxedDouble; | 4758 return kUnboxedDouble; |
| 4750 } | 4759 } |
| 4751 | 4760 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 4770 | 4779 |
| 4771 MethodRecognizer::Kind recognized_kind() const { return recognized_kind_; } | 4780 MethodRecognizer::Kind recognized_kind() const { return recognized_kind_; } |
| 4772 | 4781 |
| 4773 DECLARE_INSTRUCTION(InvokeMathCFunction) | 4782 DECLARE_INSTRUCTION(InvokeMathCFunction) |
| 4774 virtual CompileType ComputeType() const; | 4783 virtual CompileType ComputeType() const; |
| 4775 virtual void PrintOperandsTo(BufferFormatter* f) const; | 4784 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 4776 | 4785 |
| 4777 virtual bool CanDeoptimize() const { return false; } | 4786 virtual bool CanDeoptimize() const { return false; } |
| 4778 | 4787 |
| 4779 virtual bool HasSideEffect() const { return false; } | 4788 virtual bool HasSideEffect() const { return false; } |
| 4789 virtual bool AffectedBySideEffect() const { return false; } |
| 4790 virtual bool AttributesEqual(Instruction* other) const { |
| 4791 return other->AsDoubleToDouble()->recognized_kind() == recognized_kind(); |
| 4792 } |
| 4780 | 4793 |
| 4781 virtual Representation representation() const { | 4794 virtual Representation representation() const { |
| 4782 return kUnboxedDouble; | 4795 return kUnboxedDouble; |
| 4783 } | 4796 } |
| 4784 | 4797 |
| 4785 virtual Representation RequiredInputRepresentation(intptr_t idx) const { | 4798 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
| 4786 ASSERT((0 <= idx) && (idx < InputCount())); | 4799 ASSERT((0 <= idx) && (idx < InputCount())); |
| 4787 return kUnboxedDouble; | 4800 return kUnboxedDouble; |
| 4788 } | 4801 } |
| 4789 | 4802 |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5149 ForwardInstructionIterator* current_iterator_; | 5162 ForwardInstructionIterator* current_iterator_; |
| 5150 | 5163 |
| 5151 private: | 5164 private: |
| 5152 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 5165 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 5153 }; | 5166 }; |
| 5154 | 5167 |
| 5155 | 5168 |
| 5156 } // namespace dart | 5169 } // namespace dart |
| 5157 | 5170 |
| 5158 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 5171 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |