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(CheckHeapObject) \ | 92 V(CheckHeapObject) \ |
93 V(CheckInstanceType) \ | 93 V(CheckInstanceType) \ |
94 V(CheckMaps) \ | 94 V(CheckMaps) \ |
| 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 16 matching lines...) Expand all Loading... |
121 V(HasInstanceTypeAndBranch) \ | 122 V(HasInstanceTypeAndBranch) \ |
122 V(InductionVariableAnnotation) \ | 123 V(InductionVariableAnnotation) \ |
123 V(In) \ | 124 V(In) \ |
124 V(InnerAllocatedObject) \ | 125 V(InnerAllocatedObject) \ |
125 V(InstanceOf) \ | 126 V(InstanceOf) \ |
126 V(InstanceOfKnownGlobal) \ | 127 V(InstanceOfKnownGlobal) \ |
127 V(InstanceSize) \ | 128 V(InstanceSize) \ |
128 V(InvokeFunction) \ | 129 V(InvokeFunction) \ |
129 V(IsConstructCallAndBranch) \ | 130 V(IsConstructCallAndBranch) \ |
130 V(IsObjectAndBranch) \ | 131 V(IsObjectAndBranch) \ |
| 132 V(IsNumberAndBranch) \ |
131 V(IsStringAndBranch) \ | 133 V(IsStringAndBranch) \ |
132 V(IsSmiAndBranch) \ | 134 V(IsSmiAndBranch) \ |
133 V(IsUndetectableAndBranch) \ | 135 V(IsUndetectableAndBranch) \ |
134 V(LeaveInlined) \ | 136 V(LeaveInlined) \ |
135 V(LoadContextSlot) \ | 137 V(LoadContextSlot) \ |
136 V(LoadExternalArrayPointer) \ | 138 V(LoadExternalArrayPointer) \ |
137 V(LoadFunctionPrototype) \ | 139 V(LoadFunctionPrototype) \ |
138 V(LoadGlobalCell) \ | 140 V(LoadGlobalCell) \ |
139 V(LoadGlobalGeneric) \ | 141 V(LoadGlobalGeneric) \ |
140 V(LoadKeyed) \ | 142 V(LoadKeyed) \ |
(...skipping 2786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2927 HCheckInstanceType(HValue* value, Check check) | 2929 HCheckInstanceType(HValue* value, Check check) |
2928 : HUnaryOperation(value), check_(check) { | 2930 : HUnaryOperation(value), check_(check) { |
2929 set_representation(Representation::Tagged()); | 2931 set_representation(Representation::Tagged()); |
2930 SetFlag(kUseGVN); | 2932 SetFlag(kUseGVN); |
2931 } | 2933 } |
2932 | 2934 |
2933 const Check check_; | 2935 const Check check_; |
2934 }; | 2936 }; |
2935 | 2937 |
2936 | 2938 |
| 2939 class HCheckSmi: public HUnaryOperation { |
| 2940 public: |
| 2941 explicit HCheckSmi(HValue* value) : HUnaryOperation(value) { |
| 2942 set_representation(Representation::Smi()); |
| 2943 SetFlag(kUseGVN); |
| 2944 } |
| 2945 |
| 2946 virtual Representation RequiredInputRepresentation(int index) { |
| 2947 return Representation::Tagged(); |
| 2948 } |
| 2949 |
| 2950 virtual HType CalculateInferredType(); |
| 2951 |
| 2952 virtual HValue* Canonicalize() { |
| 2953 HType value_type = value()->type(); |
| 2954 if (value_type.IsSmi()) { |
| 2955 return NULL; |
| 2956 } |
| 2957 return this; |
| 2958 } |
| 2959 |
| 2960 DECLARE_CONCRETE_INSTRUCTION(CheckSmi) |
| 2961 |
| 2962 protected: |
| 2963 virtual bool DataEquals(HValue* other) { return true; } |
| 2964 }; |
| 2965 |
| 2966 |
| 2967 class HIsNumberAndBranch: public HUnaryControlInstruction { |
| 2968 public: |
| 2969 explicit HIsNumberAndBranch(HValue* value) |
| 2970 : HUnaryControlInstruction(value, NULL, NULL) { |
| 2971 SetFlag(kFlexibleRepresentation); |
| 2972 } |
| 2973 |
| 2974 virtual Representation RequiredInputRepresentation(int index) { |
| 2975 return Representation::None(); |
| 2976 } |
| 2977 |
| 2978 DECLARE_CONCRETE_INSTRUCTION(IsNumberAndBranch) |
| 2979 }; |
| 2980 |
| 2981 |
2937 class HCheckHeapObject: public HUnaryOperation { | 2982 class HCheckHeapObject: public HUnaryOperation { |
2938 public: | 2983 public: |
2939 explicit HCheckHeapObject(HValue* value) : HUnaryOperation(value) { | 2984 explicit HCheckHeapObject(HValue* value) : HUnaryOperation(value) { |
2940 set_representation(Representation::Tagged()); | 2985 set_representation(Representation::Tagged()); |
2941 SetFlag(kUseGVN); | 2986 SetFlag(kUseGVN); |
2942 } | 2987 } |
2943 | 2988 |
2944 virtual Representation RequiredInputRepresentation(int index) { | 2989 virtual Representation RequiredInputRepresentation(int index) { |
2945 return Representation::Tagged(); | 2990 return Representation::Tagged(); |
2946 } | 2991 } |
(...skipping 3690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6637 virtual bool IsDeletable() const { return true; } | 6682 virtual bool IsDeletable() const { return true; } |
6638 }; | 6683 }; |
6639 | 6684 |
6640 | 6685 |
6641 #undef DECLARE_INSTRUCTION | 6686 #undef DECLARE_INSTRUCTION |
6642 #undef DECLARE_CONCRETE_INSTRUCTION | 6687 #undef DECLARE_CONCRETE_INSTRUCTION |
6643 | 6688 |
6644 } } // namespace v8::internal | 6689 } } // namespace v8::internal |
6645 | 6690 |
6646 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 6691 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |