| 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 4570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4581 | 4581 |
| 4582 private: | 4582 private: |
| 4583 const intptr_t token_pos_; | 4583 const intptr_t token_pos_; |
| 4584 | 4584 |
| 4585 DISALLOW_COPY_AND_ASSIGN(CloneContextInstr); | 4585 DISALLOW_COPY_AND_ASSIGN(CloneContextInstr); |
| 4586 }; | 4586 }; |
| 4587 | 4587 |
| 4588 | 4588 |
| 4589 class CheckEitherNonSmiInstr : public TemplateInstruction<2> { | 4589 class CheckEitherNonSmiInstr : public TemplateInstruction<2> { |
| 4590 public: | 4590 public: |
| 4591 CheckEitherNonSmiInstr(Value* left, | 4591 CheckEitherNonSmiInstr(Value* left, Value* right, intptr_t deopt_id) |
| 4592 Value* right, | 4592 : licm_hoisted_(false) { |
| 4593 intptr_t deopt_id) { | |
| 4594 SetInputAt(0, left); | 4593 SetInputAt(0, left); |
| 4595 SetInputAt(1, right); | 4594 SetInputAt(1, right); |
| 4596 // Override generated deopt-id. | 4595 // Override generated deopt-id. |
| 4597 deopt_id_ = deopt_id; | 4596 deopt_id_ = deopt_id; |
| 4598 } | 4597 } |
| 4599 | 4598 |
| 4600 Value* left() const { return inputs_[0]; } | 4599 Value* left() const { return inputs_[0]; } |
| 4601 Value* right() const { return inputs_[1]; } | 4600 Value* right() const { return inputs_[1]; } |
| 4602 | 4601 |
| 4603 DECLARE_INSTRUCTION(CheckEitherNonSmi) | 4602 DECLARE_INSTRUCTION(CheckEitherNonSmi) |
| 4604 | 4603 |
| 4605 virtual intptr_t ArgumentCount() const { return 0; } | 4604 virtual intptr_t ArgumentCount() const { return 0; } |
| 4606 | 4605 |
| 4607 virtual bool CanDeoptimize() const { return true; } | 4606 virtual bool CanDeoptimize() const { return true; } |
| 4608 | 4607 |
| 4609 virtual Instruction* Canonicalize(FlowGraph* flow_graph); | 4608 virtual Instruction* Canonicalize(FlowGraph* flow_graph); |
| 4610 | 4609 |
| 4611 virtual bool AllowsCSE() const { return true; } | 4610 virtual bool AllowsCSE() const { return true; } |
| 4612 virtual EffectSet Effects() const { return EffectSet::None(); } | 4611 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 4613 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 4612 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 4614 virtual bool AttributesEqual(Instruction* other) const { return true; } | 4613 virtual bool AttributesEqual(Instruction* other) const { return true; } |
| 4615 | 4614 |
| 4616 virtual bool MayThrow() const { return false; } | 4615 virtual bool MayThrow() const { return false; } |
| 4617 | 4616 |
| 4617 void set_licm_hoisted(bool value) { licm_hoisted_ = value; } |
| 4618 |
| 4618 private: | 4619 private: |
| 4620 bool licm_hoisted_; |
| 4621 |
| 4619 DISALLOW_COPY_AND_ASSIGN(CheckEitherNonSmiInstr); | 4622 DISALLOW_COPY_AND_ASSIGN(CheckEitherNonSmiInstr); |
| 4620 }; | 4623 }; |
| 4621 | 4624 |
| 4622 | 4625 |
| 4623 class BoxDoubleInstr : public TemplateDefinition<1> { | 4626 class BoxDoubleInstr : public TemplateDefinition<1> { |
| 4624 public: | 4627 public: |
| 4625 explicit BoxDoubleInstr(Value* value) { | 4628 explicit BoxDoubleInstr(Value* value) { |
| 4626 SetInputAt(0, value); | 4629 SetInputAt(0, value); |
| 4627 } | 4630 } |
| 4628 | 4631 |
| (...skipping 3226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7855 bool licm_hoisted_; | 7858 bool licm_hoisted_; |
| 7856 const intptr_t token_pos_; | 7859 const intptr_t token_pos_; |
| 7857 | 7860 |
| 7858 DISALLOW_COPY_AND_ASSIGN(CheckClassInstr); | 7861 DISALLOW_COPY_AND_ASSIGN(CheckClassInstr); |
| 7859 }; | 7862 }; |
| 7860 | 7863 |
| 7861 | 7864 |
| 7862 class CheckSmiInstr : public TemplateInstruction<1> { | 7865 class CheckSmiInstr : public TemplateInstruction<1> { |
| 7863 public: | 7866 public: |
| 7864 CheckSmiInstr(Value* value, intptr_t original_deopt_id, intptr_t token_pos) | 7867 CheckSmiInstr(Value* value, intptr_t original_deopt_id, intptr_t token_pos) |
| 7865 : token_pos_(token_pos) { | 7868 : token_pos_(token_pos), licm_hoisted_(false) { |
| 7866 SetInputAt(0, value); | 7869 SetInputAt(0, value); |
| 7867 deopt_id_ = original_deopt_id; | 7870 deopt_id_ = original_deopt_id; |
| 7868 } | 7871 } |
| 7869 | 7872 |
| 7870 Value* value() const { return inputs_[0]; } | 7873 Value* value() const { return inputs_[0]; } |
| 7871 virtual intptr_t token_pos() const { return token_pos_; } | 7874 virtual intptr_t token_pos() const { return token_pos_; } |
| 7872 | 7875 |
| 7873 DECLARE_INSTRUCTION(CheckSmi) | 7876 DECLARE_INSTRUCTION(CheckSmi) |
| 7874 | 7877 |
| 7875 virtual intptr_t ArgumentCount() const { return 0; } | 7878 virtual intptr_t ArgumentCount() const { return 0; } |
| 7876 | 7879 |
| 7877 virtual bool CanDeoptimize() const { return true; } | 7880 virtual bool CanDeoptimize() const { return true; } |
| 7878 | 7881 |
| 7879 virtual Instruction* Canonicalize(FlowGraph* flow_graph); | 7882 virtual Instruction* Canonicalize(FlowGraph* flow_graph); |
| 7880 | 7883 |
| 7881 virtual bool AllowsCSE() const { return true; } | 7884 virtual bool AllowsCSE() const { return true; } |
| 7882 virtual EffectSet Effects() const { return EffectSet::None(); } | 7885 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 7883 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 7886 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 7884 virtual bool AttributesEqual(Instruction* other) const { return true; } | 7887 virtual bool AttributesEqual(Instruction* other) const { return true; } |
| 7885 | 7888 |
| 7886 virtual bool MayThrow() const { return false; } | 7889 virtual bool MayThrow() const { return false; } |
| 7887 | 7890 |
| 7891 void set_licm_hoisted(bool value) { licm_hoisted_ = value; } |
| 7892 |
| 7888 private: | 7893 private: |
| 7889 const intptr_t token_pos_; | 7894 const intptr_t token_pos_; |
| 7895 bool licm_hoisted_; |
| 7890 | 7896 |
| 7891 DISALLOW_COPY_AND_ASSIGN(CheckSmiInstr); | 7897 DISALLOW_COPY_AND_ASSIGN(CheckSmiInstr); |
| 7892 }; | 7898 }; |
| 7893 | 7899 |
| 7894 | 7900 |
| 7895 class CheckClassIdInstr : public TemplateInstruction<1> { | 7901 class CheckClassIdInstr : public TemplateInstruction<1> { |
| 7896 public: | 7902 public: |
| 7897 CheckClassIdInstr(Value* value, intptr_t cid, intptr_t deopt_id) : cid_(cid) { | 7903 CheckClassIdInstr(Value* value, intptr_t cid, intptr_t deopt_id) : cid_(cid) { |
| 7898 SetInputAt(0, value); | 7904 SetInputAt(0, value); |
| 7899 // Override generated deopt-id. | 7905 // Override generated deopt-id. |
| (...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8440 Isolate* isolate, bool opt) const { \ | 8446 Isolate* isolate, bool opt) const { \ |
| 8441 UNIMPLEMENTED(); \ | 8447 UNIMPLEMENTED(); \ |
| 8442 return NULL; \ | 8448 return NULL; \ |
| 8443 } \ | 8449 } \ |
| 8444 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } | 8450 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } |
| 8445 | 8451 |
| 8446 | 8452 |
| 8447 } // namespace dart | 8453 } // namespace dart |
| 8448 | 8454 |
| 8449 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 8455 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |