| 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 2572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2583 DECLARE_INSTRUCTION(UnboxedConstant) | 2583 DECLARE_INSTRUCTION(UnboxedConstant) |
| 2584 | 2584 |
| 2585 private: | 2585 private: |
| 2586 const Representation representation_; | 2586 const Representation representation_; |
| 2587 uword constant_address_; // Either NULL or points to the untagged constant. | 2587 uword constant_address_; // Either NULL or points to the untagged constant. |
| 2588 | 2588 |
| 2589 DISALLOW_COPY_AND_ASSIGN(UnboxedConstantInstr); | 2589 DISALLOW_COPY_AND_ASSIGN(UnboxedConstantInstr); |
| 2590 }; | 2590 }; |
| 2591 | 2591 |
| 2592 | 2592 |
| 2593 class AssertAssignableInstr : public TemplateDefinition<3, Throws, Pure> { | 2593 class AssertAssignableInstr : public TemplateDefinition<2, Throws, Pure> { |
| 2594 public: | 2594 public: |
| 2595 AssertAssignableInstr(intptr_t token_pos, | 2595 AssertAssignableInstr(intptr_t token_pos, |
| 2596 Value* value, | 2596 Value* value, |
| 2597 Value* instantiator, | |
| 2598 Value* instantiator_type_arguments, | 2597 Value* instantiator_type_arguments, |
| 2599 const AbstractType& dst_type, | 2598 const AbstractType& dst_type, |
| 2600 const String& dst_name, | 2599 const String& dst_name, |
| 2601 intptr_t deopt_id) | 2600 intptr_t deopt_id) |
| 2602 : TemplateDefinition(deopt_id), | 2601 : TemplateDefinition(deopt_id), |
| 2603 token_pos_(token_pos), | 2602 token_pos_(token_pos), |
| 2604 dst_type_(AbstractType::ZoneHandle(dst_type.raw())), | 2603 dst_type_(AbstractType::ZoneHandle(dst_type.raw())), |
| 2605 dst_name_(dst_name) { | 2604 dst_name_(dst_name) { |
| 2606 ASSERT(!dst_type.IsNull()); | 2605 ASSERT(!dst_type.IsNull()); |
| 2607 ASSERT(!dst_name.IsNull()); | 2606 ASSERT(!dst_name.IsNull()); |
| 2608 SetInputAt(0, value); | 2607 SetInputAt(0, value); |
| 2609 SetInputAt(1, instantiator); | 2608 SetInputAt(1, instantiator_type_arguments); |
| 2610 SetInputAt(2, instantiator_type_arguments); | |
| 2611 } | 2609 } |
| 2612 | 2610 |
| 2613 DECLARE_INSTRUCTION(AssertAssignable) | 2611 DECLARE_INSTRUCTION(AssertAssignable) |
| 2614 virtual CompileType ComputeType() const; | 2612 virtual CompileType ComputeType() const; |
| 2615 virtual bool RecomputeType(); | 2613 virtual bool RecomputeType(); |
| 2616 | 2614 |
| 2617 Value* value() const { return inputs_[0]; } | 2615 Value* value() const { return inputs_[0]; } |
| 2618 Value* instantiator() const { return inputs_[1]; } | 2616 Value* instantiator_type_arguments() const { return inputs_[1]; } |
| 2619 Value* instantiator_type_arguments() const { return inputs_[2]; } | |
| 2620 | 2617 |
| 2621 virtual intptr_t token_pos() const { return token_pos_; } | 2618 virtual intptr_t token_pos() const { return token_pos_; } |
| 2622 const AbstractType& dst_type() const { return dst_type_; } | 2619 const AbstractType& dst_type() const { return dst_type_; } |
| 2623 void set_dst_type(const AbstractType& dst_type) { | 2620 void set_dst_type(const AbstractType& dst_type) { |
| 2624 dst_type_ = dst_type.raw(); | 2621 dst_type_ = dst_type.raw(); |
| 2625 } | 2622 } |
| 2626 const String& dst_name() const { return dst_name_; } | 2623 const String& dst_name() const { return dst_name_; } |
| 2627 | 2624 |
| 2628 virtual void PrintOperandsTo(BufferFormatter* f) const; | 2625 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 2629 | 2626 |
| (...skipping 1373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4003 | 4000 |
| 4004 virtual EffectSet Effects() const { return EffectSet::None(); } | 4001 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 4005 | 4002 |
| 4006 virtual Definition* Canonicalize(FlowGraph* flow_graph); | 4003 virtual Definition* Canonicalize(FlowGraph* flow_graph); |
| 4007 | 4004 |
| 4008 private: | 4005 private: |
| 4009 DISALLOW_COPY_AND_ASSIGN(BooleanNegateInstr); | 4006 DISALLOW_COPY_AND_ASSIGN(BooleanNegateInstr); |
| 4010 }; | 4007 }; |
| 4011 | 4008 |
| 4012 | 4009 |
| 4013 class InstanceOfInstr : public TemplateDefinition<3, Throws> { | 4010 class InstanceOfInstr : public TemplateDefinition<2, Throws> { |
| 4014 public: | 4011 public: |
| 4015 InstanceOfInstr(intptr_t token_pos, | 4012 InstanceOfInstr(intptr_t token_pos, |
| 4016 Value* value, | 4013 Value* value, |
| 4017 Value* instantiator, | |
| 4018 Value* instantiator_type_arguments, | 4014 Value* instantiator_type_arguments, |
| 4019 const AbstractType& type, | 4015 const AbstractType& type, |
| 4020 bool negate_result, | 4016 bool negate_result, |
| 4021 intptr_t deopt_id) | 4017 intptr_t deopt_id) |
| 4022 : TemplateDefinition(deopt_id), | 4018 : TemplateDefinition(deopt_id), |
| 4023 token_pos_(token_pos), | 4019 token_pos_(token_pos), |
| 4024 type_(type), | 4020 type_(type), |
| 4025 negate_result_(negate_result) { | 4021 negate_result_(negate_result) { |
| 4026 ASSERT(!type.IsNull()); | 4022 ASSERT(!type.IsNull()); |
| 4027 SetInputAt(0, value); | 4023 SetInputAt(0, value); |
| 4028 SetInputAt(1, instantiator); | 4024 SetInputAt(1, instantiator_type_arguments); |
| 4029 SetInputAt(2, instantiator_type_arguments); | |
| 4030 } | 4025 } |
| 4031 | 4026 |
| 4032 DECLARE_INSTRUCTION(InstanceOf) | 4027 DECLARE_INSTRUCTION(InstanceOf) |
| 4033 virtual CompileType ComputeType() const; | 4028 virtual CompileType ComputeType() const; |
| 4034 | 4029 |
| 4035 Value* value() const { return inputs_[0]; } | 4030 Value* value() const { return inputs_[0]; } |
| 4036 Value* instantiator() const { return inputs_[1]; } | 4031 Value* instantiator_type_arguments() const { return inputs_[1]; } |
| 4037 Value* instantiator_type_arguments() const { return inputs_[2]; } | |
| 4038 | 4032 |
| 4039 bool negate_result() const { return negate_result_; } | 4033 bool negate_result() const { return negate_result_; } |
| 4040 const AbstractType& type() const { return type_; } | 4034 const AbstractType& type() const { return type_; } |
| 4041 virtual intptr_t token_pos() const { return token_pos_; } | 4035 virtual intptr_t token_pos() const { return token_pos_; } |
| 4042 | 4036 |
| 4043 virtual void PrintOperandsTo(BufferFormatter* f) const; | 4037 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 4044 | 4038 |
| 4045 virtual bool CanDeoptimize() const { return true; } | 4039 virtual bool CanDeoptimize() const { return true; } |
| 4046 | 4040 |
| 4047 virtual EffectSet Effects() const { return EffectSet::None(); } | 4041 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 4048 | 4042 |
| 4049 private: | 4043 private: |
| 4050 const intptr_t token_pos_; | 4044 const intptr_t token_pos_; |
| 4051 Value* value_; | 4045 Value* value_; |
| 4052 Value* instantiator_; | |
| 4053 Value* type_arguments_; | 4046 Value* type_arguments_; |
| 4054 const AbstractType& type_; | 4047 const AbstractType& type_; |
| 4055 const bool negate_result_; | 4048 const bool negate_result_; |
| 4056 | 4049 |
| 4057 DISALLOW_COPY_AND_ASSIGN(InstanceOfInstr); | 4050 DISALLOW_COPY_AND_ASSIGN(InstanceOfInstr); |
| 4058 }; | 4051 }; |
| 4059 | 4052 |
| 4060 | 4053 |
| 4061 class AllocateObjectInstr : public TemplateDefinition<0, NoThrow> { | 4054 class AllocateObjectInstr : public TemplateDefinition<0, NoThrow> { |
| 4062 public: | 4055 public: |
| (...skipping 4060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8123 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \ | 8116 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \ |
| 8124 UNIMPLEMENTED(); \ | 8117 UNIMPLEMENTED(); \ |
| 8125 return NULL; \ | 8118 return NULL; \ |
| 8126 } \ | 8119 } \ |
| 8127 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } | 8120 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } |
| 8128 | 8121 |
| 8129 | 8122 |
| 8130 } // namespace dart | 8123 } // namespace dart |
| 8131 | 8124 |
| 8132 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 8125 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |