| 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 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 M(UnarySmiOp) \ | 717 M(UnarySmiOp) \ |
| 718 M(UnaryDoubleOp) \ | 718 M(UnaryDoubleOp) \ |
| 719 M(CheckStackOverflow) \ | 719 M(CheckStackOverflow) \ |
| 720 M(SmiToDouble) \ | 720 M(SmiToDouble) \ |
| 721 M(DoubleToInteger) \ | 721 M(DoubleToInteger) \ |
| 722 M(DoubleToSmi) \ | 722 M(DoubleToSmi) \ |
| 723 M(DoubleToDouble) \ | 723 M(DoubleToDouble) \ |
| 724 M(DoubleToFloat) \ | 724 M(DoubleToFloat) \ |
| 725 M(FloatToDouble) \ | 725 M(FloatToDouble) \ |
| 726 M(CheckClass) \ | 726 M(CheckClass) \ |
| 727 M(CheckClassId) \ | |
| 728 M(CheckSmi) \ | 727 M(CheckSmi) \ |
| 729 M(Constant) \ | 728 M(Constant) \ |
| 730 M(UnboxedConstant) \ | 729 M(UnboxedConstant) \ |
| 731 M(CheckEitherNonSmi) \ | 730 M(CheckEitherNonSmi) \ |
| 732 M(BinaryDoubleOp) \ | 731 M(BinaryDoubleOp) \ |
| 733 M(MathUnary) \ | 732 M(MathUnary) \ |
| 734 M(MathMinMax) \ | 733 M(MathMinMax) \ |
| 735 M(UnboxDouble) \ | 734 M(UnboxDouble) \ |
| 736 M(BoxDouble) \ | 735 M(BoxDouble) \ |
| 737 M(BoxFloat32x4) \ | 736 M(BoxFloat32x4) \ |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1098 friend class BinaryFloat64x2OpInstr; | 1097 friend class BinaryFloat64x2OpInstr; |
| 1099 friend class BinaryMintOpInstr; | 1098 friend class BinaryMintOpInstr; |
| 1100 friend class BinarySmiOpInstr; | 1099 friend class BinarySmiOpInstr; |
| 1101 friend class UnarySmiOpInstr; | 1100 friend class UnarySmiOpInstr; |
| 1102 friend class UnaryDoubleOpInstr; | 1101 friend class UnaryDoubleOpInstr; |
| 1103 friend class ShiftMintOpInstr; | 1102 friend class ShiftMintOpInstr; |
| 1104 friend class UnaryMintOpInstr; | 1103 friend class UnaryMintOpInstr; |
| 1105 friend class MathUnaryInstr; | 1104 friend class MathUnaryInstr; |
| 1106 friend class MathMinMaxInstr; | 1105 friend class MathMinMaxInstr; |
| 1107 friend class CheckClassInstr; | 1106 friend class CheckClassInstr; |
| 1108 friend class CheckClassIdInstr; | |
| 1109 friend class GuardFieldInstr; | 1107 friend class GuardFieldInstr; |
| 1110 friend class CheckSmiInstr; | 1108 friend class CheckSmiInstr; |
| 1111 friend class CheckArrayBoundInstr; | 1109 friend class CheckArrayBoundInstr; |
| 1112 friend class CheckEitherNonSmiInstr; | 1110 friend class CheckEitherNonSmiInstr; |
| 1113 friend class LICM; | 1111 friend class LICM; |
| 1114 friend class DoubleToSmiInstr; | 1112 friend class DoubleToSmiInstr; |
| 1115 friend class DoubleToDoubleInstr; | 1113 friend class DoubleToDoubleInstr; |
| 1116 friend class DoubleToFloatInstr; | 1114 friend class DoubleToFloatInstr; |
| 1117 friend class FloatToDoubleInstr; | 1115 friend class FloatToDoubleInstr; |
| 1118 friend class InvokeMathCFunctionInstr; | 1116 friend class InvokeMathCFunctionInstr; |
| (...skipping 6769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7888 virtual intptr_t ArgumentCount() const { return 0; } | 7886 virtual intptr_t ArgumentCount() const { return 0; } |
| 7889 | 7887 |
| 7890 virtual bool CanDeoptimize() const { return true; } | 7888 virtual bool CanDeoptimize() const { return true; } |
| 7891 | 7889 |
| 7892 virtual intptr_t token_pos() const { return token_pos_; } | 7890 virtual intptr_t token_pos() const { return token_pos_; } |
| 7893 | 7891 |
| 7894 Value* value() const { return inputs_[0]; } | 7892 Value* value() const { return inputs_[0]; } |
| 7895 | 7893 |
| 7896 const ICData& unary_checks() const { return unary_checks_; } | 7894 const ICData& unary_checks() const { return unary_checks_; } |
| 7897 | 7895 |
| 7898 const GrowableArray<intptr_t>& cids() const { return cids_; } | |
| 7899 | |
| 7900 virtual Instruction* Canonicalize(FlowGraph* flow_graph); | 7896 virtual Instruction* Canonicalize(FlowGraph* flow_graph); |
| 7901 | 7897 |
| 7902 virtual void PrintOperandsTo(BufferFormatter* f) const; | 7898 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 7903 | 7899 |
| 7904 bool IsNullCheck() const; | 7900 bool IsNullCheck() const; |
| 7905 | 7901 |
| 7906 bool IsDenseSwitch() const; | |
| 7907 intptr_t ComputeCidMask() const; | |
| 7908 static bool IsDenseMask(intptr_t mask); | |
| 7909 | |
| 7910 virtual bool AllowsCSE() const { return true; } | 7902 virtual bool AllowsCSE() const { return true; } |
| 7911 virtual EffectSet Effects() const { return EffectSet::None(); } | 7903 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 7912 virtual EffectSet Dependencies() const; | 7904 virtual EffectSet Dependencies() const; |
| 7913 virtual bool AttributesEqual(Instruction* other) const; | 7905 virtual bool AttributesEqual(Instruction* other) const; |
| 7914 | 7906 |
| 7915 virtual bool MayThrow() const { return false; } | 7907 virtual bool MayThrow() const { return false; } |
| 7916 | 7908 |
| 7917 void set_licm_hoisted(bool value) { licm_hoisted_ = value; } | 7909 void set_licm_hoisted(bool value) { licm_hoisted_ = value; } |
| 7918 | 7910 |
| 7919 private: | 7911 private: |
| 7920 const ICData& unary_checks_; | 7912 const ICData& unary_checks_; |
| 7921 GrowableArray<intptr_t> cids_; // Sorted, lowest first. | |
| 7922 bool licm_hoisted_; | 7913 bool licm_hoisted_; |
| 7923 const intptr_t token_pos_; | 7914 const intptr_t token_pos_; |
| 7924 | 7915 |
| 7925 DISALLOW_COPY_AND_ASSIGN(CheckClassInstr); | 7916 DISALLOW_COPY_AND_ASSIGN(CheckClassInstr); |
| 7926 }; | 7917 }; |
| 7927 | 7918 |
| 7928 | 7919 |
| 7929 class CheckSmiInstr : public TemplateInstruction<1> { | 7920 class CheckSmiInstr : public TemplateInstruction<1> { |
| 7930 public: | 7921 public: |
| 7931 CheckSmiInstr(Value* value, intptr_t original_deopt_id, intptr_t token_pos) | 7922 CheckSmiInstr(Value* value, intptr_t original_deopt_id, intptr_t token_pos) |
| (...skipping 21 matching lines...) Expand all Loading... |
| 7953 | 7944 |
| 7954 virtual bool MayThrow() const { return false; } | 7945 virtual bool MayThrow() const { return false; } |
| 7955 | 7946 |
| 7956 private: | 7947 private: |
| 7957 const intptr_t token_pos_; | 7948 const intptr_t token_pos_; |
| 7958 | 7949 |
| 7959 DISALLOW_COPY_AND_ASSIGN(CheckSmiInstr); | 7950 DISALLOW_COPY_AND_ASSIGN(CheckSmiInstr); |
| 7960 }; | 7951 }; |
| 7961 | 7952 |
| 7962 | 7953 |
| 7963 class CheckClassIdInstr : public TemplateInstruction<2> { | |
| 7964 public: | |
| 7965 CheckClassIdInstr(Value* left, Value* right, intptr_t deopt_id) { | |
| 7966 SetInputAt(0, left); | |
| 7967 SetInputAt(1, right); | |
| 7968 // Override generated deopt-id. | |
| 7969 deopt_id_ = deopt_id; | |
| 7970 } | |
| 7971 | |
| 7972 Value* left() const { return inputs_[0]; } | |
| 7973 Value* right() const { return inputs_[1]; } | |
| 7974 | |
| 7975 DECLARE_INSTRUCTION(CheckClassId) | |
| 7976 | |
| 7977 virtual intptr_t ArgumentCount() const { return 0; } | |
| 7978 | |
| 7979 virtual bool CanDeoptimize() const { return true; } | |
| 7980 | |
| 7981 virtual bool AllowsCSE() const { return false; } | |
| 7982 virtual EffectSet Effects() const { return EffectSet::None(); } | |
| 7983 virtual EffectSet Dependencies() const { return EffectSet::None(); } | |
| 7984 virtual bool AttributesEqual(Instruction* other) const { return true; } | |
| 7985 | |
| 7986 virtual bool MayThrow() const { return false; } | |
| 7987 | |
| 7988 private: | |
| 7989 DISALLOW_COPY_AND_ASSIGN(CheckClassIdInstr); | |
| 7990 }; | |
| 7991 | |
| 7992 | |
| 7993 class CheckArrayBoundInstr : public TemplateInstruction<2> { | 7954 class CheckArrayBoundInstr : public TemplateInstruction<2> { |
| 7994 public: | 7955 public: |
| 7995 CheckArrayBoundInstr(Value* length, Value* index, intptr_t deopt_id) { | 7956 CheckArrayBoundInstr(Value* length, Value* index, intptr_t deopt_id) { |
| 7996 SetInputAt(kLengthPos, length); | 7957 SetInputAt(kLengthPos, length); |
| 7997 SetInputAt(kIndexPos, index); | 7958 SetInputAt(kIndexPos, index); |
| 7998 // Override generated deopt-id. | 7959 // Override generated deopt-id. |
| 7999 deopt_id_ = deopt_id; | 7960 deopt_id_ = deopt_id; |
| 8000 } | 7961 } |
| 8001 | 7962 |
| 8002 Value* length() const { return inputs_[kLengthPos]; } | 7963 Value* length() const { return inputs_[kLengthPos]; } |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8258 ForwardInstructionIterator* current_iterator_; | 8219 ForwardInstructionIterator* current_iterator_; |
| 8259 | 8220 |
| 8260 private: | 8221 private: |
| 8261 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 8222 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 8262 }; | 8223 }; |
| 8263 | 8224 |
| 8264 | 8225 |
| 8265 } // namespace dart | 8226 } // namespace dart |
| 8266 | 8227 |
| 8267 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 8228 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |