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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 template <typename NodeFactory> | 58 template <typename NodeFactory> |
59 class MachineNodeFactory { | 59 class MachineNodeFactory { |
60 public: | 60 public: |
61 // Constants. | 61 // Constants. |
62 Node* PointerConstant(void* value) { | 62 Node* PointerConstant(void* value) { |
63 return IntPtrConstant(reinterpret_cast<intptr_t>(value)); | 63 return IntPtrConstant(reinterpret_cast<intptr_t>(value)); |
64 } | 64 } |
65 Node* IntPtrConstant(intptr_t value) { | 65 Node* IntPtrConstant(intptr_t value) { |
66 // TODO(dcarney): mark generated code as unserializable if value != 0. | 66 // TODO(dcarney): mark generated code as unserializable if value != 0. |
67 return kPointerSize == 8 ? Int64Constant(value) : Int32Constant(value); | 67 return kPointerSize == 8 ? Int64Constant(value) |
| 68 : Int32Constant(static_cast<int>(value)); |
68 } | 69 } |
69 Node* Int32Constant(int32_t value) { | 70 Node* Int32Constant(int32_t value) { |
70 return NEW_NODE_0(COMMON()->Int32Constant(value)); | 71 return NEW_NODE_0(COMMON()->Int32Constant(value)); |
71 } | 72 } |
72 Node* Int64Constant(int64_t value) { | 73 Node* Int64Constant(int64_t value) { |
73 return NEW_NODE_0(COMMON()->Int64Constant(value)); | 74 return NEW_NODE_0(COMMON()->Int64Constant(value)); |
74 } | 75 } |
75 Node* NumberConstant(double value) { | 76 Node* NumberConstant(double value) { |
76 return NEW_NODE_0(COMMON()->NumberConstant(value)); | 77 return NEW_NODE_0(COMMON()->NumberConstant(value)); |
77 } | 78 } |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 #undef NEW_NODE_3 | 359 #undef NEW_NODE_3 |
359 #undef MACHINE | 360 #undef MACHINE |
360 #undef COMMON | 361 #undef COMMON |
361 #undef ZONE | 362 #undef ZONE |
362 | 363 |
363 } // namespace compiler | 364 } // namespace compiler |
364 } // namespace internal | 365 } // namespace internal |
365 } // namespace v8 | 366 } // namespace v8 |
366 | 367 |
367 #endif // V8_COMPILER_MACHINE_NODE_FACTORY_H_ | 368 #endif // V8_COMPILER_MACHINE_NODE_FACTORY_H_ |
OLD | NEW |