Index: src/compiler/js-native-context-specialization.cc |
diff --git a/src/compiler/js-native-context-specialization.cc b/src/compiler/js-native-context-specialization.cc |
index de22145e1fb8b3e0aef25cf96bd28fa784f54ab1..db38c63048085d70648727e58449017080eb3dc8 100644 |
--- a/src/compiler/js-native-context-specialization.cc |
+++ b/src/compiler/js-native-context-specialization.cc |
@@ -695,8 +695,9 @@ Reduction JSNativeContextSpecialization::ReduceKeyedAccess( |
NumberMatcher mindex(index); |
if (mindex.IsInteger() && mindex.IsInRange(0.0, string->length() - 1)) { |
// Constant-fold the {index} access to {string}. |
- Node* value = |
- jsgraph()->Constant(string->Get(static_cast<int>(mindex.Value()))); |
+ Node* value = jsgraph()->HeapConstant( |
+ factory()->LookupSingleCharacterStringFromCode( |
+ string->Get(static_cast<int>(mindex.Value())))); |
ReplaceWithValue(node, value, effect, control); |
return Replace(value); |
} else if (flags() & kDeoptimizationEnabled) { |