| 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_JS_GRAPH_H_ | 5 #ifndef V8_COMPILER_JS_GRAPH_H_ |
| 6 #define V8_COMPILER_JS_GRAPH_H_ | 6 #define V8_COMPILER_JS_GRAPH_H_ |
| 7 | 7 |
| 8 #include "src/compiler/common-node-cache.h" | 8 #include "src/compiler/common-node-cache.h" |
| 9 #include "src/compiler/common-operator.h" | 9 #include "src/compiler/common-operator.h" |
| 10 #include "src/compiler/graph.h" | 10 #include "src/compiler/graph.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 62 |
| 63 // Creates a NumberConstant node, usually canonicalized. | 63 // Creates a NumberConstant node, usually canonicalized. |
| 64 Node* Constant(int32_t value); | 64 Node* Constant(int32_t value); |
| 65 | 65 |
| 66 // Creates a Int32Constant node, usually canonicalized. | 66 // Creates a Int32Constant node, usually canonicalized. |
| 67 Node* Int32Constant(int32_t value); | 67 Node* Int32Constant(int32_t value); |
| 68 Node* Uint32Constant(uint32_t value) { | 68 Node* Uint32Constant(uint32_t value) { |
| 69 return Int32Constant(bit_cast<int32_t>(value)); | 69 return Int32Constant(bit_cast<int32_t>(value)); |
| 70 } | 70 } |
| 71 | 71 |
| 72 // Creates a Int64Constant node, usually canonicalized. |
| 73 Node* Int64Constant(int64_t value); |
| 74 Node* Uint64Constant(uint64_t value) { |
| 75 return Int64Constant(bit_cast<int64_t>(value)); |
| 76 } |
| 77 |
| 78 // Creates a Int32Constant/Int64Constant node, depending on the word size of |
| 79 // the target machine. |
| 80 // TODO(turbofan): Code using Int32Constant/Int64Constant to store pointer |
| 81 // constants is probably not serializable. |
| 82 Node* IntPtrConstant(intptr_t value) { |
| 83 return machine()->Is32() ? Int32Constant(static_cast<int32_t>(value)) |
| 84 : Int64Constant(static_cast<int64_t>(value)); |
| 85 } |
| 86 |
| 72 // Creates a Float32Constant node, usually canonicalized. | 87 // Creates a Float32Constant node, usually canonicalized. |
| 73 Node* Float32Constant(float value); | 88 Node* Float32Constant(float value); |
| 74 | 89 |
| 75 // Creates a Float64Constant node, usually canonicalized. | 90 // Creates a Float64Constant node, usually canonicalized. |
| 76 Node* Float64Constant(double value); | 91 Node* Float64Constant(double value); |
| 77 | 92 |
| 78 // Creates an ExternalConstant node, usually canonicalized. | 93 // Creates an ExternalConstant node, usually canonicalized. |
| 79 Node* ExternalConstant(ExternalReference ref); | 94 Node* ExternalConstant(ExternalReference ref); |
| 80 | 95 |
| 81 Node* SmiConstant(int32_t immediate) { | 96 Node* SmiConstant(int32_t immediate) { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 Node* NewNode(const Operator* op); | 129 Node* NewNode(const Operator* op); |
| 115 | 130 |
| 116 Factory* factory() { return isolate()->factory(); } | 131 Factory* factory() { return isolate()->factory(); } |
| 117 }; | 132 }; |
| 118 | 133 |
| 119 } // namespace compiler | 134 } // namespace compiler |
| 120 } // namespace internal | 135 } // namespace internal |
| 121 } // namespace v8 | 136 } // namespace v8 |
| 122 | 137 |
| 123 #endif | 138 #endif |
| OLD | NEW |