OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_COMPILER_SIMPLIFIED_OPERATOR_H_ | 5 #ifndef V8_COMPILER_SIMPLIFIED_OPERATOR_H_ |
6 #define V8_COMPILER_SIMPLIFIED_OPERATOR_H_ | 6 #define V8_COMPILER_SIMPLIFIED_OPERATOR_H_ |
7 | 7 |
8 #include "src/compiler/machine-operator.h" | 8 #include "src/compiler/machine-operator.h" |
9 #include "src/compiler/opcodes.h" | 9 #include "src/compiler/opcodes.h" |
10 #include "src/zone.h" | 10 #include "src/zone.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 SimpleOperator(IrOpcode::k##name, properties, inputs, outputs, #name); | 126 SimpleOperator(IrOpcode::k##name, properties, inputs, outputs, #name); |
127 | 127 |
128 #define OP1(name, ptype, pname, properties, inputs, outputs) \ | 128 #define OP1(name, ptype, pname, properties, inputs, outputs) \ |
129 return new (zone_) \ | 129 return new (zone_) \ |
130 Operator1<ptype>(IrOpcode::k##name, properties | Operator::kNoThrow, \ | 130 Operator1<ptype>(IrOpcode::k##name, properties | Operator::kNoThrow, \ |
131 inputs, outputs, #name, pname) | 131 inputs, outputs, #name, pname) |
132 | 132 |
133 #define UNOP(name) SIMPLE(name, Operator::kPure, 1, 1) | 133 #define UNOP(name) SIMPLE(name, Operator::kPure, 1, 1) |
134 #define BINOP(name) SIMPLE(name, Operator::kPure, 2, 1) | 134 #define BINOP(name) SIMPLE(name, Operator::kPure, 2, 1) |
135 | 135 |
136 Operator* BooleanNot() const { UNOP(BooleanNot); } | 136 const Operator* BooleanNot() const { UNOP(BooleanNot); } |
137 | 137 |
138 Operator* NumberEqual() const { BINOP(NumberEqual); } | 138 const Operator* NumberEqual() const { BINOP(NumberEqual); } |
139 Operator* NumberLessThan() const { BINOP(NumberLessThan); } | 139 const Operator* NumberLessThan() const { BINOP(NumberLessThan); } |
140 Operator* NumberLessThanOrEqual() const { BINOP(NumberLessThanOrEqual); } | 140 const Operator* NumberLessThanOrEqual() const { |
141 Operator* NumberAdd() const { BINOP(NumberAdd); } | 141 BINOP(NumberLessThanOrEqual); |
142 Operator* NumberSubtract() const { BINOP(NumberSubtract); } | 142 } |
143 Operator* NumberMultiply() const { BINOP(NumberMultiply); } | 143 const Operator* NumberAdd() const { BINOP(NumberAdd); } |
144 Operator* NumberDivide() const { BINOP(NumberDivide); } | 144 const Operator* NumberSubtract() const { BINOP(NumberSubtract); } |
145 Operator* NumberModulus() const { BINOP(NumberModulus); } | 145 const Operator* NumberMultiply() const { BINOP(NumberMultiply); } |
146 Operator* NumberToInt32() const { UNOP(NumberToInt32); } | 146 const Operator* NumberDivide() const { BINOP(NumberDivide); } |
147 Operator* NumberToUint32() const { UNOP(NumberToUint32); } | 147 const Operator* NumberModulus() const { BINOP(NumberModulus); } |
| 148 const Operator* NumberToInt32() const { UNOP(NumberToInt32); } |
| 149 const Operator* NumberToUint32() const { UNOP(NumberToUint32); } |
148 | 150 |
149 Operator* ReferenceEqual(Type* type) const { BINOP(ReferenceEqual); } | 151 const Operator* ReferenceEqual(Type* type) const { BINOP(ReferenceEqual); } |
150 | 152 |
151 Operator* StringEqual() const { BINOP(StringEqual); } | 153 const Operator* StringEqual() const { BINOP(StringEqual); } |
152 Operator* StringLessThan() const { BINOP(StringLessThan); } | 154 const Operator* StringLessThan() const { BINOP(StringLessThan); } |
153 Operator* StringLessThanOrEqual() const { BINOP(StringLessThanOrEqual); } | 155 const Operator* StringLessThanOrEqual() const { |
154 Operator* StringAdd() const { BINOP(StringAdd); } | 156 BINOP(StringLessThanOrEqual); |
| 157 } |
| 158 const Operator* StringAdd() const { BINOP(StringAdd); } |
155 | 159 |
156 Operator* ChangeTaggedToInt32() const { UNOP(ChangeTaggedToInt32); } | 160 const Operator* ChangeTaggedToInt32() const { UNOP(ChangeTaggedToInt32); } |
157 Operator* ChangeTaggedToUint32() const { UNOP(ChangeTaggedToUint32); } | 161 const Operator* ChangeTaggedToUint32() const { UNOP(ChangeTaggedToUint32); } |
158 Operator* ChangeTaggedToFloat64() const { UNOP(ChangeTaggedToFloat64); } | 162 const Operator* ChangeTaggedToFloat64() const { UNOP(ChangeTaggedToFloat64); } |
159 Operator* ChangeInt32ToTagged() const { UNOP(ChangeInt32ToTagged); } | 163 const Operator* ChangeInt32ToTagged() const { UNOP(ChangeInt32ToTagged); } |
160 Operator* ChangeUint32ToTagged() const { UNOP(ChangeUint32ToTagged); } | 164 const Operator* ChangeUint32ToTagged() const { UNOP(ChangeUint32ToTagged); } |
161 Operator* ChangeFloat64ToTagged() const { UNOP(ChangeFloat64ToTagged); } | 165 const Operator* ChangeFloat64ToTagged() const { UNOP(ChangeFloat64ToTagged); } |
162 Operator* ChangeBoolToBit() const { UNOP(ChangeBoolToBit); } | 166 const Operator* ChangeBoolToBit() const { UNOP(ChangeBoolToBit); } |
163 Operator* ChangeBitToBool() const { UNOP(ChangeBitToBool); } | 167 const Operator* ChangeBitToBool() const { UNOP(ChangeBitToBool); } |
164 | 168 |
165 Operator* LoadField(const FieldAccess& access) const { | 169 const Operator* LoadField(const FieldAccess& access) const { |
166 OP1(LoadField, FieldAccess, access, Operator::kNoWrite, 1, 1); | 170 OP1(LoadField, FieldAccess, access, Operator::kNoWrite, 1, 1); |
167 } | 171 } |
168 Operator* StoreField(const FieldAccess& access) const { | 172 const Operator* StoreField(const FieldAccess& access) const { |
169 OP1(StoreField, FieldAccess, access, Operator::kNoRead, 2, 0); | 173 OP1(StoreField, FieldAccess, access, Operator::kNoRead, 2, 0); |
170 } | 174 } |
171 Operator* LoadElement(const ElementAccess& access) const { | 175 const Operator* LoadElement(const ElementAccess& access) const { |
172 OP1(LoadElement, ElementAccess, access, Operator::kNoWrite, 2, 1); | 176 OP1(LoadElement, ElementAccess, access, Operator::kNoWrite, 2, 1); |
173 } | 177 } |
174 Operator* StoreElement(const ElementAccess& access) const { | 178 const Operator* StoreElement(const ElementAccess& access) const { |
175 OP1(StoreElement, ElementAccess, access, Operator::kNoRead, 3, 0); | 179 OP1(StoreElement, ElementAccess, access, Operator::kNoRead, 3, 0); |
176 } | 180 } |
177 | 181 |
178 #undef BINOP | 182 #undef BINOP |
179 #undef UNOP | 183 #undef UNOP |
180 #undef OP1 | 184 #undef OP1 |
181 #undef SIMPLE | 185 #undef SIMPLE |
182 | 186 |
183 private: | 187 private: |
184 Zone* zone_; | 188 Zone* zone_; |
185 }; | 189 }; |
186 } | 190 } |
187 } | 191 } |
188 } // namespace v8::internal::compiler | 192 } // namespace v8::internal::compiler |
189 | 193 |
190 #endif // V8_COMPILER_SIMPLIFIED_OPERATOR_H_ | 194 #endif // V8_COMPILER_SIMPLIFIED_OPERATOR_H_ |
OLD | NEW |