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/compiler/js-graph.h" | 5 #include "src/compiler/js-graph.h" |
6 #include "src/compiler/node-properties-inl.h" | 6 #include "src/compiler/node-properties-inl.h" |
7 #include "src/compiler/typer.h" | 7 #include "src/compiler/typer.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 | 191 |
192 | 192 |
193 Node* JSGraph::ExternalConstant(ExternalReference reference) { | 193 Node* JSGraph::ExternalConstant(ExternalReference reference) { |
194 Node** loc = cache_.FindExternalConstant(reference); | 194 Node** loc = cache_.FindExternalConstant(reference); |
195 if (*loc == NULL) { | 195 if (*loc == NULL) { |
196 *loc = NewNode(common()->ExternalConstant(reference)); | 196 *loc = NewNode(common()->ExternalConstant(reference)); |
197 } | 197 } |
198 return *loc; | 198 return *loc; |
199 } | 199 } |
200 | 200 |
| 201 |
| 202 void JSGraph::GetCachedNodes(NodeVector* nodes) { |
| 203 cache_.GetCachedNodes(nodes); |
| 204 SetOncePointer<Node>* ptrs[] = { |
| 205 &c_entry_stub_constant_, &undefined_constant_, &the_hole_constant_, |
| 206 &true_constant_, &false_constant_, &null_constant_, |
| 207 &zero_constant_, &one_constant_, &nan_constant_}; |
| 208 for (size_t i = 0; i < arraysize(ptrs); i++) { |
| 209 if (ptrs[i]->is_set()) nodes->push_back(ptrs[i]->get()); |
| 210 } |
| 211 } |
| 212 |
201 } // namespace compiler | 213 } // namespace compiler |
202 } // namespace internal | 214 } // namespace internal |
203 } // namespace v8 | 215 } // namespace v8 |
OLD | NEW |