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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 V(CallNamed) \ | 85 V(CallNamed) \ |
86 V(CallNew) \ | 86 V(CallNew) \ |
87 V(CallNewArray) \ | 87 V(CallNewArray) \ |
88 V(CallRuntime) \ | 88 V(CallRuntime) \ |
89 V(CallStub) \ | 89 V(CallStub) \ |
90 V(Change) \ | 90 V(Change) \ |
91 V(CheckFunction) \ | 91 V(CheckFunction) \ |
92 V(CheckInstanceType) \ | 92 V(CheckInstanceType) \ |
93 V(CheckMaps) \ | 93 V(CheckMaps) \ |
94 V(CheckNonSmi) \ | 94 V(CheckNonSmi) \ |
| 95 V(CheckSmi) \ |
95 V(CheckPrototypeMaps) \ | 96 V(CheckPrototypeMaps) \ |
96 V(ClampToUint8) \ | 97 V(ClampToUint8) \ |
97 V(ClassOfTestAndBranch) \ | 98 V(ClassOfTestAndBranch) \ |
98 V(CompareIDAndBranch) \ | 99 V(CompareIDAndBranch) \ |
99 V(CompareGeneric) \ | 100 V(CompareGeneric) \ |
100 V(CompareObjectEqAndBranch) \ | 101 V(CompareObjectEqAndBranch) \ |
101 V(CompareMap) \ | 102 V(CompareMap) \ |
102 V(CompareConstantEqAndBranch) \ | 103 V(CompareConstantEqAndBranch) \ |
103 V(Constant) \ | 104 V(Constant) \ |
104 V(Context) \ | 105 V(Context) \ |
(...skipping 17 matching lines...) Expand all Loading... |
122 V(HasInstanceTypeAndBranch) \ | 123 V(HasInstanceTypeAndBranch) \ |
123 V(InductionVariableAnnotation) \ | 124 V(InductionVariableAnnotation) \ |
124 V(In) \ | 125 V(In) \ |
125 V(InnerAllocatedObject) \ | 126 V(InnerAllocatedObject) \ |
126 V(InstanceOf) \ | 127 V(InstanceOf) \ |
127 V(InstanceOfKnownGlobal) \ | 128 V(InstanceOfKnownGlobal) \ |
128 V(InstanceSize) \ | 129 V(InstanceSize) \ |
129 V(InvokeFunction) \ | 130 V(InvokeFunction) \ |
130 V(IsConstructCallAndBranch) \ | 131 V(IsConstructCallAndBranch) \ |
131 V(IsObjectAndBranch) \ | 132 V(IsObjectAndBranch) \ |
| 133 V(IsNumberAndBranch) \ |
132 V(IsStringAndBranch) \ | 134 V(IsStringAndBranch) \ |
133 V(IsSmiAndBranch) \ | 135 V(IsSmiAndBranch) \ |
134 V(IsUndetectableAndBranch) \ | 136 V(IsUndetectableAndBranch) \ |
135 V(LeaveInlined) \ | 137 V(LeaveInlined) \ |
136 V(LoadContextSlot) \ | 138 V(LoadContextSlot) \ |
137 V(LoadExternalArrayPointer) \ | 139 V(LoadExternalArrayPointer) \ |
138 V(LoadFunctionPrototype) \ | 140 V(LoadFunctionPrototype) \ |
139 V(LoadGlobalCell) \ | 141 V(LoadGlobalCell) \ |
140 V(LoadGlobalGeneric) \ | 142 V(LoadGlobalGeneric) \ |
141 V(LoadKeyed) \ | 143 V(LoadKeyed) \ |
(...skipping 2799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2941 HCheckInstanceType(HValue* value, Check check) | 2943 HCheckInstanceType(HValue* value, Check check) |
2942 : HUnaryOperation(value), check_(check) { | 2944 : HUnaryOperation(value), check_(check) { |
2943 set_representation(Representation::Tagged()); | 2945 set_representation(Representation::Tagged()); |
2944 SetFlag(kUseGVN); | 2946 SetFlag(kUseGVN); |
2945 } | 2947 } |
2946 | 2948 |
2947 const Check check_; | 2949 const Check check_; |
2948 }; | 2950 }; |
2949 | 2951 |
2950 | 2952 |
| 2953 class HCheckSmi: public HUnaryOperation { |
| 2954 public: |
| 2955 explicit HCheckSmi(HValue* value) : HUnaryOperation(value) { |
| 2956 set_representation(Representation::Smi()); |
| 2957 SetFlag(kUseGVN); |
| 2958 } |
| 2959 |
| 2960 virtual Representation RequiredInputRepresentation(int index) { |
| 2961 return Representation::Tagged(); |
| 2962 } |
| 2963 |
| 2964 virtual HType CalculateInferredType(); |
| 2965 |
| 2966 virtual HValue* Canonicalize() { |
| 2967 HType value_type = value()->type(); |
| 2968 if (value_type.IsSmi()) { |
| 2969 return NULL; |
| 2970 } |
| 2971 return this; |
| 2972 } |
| 2973 |
| 2974 DECLARE_CONCRETE_INSTRUCTION(CheckSmi) |
| 2975 |
| 2976 protected: |
| 2977 virtual bool DataEquals(HValue* other) { return true; } |
| 2978 }; |
| 2979 |
| 2980 |
| 2981 class HIsNumberAndBranch: public HUnaryControlInstruction { |
| 2982 public: |
| 2983 explicit HIsNumberAndBranch(HValue* value) |
| 2984 : HUnaryControlInstruction(value, NULL, NULL) { |
| 2985 SetFlag(kFlexibleRepresentation); |
| 2986 } |
| 2987 |
| 2988 virtual Representation RequiredInputRepresentation(int index) { |
| 2989 return Representation::None(); |
| 2990 } |
| 2991 |
| 2992 DECLARE_CONCRETE_INSTRUCTION(IsNumberAndBranch) |
| 2993 }; |
| 2994 |
| 2995 |
2951 class HCheckNonSmi: public HUnaryOperation { | 2996 class HCheckNonSmi: public HUnaryOperation { |
2952 public: | 2997 public: |
2953 explicit HCheckNonSmi(HValue* value) : HUnaryOperation(value) { | 2998 explicit HCheckNonSmi(HValue* value) : HUnaryOperation(value) { |
2954 set_representation(Representation::Tagged()); | 2999 set_representation(Representation::Tagged()); |
2955 SetFlag(kUseGVN); | 3000 SetFlag(kUseGVN); |
2956 } | 3001 } |
2957 | 3002 |
2958 virtual Representation RequiredInputRepresentation(int index) { | 3003 virtual Representation RequiredInputRepresentation(int index) { |
2959 return Representation::Tagged(); | 3004 return Representation::Tagged(); |
2960 } | 3005 } |
(...skipping 3685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6646 virtual bool IsDeletable() const { return true; } | 6691 virtual bool IsDeletable() const { return true; } |
6647 }; | 6692 }; |
6648 | 6693 |
6649 | 6694 |
6650 #undef DECLARE_INSTRUCTION | 6695 #undef DECLARE_INSTRUCTION |
6651 #undef DECLARE_CONCRETE_INSTRUCTION | 6696 #undef DECLARE_CONCRETE_INSTRUCTION |
6652 | 6697 |
6653 } } // namespace v8::internal | 6698 } } // namespace v8::internal |
6654 | 6699 |
6655 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 6700 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |