Index: src/compiler/js-context-specialization.cc |
diff --git a/src/compiler/js-context-specialization.cc b/src/compiler/js-context-specialization.cc |
index 0ad25e179d7ecea6f5d1c7718a12e5537fdeb751..a4f3ff49864fd9815c6e47bf9265c343b09019fa 100644 |
--- a/src/compiler/js-context-specialization.cc |
+++ b/src/compiler/js-context-specialization.cc |
@@ -95,6 +95,9 @@ Reduction JSContextSpecialization::ReduceJSLoadContext(Node* node) { |
// Success. The context load can be replaced with the constant. |
// TODO(titzer): record the specialization for sharing code across multiple |
// contexts that have the same value in the corresponding context slot. |
+ if (value->IsConsString()) { |
+ value = String::Flatten(Handle<String>::cast(value), TENURED); |
+ } |
Node* constant = jsgraph_->Constant(value); |
ReplaceWithValue(node, constant); |
return Replace(constant); |