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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 | 235 |
236 | 236 |
237 Node* JSGraph::Float64Constant(double value) { | 237 Node* JSGraph::Float64Constant(double value) { |
238 Node** loc = cache_.FindFloat64Constant(value); | 238 Node** loc = cache_.FindFloat64Constant(value); |
239 if (*loc == nullptr) { | 239 if (*loc == nullptr) { |
240 *loc = graph()->NewNode(common()->Float64Constant(value)); | 240 *loc = graph()->NewNode(common()->Float64Constant(value)); |
241 } | 241 } |
242 return *loc; | 242 return *loc; |
243 } | 243 } |
244 | 244 |
| 245 Node* JSGraph::PointerConstant(intptr_t value) { |
| 246 Node** loc = cache_.FindPointerConstant(value); |
| 247 if (*loc == nullptr) { |
| 248 *loc = graph()->NewNode(common()->PointerConstant(value)); |
| 249 } |
| 250 return *loc; |
| 251 } |
245 | 252 |
246 Node* JSGraph::ExternalConstant(ExternalReference reference) { | 253 Node* JSGraph::ExternalConstant(ExternalReference reference) { |
247 Node** loc = cache_.FindExternalConstant(reference); | 254 Node** loc = cache_.FindExternalConstant(reference); |
248 if (*loc == nullptr) { | 255 if (*loc == nullptr) { |
249 *loc = graph()->NewNode(common()->ExternalConstant(reference)); | 256 *loc = graph()->NewNode(common()->ExternalConstant(reference)); |
250 } | 257 } |
251 return *loc; | 258 return *loc; |
252 } | 259 } |
253 | 260 |
254 | 261 |
(...skipping 15 matching lines...) Expand all Loading... |
270 for (size_t i = 0; i < arraysize(cached_nodes_); i++) { | 277 for (size_t i = 0; i < arraysize(cached_nodes_); i++) { |
271 if (Node* node = cached_nodes_[i]) { | 278 if (Node* node = cached_nodes_[i]) { |
272 if (!node->IsDead()) nodes->push_back(node); | 279 if (!node->IsDead()) nodes->push_back(node); |
273 } | 280 } |
274 } | 281 } |
275 } | 282 } |
276 | 283 |
277 } // namespace compiler | 284 } // namespace compiler |
278 } // namespace internal | 285 } // namespace internal |
279 } // namespace v8 | 286 } // namespace v8 |
OLD | NEW |