Index: src/compiler/js-graph.cc |
diff --git a/src/compiler/js-graph.cc b/src/compiler/js-graph.cc |
index 9b6b187c6aab2bf203e43e5a3b478680e794678d..9db67b5f7c30126ee940e2f885ab0feb4bd087f3 100644 |
--- a/src/compiler/js-graph.cc |
+++ b/src/compiler/js-graph.cc |
@@ -11,8 +11,11 @@ namespace v8 { |
namespace internal { |
namespace compiler { |
-Node* JSGraph::ImmovableHeapConstant(Handle<HeapObject> object) { |
- return graph()->NewNode(common()->HeapConstant(object)); |
+Node* JSGraph::ImmovableHeapConstant(Handle<HeapObject> value) { |
+ if (value->IsConsString()) { |
+ value = String::Flatten(Handle<String>::cast(value), TENURED); |
+ } |
+ return graph()->NewNode(common()->HeapConstant(value)); |
} |
@@ -78,7 +81,7 @@ Node* JSGraph::HeapConstant(Handle<HeapObject> value) { |
// TODO(titzer): We could also match against the addresses of immortable |
// immovables here, even without access to the heap, thus always |
// canonicalizing references to them. |
- return graph()->NewNode(common()->HeapConstant(value)); |
+ return ImmovableHeapConstant(value); |
} |