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 | |
dcarney
2014/10/13 09:11:48
can you add a todo that the generated code in unse
| |
79 // the target machine. | |
80 Node* IntPtrConstant(intptr_t value) { | |
81 return machine()->Is32() ? Int32Constant(static_cast<int32_t>(value)) | |
82 : Int64Constant(static_cast<int64_t>(value)); | |
83 } | |
84 | |
72 // Creates a Float32Constant node, usually canonicalized. | 85 // Creates a Float32Constant node, usually canonicalized. |
73 Node* Float32Constant(float value); | 86 Node* Float32Constant(float value); |
74 | 87 |
75 // Creates a Float64Constant node, usually canonicalized. | 88 // Creates a Float64Constant node, usually canonicalized. |
76 Node* Float64Constant(double value); | 89 Node* Float64Constant(double value); |
77 | 90 |
78 // Creates an ExternalConstant node, usually canonicalized. | 91 // Creates an ExternalConstant node, usually canonicalized. |
79 Node* ExternalConstant(ExternalReference ref); | 92 Node* ExternalConstant(ExternalReference ref); |
80 | 93 |
81 Node* SmiConstant(int32_t immediate) { | 94 Node* SmiConstant(int32_t immediate) { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
114 Node* NewNode(const Operator* op); | 127 Node* NewNode(const Operator* op); |
115 | 128 |
116 Factory* factory() { return isolate()->factory(); } | 129 Factory* factory() { return isolate()->factory(); } |
117 }; | 130 }; |
118 | 131 |
119 } // namespace compiler | 132 } // namespace compiler |
120 } // namespace internal | 133 } // namespace internal |
121 } // namespace v8 | 134 } // namespace v8 |
122 | 135 |
123 #endif | 136 #endif |
OLD | NEW |