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 { |
11 namespace internal { | 11 namespace internal { |
12 namespace compiler { | 12 namespace compiler { |
13 | 13 |
14 Node* JSGraph::ImmovableHeapConstant(Handle<HeapObject> value) { | 14 Node* JSGraph::ImmovableHeapConstant(Handle<HeapObject> value) { |
15 if (value->IsConsString()) { | 15 // TODO(bmeurer): Flatten cons strings here before we canonicalize them? |
16 value = String::Flatten(Handle<String>::cast(value), TENURED); | |
17 } | |
18 return graph()->NewNode(common()->HeapConstant(value)); | 16 return graph()->NewNode(common()->HeapConstant(value)); |
19 } | 17 } |
20 | 18 |
21 | 19 |
22 #define CACHED(name, expr) \ | 20 #define CACHED(name, expr) \ |
23 cached_nodes_[name] ? cached_nodes_[name] : (cached_nodes_[name] = (expr)) | 21 cached_nodes_[name] ? cached_nodes_[name] : (cached_nodes_[name] = (expr)) |
24 | 22 |
25 | 23 |
26 Node* JSGraph::CEntryStubConstant(int result_size) { | 24 Node* JSGraph::CEntryStubConstant(int result_size) { |
27 if (result_size == 1) { | 25 if (result_size == 1) { |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 for (size_t i = 0; i < arraysize(cached_nodes_); i++) { | 202 for (size_t i = 0; i < arraysize(cached_nodes_); i++) { |
205 if (Node* node = cached_nodes_[i]) { | 203 if (Node* node = cached_nodes_[i]) { |
206 if (!node->IsDead()) nodes->push_back(node); | 204 if (!node->IsDead()) nodes->push_back(node); |
207 } | 205 } |
208 } | 206 } |
209 } | 207 } |
210 | 208 |
211 } // namespace compiler | 209 } // namespace compiler |
212 } // namespace internal | 210 } // namespace internal |
213 } // namespace v8 | 211 } // namespace v8 |
OLD | NEW |