Chromium Code Reviews| 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 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 658 M(UnarySmiOp) \ | 658 M(UnarySmiOp) \ |
| 659 M(UnaryDoubleOp) \ | 659 M(UnaryDoubleOp) \ |
| 660 M(CheckStackOverflow) \ | 660 M(CheckStackOverflow) \ |
| 661 M(SmiToDouble) \ | 661 M(SmiToDouble) \ |
| 662 M(DoubleToInteger) \ | 662 M(DoubleToInteger) \ |
| 663 M(DoubleToSmi) \ | 663 M(DoubleToSmi) \ |
| 664 M(DoubleToDouble) \ | 664 M(DoubleToDouble) \ |
| 665 M(DoubleToFloat) \ | 665 M(DoubleToFloat) \ |
| 666 M(FloatToDouble) \ | 666 M(FloatToDouble) \ |
| 667 M(CheckClass) \ | 667 M(CheckClass) \ |
| 668 M(CheckClassId) \ | |
| 668 M(CheckSmi) \ | 669 M(CheckSmi) \ |
| 669 M(Constant) \ | 670 M(Constant) \ |
| 670 M(CheckEitherNonSmi) \ | 671 M(CheckEitherNonSmi) \ |
| 671 M(BinaryDoubleOp) \ | 672 M(BinaryDoubleOp) \ |
| 672 M(MathUnary) \ | 673 M(MathUnary) \ |
| 673 M(MathMinMax) \ | 674 M(MathMinMax) \ |
| 674 M(UnboxDouble) \ | 675 M(UnboxDouble) \ |
| 675 M(BoxDouble) \ | 676 M(BoxDouble) \ |
| 676 M(BoxFloat32x4) \ | 677 M(BoxFloat32x4) \ |
| 677 M(UnboxFloat32x4) \ | 678 M(UnboxFloat32x4) \ |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1008 friend class BinaryInt32x4OpInstr; | 1009 friend class BinaryInt32x4OpInstr; |
| 1009 friend class BinaryMintOpInstr; | 1010 friend class BinaryMintOpInstr; |
| 1010 friend class BinarySmiOpInstr; | 1011 friend class BinarySmiOpInstr; |
| 1011 friend class UnarySmiOpInstr; | 1012 friend class UnarySmiOpInstr; |
| 1012 friend class UnaryDoubleOpInstr; | 1013 friend class UnaryDoubleOpInstr; |
| 1013 friend class ShiftMintOpInstr; | 1014 friend class ShiftMintOpInstr; |
| 1014 friend class UnaryMintOpInstr; | 1015 friend class UnaryMintOpInstr; |
| 1015 friend class MathUnaryInstr; | 1016 friend class MathUnaryInstr; |
| 1016 friend class MathMinMaxInstr; | 1017 friend class MathMinMaxInstr; |
| 1017 friend class CheckClassInstr; | 1018 friend class CheckClassInstr; |
| 1019 friend class CheckClassIdInstr; | |
| 1018 friend class GuardFieldInstr; | 1020 friend class GuardFieldInstr; |
| 1019 friend class CheckSmiInstr; | 1021 friend class CheckSmiInstr; |
| 1020 friend class CheckArrayBoundInstr; | 1022 friend class CheckArrayBoundInstr; |
| 1021 friend class CheckEitherNonSmiInstr; | 1023 friend class CheckEitherNonSmiInstr; |
| 1022 friend class LICM; | 1024 friend class LICM; |
| 1023 friend class DoubleToSmiInstr; | 1025 friend class DoubleToSmiInstr; |
| 1024 friend class DoubleToDoubleInstr; | 1026 friend class DoubleToDoubleInstr; |
| 1025 friend class DoubleToFloatInstr; | 1027 friend class DoubleToFloatInstr; |
| 1026 friend class FloatToDoubleInstr; | 1028 friend class FloatToDoubleInstr; |
| 1027 friend class InvokeMathCFunctionInstr; | 1029 friend class InvokeMathCFunctionInstr; |
| (...skipping 5847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6875 DECLARE_INSTRUCTION(CheckClass) | 6877 DECLARE_INSTRUCTION(CheckClass) |
| 6876 | 6878 |
| 6877 virtual intptr_t ArgumentCount() const { return 0; } | 6879 virtual intptr_t ArgumentCount() const { return 0; } |
| 6878 | 6880 |
| 6879 virtual bool CanDeoptimize() const { return true; } | 6881 virtual bool CanDeoptimize() const { return true; } |
| 6880 | 6882 |
| 6881 Value* value() const { return inputs_[0]; } | 6883 Value* value() const { return inputs_[0]; } |
| 6882 | 6884 |
| 6883 const ICData& unary_checks() const { return unary_checks_; } | 6885 const ICData& unary_checks() const { return unary_checks_; } |
| 6884 | 6886 |
| 6887 const GrowableArray<intptr_t>& cids() const { return cids_; } | |
| 6888 | |
| 6885 virtual Instruction* Canonicalize(FlowGraph* flow_graph); | 6889 virtual Instruction* Canonicalize(FlowGraph* flow_graph); |
| 6886 | 6890 |
| 6887 virtual void PrintOperandsTo(BufferFormatter* f) const; | 6891 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 6888 | 6892 |
| 6889 bool IsNullCheck() const; | 6893 bool IsNullCheck() const; |
| 6890 | 6894 |
| 6895 bool IsDenseSwitch() const; | |
| 6896 | |
| 6891 virtual bool AllowsCSE() const { return true; } | 6897 virtual bool AllowsCSE() const { return true; } |
| 6892 virtual EffectSet Effects() const { return EffectSet::None(); } | 6898 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 6893 virtual EffectSet Dependencies() const; | 6899 virtual EffectSet Dependencies() const; |
| 6894 virtual bool AttributesEqual(Instruction* other) const; | 6900 virtual bool AttributesEqual(Instruction* other) const; |
| 6895 | 6901 |
| 6896 virtual bool MayThrow() const { return false; } | 6902 virtual bool MayThrow() const { return false; } |
| 6897 | 6903 |
| 6898 void set_licm_hoisted(bool value) { licm_hoisted_ = value; } | 6904 void set_licm_hoisted(bool value) { licm_hoisted_ = value; } |
| 6899 | 6905 |
| 6900 private: | 6906 private: |
| 6901 const ICData& unary_checks_; | 6907 const ICData& unary_checks_; |
| 6908 GrowableArray<intptr_t> cids_; | |
|
srdjan
2014/03/03 18:23:49
Please add comment that the cids_ are sorted, lowe
Florian Schneider
2014/05/05 15:01:47
Done.
| |
| 6902 bool licm_hoisted_; | 6909 bool licm_hoisted_; |
| 6903 | 6910 |
| 6904 DISALLOW_COPY_AND_ASSIGN(CheckClassInstr); | 6911 DISALLOW_COPY_AND_ASSIGN(CheckClassInstr); |
| 6905 }; | 6912 }; |
| 6906 | 6913 |
| 6907 | 6914 |
| 6908 class CheckSmiInstr : public TemplateInstruction<1> { | 6915 class CheckSmiInstr : public TemplateInstruction<1> { |
| 6909 public: | 6916 public: |
| 6910 CheckSmiInstr(Value* value, intptr_t original_deopt_id) { | 6917 CheckSmiInstr(Value* value, intptr_t original_deopt_id) { |
| 6911 ASSERT(original_deopt_id != Isolate::kNoDeoptId); | 6918 ASSERT(original_deopt_id != Isolate::kNoDeoptId); |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 6928 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 6935 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 6929 virtual bool AttributesEqual(Instruction* other) const { return true; } | 6936 virtual bool AttributesEqual(Instruction* other) const { return true; } |
| 6930 | 6937 |
| 6931 virtual bool MayThrow() const { return false; } | 6938 virtual bool MayThrow() const { return false; } |
| 6932 | 6939 |
| 6933 private: | 6940 private: |
| 6934 DISALLOW_COPY_AND_ASSIGN(CheckSmiInstr); | 6941 DISALLOW_COPY_AND_ASSIGN(CheckSmiInstr); |
| 6935 }; | 6942 }; |
| 6936 | 6943 |
| 6937 | 6944 |
| 6945 class CheckClassIdInstr : public TemplateInstruction<2> { | |
| 6946 public: | |
| 6947 CheckClassIdInstr(Value* left, Value* right, intptr_t deopt_id) { | |
| 6948 SetInputAt(0, left); | |
| 6949 SetInputAt(1, right); | |
| 6950 // Override generated deopt-id. | |
| 6951 deopt_id_ = deopt_id; | |
| 6952 } | |
| 6953 | |
| 6954 Value* left() const { return inputs_[0]; } | |
| 6955 Value* right() const { return inputs_[1]; } | |
| 6956 | |
| 6957 DECLARE_INSTRUCTION(CheckClassId) | |
| 6958 | |
| 6959 virtual intptr_t ArgumentCount() const { return 0; } | |
| 6960 | |
| 6961 virtual bool CanDeoptimize() const { return true; } | |
| 6962 | |
| 6963 virtual bool AllowsCSE() const { return true; } | |
| 6964 virtual EffectSet Effects() const { return EffectSet::None(); } | |
| 6965 virtual EffectSet Dependencies() const { return EffectSet::None(); } | |
| 6966 virtual bool AttributesEqual(Instruction* other) const { return true; } | |
| 6967 | |
| 6968 virtual bool MayThrow() const { return false; } | |
| 6969 | |
| 6970 private: | |
| 6971 DISALLOW_COPY_AND_ASSIGN(CheckClassIdInstr); | |
| 6972 }; | |
| 6973 | |
| 6974 | |
| 6938 class CheckArrayBoundInstr : public TemplateInstruction<2> { | 6975 class CheckArrayBoundInstr : public TemplateInstruction<2> { |
| 6939 public: | 6976 public: |
| 6940 CheckArrayBoundInstr(Value* length, Value* index, intptr_t deopt_id) { | 6977 CheckArrayBoundInstr(Value* length, Value* index, intptr_t deopt_id) { |
| 6941 SetInputAt(kLengthPos, length); | 6978 SetInputAt(kLengthPos, length); |
| 6942 SetInputAt(kIndexPos, index); | 6979 SetInputAt(kIndexPos, index); |
| 6943 // Override generated deopt-id. | 6980 // Override generated deopt-id. |
| 6944 deopt_id_ = deopt_id; | 6981 deopt_id_ = deopt_id; |
| 6945 } | 6982 } |
| 6946 | 6983 |
| 6947 Value* length() const { return inputs_[kLengthPos]; } | 6984 Value* length() const { return inputs_[kLengthPos]; } |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7198 ForwardInstructionIterator* current_iterator_; | 7235 ForwardInstructionIterator* current_iterator_; |
| 7199 | 7236 |
| 7200 private: | 7237 private: |
| 7201 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 7238 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 7202 }; | 7239 }; |
| 7203 | 7240 |
| 7204 | 7241 |
| 7205 } // namespace dart | 7242 } // namespace dart |
| 7206 | 7243 |
| 7207 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 7244 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |