Chromium Code Reviews| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 78 } | 78 } |
| 79 Node* Float64Constant(double value) { | 79 Node* Float64Constant(double value) { |
| 80 return NEW_NODE_0(COMMON()->Float64Constant(value)); | 80 return NEW_NODE_0(COMMON()->Float64Constant(value)); |
| 81 } | 81 } |
| 82 Node* HeapConstant(Handle<Object> object) { | 82 Node* HeapConstant(Handle<Object> object) { |
| 83 PrintableUnique<Object> val = | 83 PrintableUnique<Object> val = |
| 84 PrintableUnique<Object>::CreateUninitialized(ZONE(), object); | 84 PrintableUnique<Object>::CreateUninitialized(ZONE(), object); |
| 85 return NEW_NODE_0(COMMON()->HeapConstant(val)); | 85 return NEW_NODE_0(COMMON()->HeapConstant(val)); |
| 86 } | 86 } |
| 87 | 87 |
| 88 // Projections. | |
| 89 Node* Projection(int index, Node* tuple) { | |
| 90 return NEW_NODE_1(COMMON()->Projection(index), tuple); | |
| 91 } | |
| 92 | |
| 88 // Memory Operations. | 93 // Memory Operations. |
| 89 Node* Load(MachineRepresentation rep, Node* base) { | 94 Node* Load(MachineRepresentation rep, Node* base) { |
| 90 return Load(rep, base, Int32Constant(0)); | 95 return Load(rep, base, Int32Constant(0)); |
| 91 } | 96 } |
| 92 Node* Load(MachineRepresentation rep, Node* base, Node* index) { | 97 Node* Load(MachineRepresentation rep, Node* base, Node* index) { |
| 93 return NEW_NODE_2(MACHINE()->Load(rep), base, index); | 98 return NEW_NODE_2(MACHINE()->Load(rep), base, index); |
| 94 } | 99 } |
| 95 void Store(MachineRepresentation rep, Node* base, Node* value) { | 100 void Store(MachineRepresentation rep, Node* base, Node* value) { |
| 96 Store(rep, base, Int32Constant(0), value); | 101 Store(rep, base, Int32Constant(0), value); |
| 97 } | 102 } |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 188 } | 193 } |
| 189 Node* Word64NotEqual(Node* a, Node* b) { | 194 Node* Word64NotEqual(Node* a, Node* b) { |
| 190 return Word64BinaryNot(Word64Equal(a, b)); | 195 return Word64BinaryNot(Word64Equal(a, b)); |
| 191 } | 196 } |
| 192 Node* Word64Not(Node* a) { return Word64Xor(a, Int64Constant(-1)); } | 197 Node* Word64Not(Node* a) { return Word64Xor(a, Int64Constant(-1)); } |
| 193 Node* Word64BinaryNot(Node* a) { return Word64Equal(a, Int64Constant(0)); } | 198 Node* Word64BinaryNot(Node* a) { return Word64Equal(a, Int64Constant(0)); } |
| 194 | 199 |
| 195 Node* Int32Add(Node* a, Node* b) { | 200 Node* Int32Add(Node* a, Node* b) { |
| 196 return NEW_NODE_2(MACHINE()->Int32Add(), a, b); | 201 return NEW_NODE_2(MACHINE()->Int32Add(), a, b); |
| 197 } | 202 } |
| 203 Node* Int32AddWithOverflow(Node* a, Node* b) { | |
|
titzer
2014/07/31 15:16:34
Maybe we want to return the two projection nodes f
Benedikt Meurer
2014/07/31 15:18:19
I'd leave it this way for consistency with calls.
Benedikt Meurer
2014/08/01 05:01:18
Done.
| |
| 204 return NEW_NODE_2(MACHINE()->Int32AddWithOverflow(), a, b); | |
| 205 } | |
| 198 Node* Int32Sub(Node* a, Node* b) { | 206 Node* Int32Sub(Node* a, Node* b) { |
| 199 return NEW_NODE_2(MACHINE()->Int32Sub(), a, b); | 207 return NEW_NODE_2(MACHINE()->Int32Sub(), a, b); |
| 200 } | 208 } |
| 201 Node* Int32Mul(Node* a, Node* b) { | 209 Node* Int32Mul(Node* a, Node* b) { |
| 202 return NEW_NODE_2(MACHINE()->Int32Mul(), a, b); | 210 return NEW_NODE_2(MACHINE()->Int32Mul(), a, b); |
| 203 } | 211 } |
| 204 Node* Int32Div(Node* a, Node* b) { | 212 Node* Int32Div(Node* a, Node* b) { |
| 205 return NEW_NODE_2(MACHINE()->Int32Div(), a, b); | 213 return NEW_NODE_2(MACHINE()->Int32Div(), a, b); |
| 206 } | 214 } |
| 207 Node* Int32UDiv(Node* a, Node* b) { | 215 Node* Int32UDiv(Node* a, Node* b) { |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 365 #undef NEW_NODE_3 | 373 #undef NEW_NODE_3 |
| 366 #undef MACHINE | 374 #undef MACHINE |
| 367 #undef COMMON | 375 #undef COMMON |
| 368 #undef ZONE | 376 #undef ZONE |
| 369 | 377 |
| 370 } // namespace compiler | 378 } // namespace compiler |
| 371 } // namespace internal | 379 } // namespace internal |
| 372 } // namespace v8 | 380 } // namespace v8 |
| 373 | 381 |
| 374 #endif // V8_COMPILER_MACHINE_NODE_FACTORY_H_ | 382 #endif // V8_COMPILER_MACHINE_NODE_FACTORY_H_ |
| OLD | NEW |