OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
112 V(FastLiteral) \ | 112 V(FastLiteral) \ |
113 V(FixedArrayBaseLength) \ | 113 V(FixedArrayBaseLength) \ |
114 V(ForceRepresentation) \ | 114 V(ForceRepresentation) \ |
115 V(FunctionLiteral) \ | 115 V(FunctionLiteral) \ |
116 V(GetCachedArrayIndex) \ | 116 V(GetCachedArrayIndex) \ |
117 V(GlobalObject) \ | 117 V(GlobalObject) \ |
118 V(GlobalReceiver) \ | 118 V(GlobalReceiver) \ |
119 V(Goto) \ | 119 V(Goto) \ |
120 V(HasCachedArrayIndexAndBranch) \ | 120 V(HasCachedArrayIndexAndBranch) \ |
121 V(HasInstanceTypeAndBranch) \ | 121 V(HasInstanceTypeAndBranch) \ |
122 V(InductionVariable) \ | |
122 V(In) \ | 123 V(In) \ |
123 V(InstanceOf) \ | 124 V(InstanceOf) \ |
124 V(InstanceOfKnownGlobal) \ | 125 V(InstanceOfKnownGlobal) \ |
125 V(InvokeFunction) \ | 126 V(InvokeFunction) \ |
126 V(IsConstructCallAndBranch) \ | 127 V(IsConstructCallAndBranch) \ |
127 V(IsNilAndBranch) \ | 128 V(IsNilAndBranch) \ |
128 V(IsObjectAndBranch) \ | 129 V(IsObjectAndBranch) \ |
129 V(IsStringAndBranch) \ | 130 V(IsStringAndBranch) \ |
130 V(IsSmiAndBranch) \ | 131 V(IsSmiAndBranch) \ |
131 V(IsUndetectableAndBranch) \ | 132 V(IsUndetectableAndBranch) \ |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
697 kIsArguments, | 698 kIsArguments, |
698 kTruncatingToInt32, | 699 kTruncatingToInt32, |
699 kIsDead, | 700 kIsDead, |
700 // Instructions that are allowed to produce full range unsigned integer | 701 // Instructions that are allowed to produce full range unsigned integer |
701 // values are marked with kUint32 flag. If arithmetic shift or a load from | 702 // values are marked with kUint32 flag. If arithmetic shift or a load from |
702 // EXTERNAL_UNSIGNED_INT_ELEMENTS array is not marked with this flag | 703 // EXTERNAL_UNSIGNED_INT_ELEMENTS array is not marked with this flag |
703 // it will deoptimize if result does not fit into signed integer range. | 704 // it will deoptimize if result does not fit into signed integer range. |
704 // HGraph::ComputeSafeUint32Operations is responsible for setting this | 705 // HGraph::ComputeSafeUint32Operations is responsible for setting this |
705 // flag. | 706 // flag. |
706 kUint32, | 707 kUint32, |
708 // If a phi is involved in the evaluation of a numeric constraints the | |
Jakob Kummerow
2013/02/20 10:46:47
"a numeric constraints" -> singular or plural?
Massi
2013/02/21 07:40:32
Done.
| |
709 // recursion can cause an endless cycle: we use this flag to exit the loop. | |
710 kNumericConstraintEvaluationInProgress, | |
707 // This flag is set to true after the SetupInformativeDefinitions() pass | 711 // This flag is set to true after the SetupInformativeDefinitions() pass |
708 // has processed this instruction. | 712 // has processed this instruction. |
709 kIDefsProcessingDone, | 713 kIDefsProcessingDone, |
710 kLastFlag = kIDefsProcessingDone | 714 kLastFlag = kIDefsProcessingDone |
711 }; | 715 }; |
712 | 716 |
713 STATIC_ASSERT(kLastFlag < kBitsPerInt); | 717 STATIC_ASSERT(kLastFlag < kBitsPerInt); |
714 | 718 |
715 static const int kChangesToDependsFlagsLeftShift = 1; | 719 static const int kChangesToDependsFlagsLeftShift = 1; |
716 | 720 |
(...skipping 2224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2941 } | 2945 } |
2942 return true; | 2946 return true; |
2943 } | 2947 } |
2944 | 2948 |
2945 protected: | 2949 protected: |
2946 virtual void DeleteFromGraph(); | 2950 virtual void DeleteFromGraph(); |
2947 virtual void InternalSetOperandAt(int index, HValue* value) { | 2951 virtual void InternalSetOperandAt(int index, HValue* value) { |
2948 inputs_[index] = value; | 2952 inputs_[index] = value; |
2949 } | 2953 } |
2950 | 2954 |
2955 virtual bool IsRelationTrueInternal(NumericRelation relation, HValue* other); | |
2956 | |
2951 private: | 2957 private: |
2952 ZoneList<HValue*> inputs_; | 2958 ZoneList<HValue*> inputs_; |
2953 int merged_index_; | 2959 int merged_index_; |
2954 | 2960 |
2955 int non_phi_uses_[Representation::kNumRepresentations]; | 2961 int non_phi_uses_[Representation::kNumRepresentations]; |
2956 int indirect_uses_[Representation::kNumRepresentations]; | 2962 int indirect_uses_[Representation::kNumRepresentations]; |
2957 int phi_id_; | 2963 int phi_id_; |
2958 bool is_live_; | 2964 bool is_live_; |
2959 bool is_convertible_to_integer_; | 2965 bool is_convertible_to_integer_; |
2960 }; | 2966 }; |
2961 | 2967 |
2962 | 2968 |
2969 class HInductionVariable : public HUnaryOperation { | |
Jakob Kummerow
2013/02/20 10:46:47
The name is misleading, as this instruction *isn't
Massi
2013/02/21 07:40:32
Done.
| |
2970 public: | |
2971 static HInductionVariable* AddToGraph(HPhi* phi, | |
2972 NumericRelation relation, | |
2973 int operand_index); | |
2974 | |
2975 NumericRelation relation() { return relation_; } | |
2976 HValue* induction_base() { return phi_->OperandAt(operand_index_); } | |
2977 | |
2978 virtual int RedefinedOperandIndex() { return 0; } | |
2979 virtual bool IsPurelyInformativeDefinition() { return true; } | |
2980 virtual Representation RequiredInputRepresentation(int index) { | |
2981 return representation(); | |
2982 } | |
2983 | |
2984 virtual void PrintDataTo(StringStream* stream); | |
2985 | |
2986 virtual bool IsRelationTrueInternal(NumericRelation other_relation, | |
2987 HValue* other_related_value) { | |
2988 if (induction_base() == other_related_value) { | |
2989 return relation().Implies(other_relation); | |
2990 } else { | |
2991 return false; | |
2992 } | |
2993 } | |
2994 | |
2995 DECLARE_CONCRETE_INSTRUCTION(InductionVariable) | |
2996 | |
2997 private: | |
2998 HInductionVariable(HPhi* phi, NumericRelation relation, int operand_index) | |
2999 : HUnaryOperation(phi), | |
3000 phi_(phi), relation_(relation), operand_index_(operand_index) { | |
3001 set_representation(phi->representation()); | |
3002 } | |
3003 | |
3004 HPhi* phi_; | |
Jakob Kummerow
2013/02/20 10:46:47
No need to store this -- the UnaryOperation base c
Massi
2013/02/21 07:40:32
Actually it is needed, adding a comment to clarify
| |
3005 NumericRelation relation_; | |
3006 int operand_index_; | |
3007 }; | |
3008 | |
3009 | |
2963 class HArgumentsObject: public HTemplateInstruction<0> { | 3010 class HArgumentsObject: public HTemplateInstruction<0> { |
2964 public: | 3011 public: |
2965 HArgumentsObject() { | 3012 HArgumentsObject() { |
2966 set_representation(Representation::Tagged()); | 3013 set_representation(Representation::Tagged()); |
2967 SetFlag(kIsArguments); | 3014 SetFlag(kIsArguments); |
2968 } | 3015 } |
2969 | 3016 |
2970 virtual Representation RequiredInputRepresentation(int index) { | 3017 virtual Representation RequiredInputRepresentation(int index) { |
2971 return Representation::None(); | 3018 return Representation::None(); |
2972 } | 3019 } |
(...skipping 3052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6025 virtual bool IsDeletable() const { return true; } | 6072 virtual bool IsDeletable() const { return true; } |
6026 }; | 6073 }; |
6027 | 6074 |
6028 | 6075 |
6029 #undef DECLARE_INSTRUCTION | 6076 #undef DECLARE_INSTRUCTION |
6030 #undef DECLARE_CONCRETE_INSTRUCTION | 6077 #undef DECLARE_CONCRETE_INSTRUCTION |
6031 | 6078 |
6032 } } // namespace v8::internal | 6079 } } // namespace v8::internal |
6033 | 6080 |
6034 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 6081 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |