Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: runtime/vm/intermediate_language.h

Issue 181183004: VM: Improve receiver class check in polymorphic inlining. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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) \
727 M(CheckSmi) \ 728 M(CheckSmi) \
728 M(Constant) \ 729 M(Constant) \
729 M(UnboxedConstant) \ 730 M(UnboxedConstant) \
730 M(CheckEitherNonSmi) \ 731 M(CheckEitherNonSmi) \
731 M(BinaryDoubleOp) \ 732 M(BinaryDoubleOp) \
732 M(MathUnary) \ 733 M(MathUnary) \
733 M(MathMinMax) \ 734 M(MathMinMax) \
734 M(UnboxDouble) \ 735 M(UnboxDouble) \
735 M(BoxDouble) \ 736 M(BoxDouble) \
736 M(BoxFloat32x4) \ 737 M(BoxFloat32x4) \
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
1097 friend class BinaryFloat64x2OpInstr; 1098 friend class BinaryFloat64x2OpInstr;
1098 friend class BinaryMintOpInstr; 1099 friend class BinaryMintOpInstr;
1099 friend class BinarySmiOpInstr; 1100 friend class BinarySmiOpInstr;
1100 friend class UnarySmiOpInstr; 1101 friend class UnarySmiOpInstr;
1101 friend class UnaryDoubleOpInstr; 1102 friend class UnaryDoubleOpInstr;
1102 friend class ShiftMintOpInstr; 1103 friend class ShiftMintOpInstr;
1103 friend class UnaryMintOpInstr; 1104 friend class UnaryMintOpInstr;
1104 friend class MathUnaryInstr; 1105 friend class MathUnaryInstr;
1105 friend class MathMinMaxInstr; 1106 friend class MathMinMaxInstr;
1106 friend class CheckClassInstr; 1107 friend class CheckClassInstr;
1108 friend class CheckClassIdInstr;
1107 friend class GuardFieldInstr; 1109 friend class GuardFieldInstr;
1108 friend class CheckSmiInstr; 1110 friend class CheckSmiInstr;
1109 friend class CheckArrayBoundInstr; 1111 friend class CheckArrayBoundInstr;
1110 friend class CheckEitherNonSmiInstr; 1112 friend class CheckEitherNonSmiInstr;
1111 friend class LICM; 1113 friend class LICM;
1112 friend class DoubleToSmiInstr; 1114 friend class DoubleToSmiInstr;
1113 friend class DoubleToDoubleInstr; 1115 friend class DoubleToDoubleInstr;
1114 friend class DoubleToFloatInstr; 1116 friend class DoubleToFloatInstr;
1115 friend class FloatToDoubleInstr; 1117 friend class FloatToDoubleInstr;
1116 friend class InvokeMathCFunctionInstr; 1118 friend class InvokeMathCFunctionInstr;
(...skipping 6769 matching lines...) Expand 10 before | Expand all | Expand 10 after
7886 virtual intptr_t ArgumentCount() const { return 0; } 7888 virtual intptr_t ArgumentCount() const { return 0; }
7887 7889
7888 virtual bool CanDeoptimize() const { return true; } 7890 virtual bool CanDeoptimize() const { return true; }
7889 7891
7890 virtual intptr_t token_pos() const { return token_pos_; } 7892 virtual intptr_t token_pos() const { return token_pos_; }
7891 7893
7892 Value* value() const { return inputs_[0]; } 7894 Value* value() const { return inputs_[0]; }
7893 7895
7894 const ICData& unary_checks() const { return unary_checks_; } 7896 const ICData& unary_checks() const { return unary_checks_; }
7895 7897
7898 const GrowableArray<intptr_t>& cids() const { return cids_; }
7899
7896 virtual Instruction* Canonicalize(FlowGraph* flow_graph); 7900 virtual Instruction* Canonicalize(FlowGraph* flow_graph);
7897 7901
7898 virtual void PrintOperandsTo(BufferFormatter* f) const; 7902 virtual void PrintOperandsTo(BufferFormatter* f) const;
7899 7903
7900 bool IsNullCheck() const; 7904 bool IsNullCheck() const;
7901 7905
7906 bool IsDenseSwitch() const;
7907 intptr_t ComputeCidMask() const;
7908 static bool IsDenseMask(intptr_t mask);
7909
7902 virtual bool AllowsCSE() const { return true; } 7910 virtual bool AllowsCSE() const { return true; }
7903 virtual EffectSet Effects() const { return EffectSet::None(); } 7911 virtual EffectSet Effects() const { return EffectSet::None(); }
7904 virtual EffectSet Dependencies() const; 7912 virtual EffectSet Dependencies() const;
7905 virtual bool AttributesEqual(Instruction* other) const; 7913 virtual bool AttributesEqual(Instruction* other) const;
7906 7914
7907 virtual bool MayThrow() const { return false; } 7915 virtual bool MayThrow() const { return false; }
7908 7916
7909 void set_licm_hoisted(bool value) { licm_hoisted_ = value; } 7917 void set_licm_hoisted(bool value) { licm_hoisted_ = value; }
7910 7918
7911 private: 7919 private:
7912 const ICData& unary_checks_; 7920 const ICData& unary_checks_;
7921 GrowableArray<intptr_t> cids_; // Sorted, lowest first.
7913 bool licm_hoisted_; 7922 bool licm_hoisted_;
7914 const intptr_t token_pos_; 7923 const intptr_t token_pos_;
7915 7924
7916 DISALLOW_COPY_AND_ASSIGN(CheckClassInstr); 7925 DISALLOW_COPY_AND_ASSIGN(CheckClassInstr);
7917 }; 7926 };
7918 7927
7919 7928
7920 class CheckSmiInstr : public TemplateInstruction<1> { 7929 class CheckSmiInstr : public TemplateInstruction<1> {
7921 public: 7930 public:
7922 CheckSmiInstr(Value* value, intptr_t original_deopt_id, intptr_t token_pos) 7931 CheckSmiInstr(Value* value, intptr_t original_deopt_id, intptr_t token_pos)
(...skipping 21 matching lines...) Expand all
7944 7953
7945 virtual bool MayThrow() const { return false; } 7954 virtual bool MayThrow() const { return false; }
7946 7955
7947 private: 7956 private:
7948 const intptr_t token_pos_; 7957 const intptr_t token_pos_;
7949 7958
7950 DISALLOW_COPY_AND_ASSIGN(CheckSmiInstr); 7959 DISALLOW_COPY_AND_ASSIGN(CheckSmiInstr);
7951 }; 7960 };
7952 7961
7953 7962
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
7954 class CheckArrayBoundInstr : public TemplateInstruction<2> { 7993 class CheckArrayBoundInstr : public TemplateInstruction<2> {
7955 public: 7994 public:
7956 CheckArrayBoundInstr(Value* length, Value* index, intptr_t deopt_id) { 7995 CheckArrayBoundInstr(Value* length, Value* index, intptr_t deopt_id) {
7957 SetInputAt(kLengthPos, length); 7996 SetInputAt(kLengthPos, length);
7958 SetInputAt(kIndexPos, index); 7997 SetInputAt(kIndexPos, index);
7959 // Override generated deopt-id. 7998 // Override generated deopt-id.
7960 deopt_id_ = deopt_id; 7999 deopt_id_ = deopt_id;
7961 } 8000 }
7962 8001
7963 Value* length() const { return inputs_[kLengthPos]; } 8002 Value* length() const { return inputs_[kLengthPos]; }
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
8219 ForwardInstructionIterator* current_iterator_; 8258 ForwardInstructionIterator* current_iterator_;
8220 8259
8221 private: 8260 private:
8222 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 8261 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
8223 }; 8262 };
8224 8263
8225 8264
8226 } // namespace dart 8265 } // namespace dart
8227 8266
8228 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 8267 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698