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_MACHINE_NODE_FACTORY_H_ | 5 #ifndef V8_COMPILER_MACHINE_NODE_FACTORY_H_ |
6 #define V8_COMPILER_MACHINE_NODE_FACTORY_H_ | 6 #define V8_COMPILER_MACHINE_NODE_FACTORY_H_ |
7 | 7 |
8 #ifdef USE_SIMULATOR | 8 #ifdef USE_SIMULATOR |
9 #define MACHINE_ASSEMBLER_SUPPORTS_CALL_C 0 | 9 #define MACHINE_ASSEMBLER_SUPPORTS_CALL_C 0 |
10 #else | 10 #else |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 } | 192 } |
193 Node* Word64NotEqual(Node* a, Node* b) { | 193 Node* Word64NotEqual(Node* a, Node* b) { |
194 return Word64BinaryNot(Word64Equal(a, b)); | 194 return Word64BinaryNot(Word64Equal(a, b)); |
195 } | 195 } |
196 Node* Word64Not(Node* a) { return Word64Xor(a, Int64Constant(-1)); } | 196 Node* Word64Not(Node* a) { return Word64Xor(a, Int64Constant(-1)); } |
197 Node* Word64BinaryNot(Node* a) { return Word64Equal(a, Int64Constant(0)); } | 197 Node* Word64BinaryNot(Node* a) { return Word64Equal(a, Int64Constant(0)); } |
198 | 198 |
199 Node* Int32Add(Node* a, Node* b) { | 199 Node* Int32Add(Node* a, Node* b) { |
200 return NEW_NODE_2(MACHINE()->Int32Add(), a, b); | 200 return NEW_NODE_2(MACHINE()->Int32Add(), a, b); |
201 } | 201 } |
202 void Int32AddWithOverflow(Node* a, Node* b, Node** val_return, | 202 Node* Int32AddWithOverflow(Node* a, Node* b) { |
203 Node** ovf_return) { | 203 return NEW_NODE_2(MACHINE()->Int32AddWithOverflow(), a, b); |
204 Node* add = NEW_NODE_2(MACHINE()->Int32AddWithOverflow(), a, b); | |
205 if (val_return) *val_return = Projection(0, add); | |
206 if (ovf_return) *ovf_return = Projection(1, add); | |
207 } | 204 } |
208 Node* Int32Sub(Node* a, Node* b) { | 205 Node* Int32Sub(Node* a, Node* b) { |
209 return NEW_NODE_2(MACHINE()->Int32Sub(), a, b); | 206 return NEW_NODE_2(MACHINE()->Int32Sub(), a, b); |
210 } | 207 } |
211 void Int32SubWithOverflow(Node* a, Node* b, Node** val_return, | 208 Node* Int32SubWithOverflow(Node* a, Node* b) { |
212 Node** ovf_return) { | 209 return NEW_NODE_2(MACHINE()->Int32SubWithOverflow(), a, b); |
213 Node* add = NEW_NODE_2(MACHINE()->Int32SubWithOverflow(), a, b); | |
214 if (val_return) *val_return = Projection(0, add); | |
215 if (ovf_return) *ovf_return = Projection(1, add); | |
216 } | 210 } |
217 Node* Int32Mul(Node* a, Node* b) { | 211 Node* Int32Mul(Node* a, Node* b) { |
218 return NEW_NODE_2(MACHINE()->Int32Mul(), a, b); | 212 return NEW_NODE_2(MACHINE()->Int32Mul(), a, b); |
219 } | 213 } |
220 Node* Int32Div(Node* a, Node* b) { | 214 Node* Int32Div(Node* a, Node* b) { |
221 return NEW_NODE_2(MACHINE()->Int32Div(), a, b); | 215 return NEW_NODE_2(MACHINE()->Int32Div(), a, b); |
222 } | 216 } |
223 Node* Int32UDiv(Node* a, Node* b) { | 217 Node* Int32UDiv(Node* a, Node* b) { |
224 return NEW_NODE_2(MACHINE()->Int32UDiv(), a, b); | 218 return NEW_NODE_2(MACHINE()->Int32UDiv(), a, b); |
225 } | 219 } |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 #undef NEW_NODE_3 | 375 #undef NEW_NODE_3 |
382 #undef MACHINE | 376 #undef MACHINE |
383 #undef COMMON | 377 #undef COMMON |
384 #undef ZONE | 378 #undef ZONE |
385 | 379 |
386 } // namespace compiler | 380 } // namespace compiler |
387 } // namespace internal | 381 } // namespace internal |
388 } // namespace v8 | 382 } // namespace v8 |
389 | 383 |
390 #endif // V8_COMPILER_MACHINE_NODE_FACTORY_H_ | 384 #endif // V8_COMPILER_MACHINE_NODE_FACTORY_H_ |
OLD | NEW |