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 #include "src/code-stubs.h" | 5 #include "src/code-stubs.h" |
6 #include "src/compiler/js-graph.h" | 6 #include "src/compiler/js-graph.h" |
7 #include "src/compiler/node-properties.h" | 7 #include "src/compiler/node-properties.h" |
8 #include "src/compiler/typer.h" | 8 #include "src/compiler/typer.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 132 |
133 | 133 |
134 Node* JSGraph::Int64Constant(int64_t value) { | 134 Node* JSGraph::Int64Constant(int64_t value) { |
135 Node** loc = cache_.FindInt64Constant(value); | 135 Node** loc = cache_.FindInt64Constant(value); |
136 if (*loc == nullptr) { | 136 if (*loc == nullptr) { |
137 *loc = graph()->NewNode(common()->Int64Constant(value)); | 137 *loc = graph()->NewNode(common()->Int64Constant(value)); |
138 } | 138 } |
139 return *loc; | 139 return *loc; |
140 } | 140 } |
141 | 141 |
142 Node* JSGraph::RelocatableInt32Constant(int32_t value, RelocInfo::Mode rmode) { | |
143 Node** loc = cache_.FindRelocatableInt32Constant(value); | |
144 if (*loc == nullptr) { | |
145 *loc = graph()->NewNode(common()->RelocatableInt32Constant(value, rmode)); | |
146 } | |
147 return *loc; | |
148 } | |
149 | |
150 Node* JSGraph::RelocatableInt64Constant(int64_t value, RelocInfo::Mode rmode) { | |
151 Node** loc = cache_.FindRelocatableInt64Constant(value); | |
152 if (*loc == nullptr) { | |
153 *loc = graph()->NewNode(common()->RelocatableInt64Constant(value, rmode)); | |
154 } | |
155 return *loc; | |
156 } | |
157 | |
158 Node* JSGraph::RelocatableIntPtrConstant(intptr_t value, | |
159 RelocInfo::Mode rmode) { | |
160 return kPointerSize == 8 | |
161 ? RelocatableInt64Constant(value, rmode) | |
162 : RelocatableInt32Constant(static_cast<int>(value), rmode); | |
163 } | |
164 | 142 |
165 Node* JSGraph::NumberConstant(double value) { | 143 Node* JSGraph::NumberConstant(double value) { |
166 Node** loc = cache_.FindNumberConstant(value); | 144 Node** loc = cache_.FindNumberConstant(value); |
167 if (*loc == nullptr) { | 145 if (*loc == nullptr) { |
168 *loc = graph()->NewNode(common()->NumberConstant(value)); | 146 *loc = graph()->NewNode(common()->NumberConstant(value)); |
169 } | 147 } |
170 return *loc; | 148 return *loc; |
171 } | 149 } |
172 | 150 |
173 | 151 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 for (size_t i = 0; i < arraysize(cached_nodes_); i++) { | 206 for (size_t i = 0; i < arraysize(cached_nodes_); i++) { |
229 if (Node* node = cached_nodes_[i]) { | 207 if (Node* node = cached_nodes_[i]) { |
230 if (!node->IsDead()) nodes->push_back(node); | 208 if (!node->IsDead()) nodes->push_back(node); |
231 } | 209 } |
232 } | 210 } |
233 } | 211 } |
234 | 212 |
235 } // namespace compiler | 213 } // namespace compiler |
236 } // namespace internal | 214 } // namespace internal |
237 } // namespace v8 | 215 } // namespace v8 |
OLD | NEW |