Index: src/runtime.cc |
diff --git a/src/runtime.cc b/src/runtime.cc |
index f808d1060cf4a4b7c00b5a6b47685742bcd76e6b..283a772331abf7106dde9fa3f6ace253639d2e6e 100644 |
--- a/src/runtime.cc |
+++ b/src/runtime.cc |
@@ -3547,6 +3547,10 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_SubString) { |
RUNTIME_ASSERT(start >= 0); |
RUNTIME_ASSERT(end <= value->length()); |
isolate->counters()->sub_string_runtime()->Increment(); |
+ if (end - start == 1) { |
+ return isolate->heap()->LookupSingleCharacterStringFromCode( |
+ value->Get(start)); |
+ } |
return value->SubString(start, end); |
} |