Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index 3939921bf7304378b13540fc4a1fda3f426216b3..a9d717c6a4eef2bbc307a6062bb33dfedeae17e2 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -3031,6 +3031,14 @@ bool String::Equals(String* other) { |
} |
+Handle<String> String::Flatten(Handle<String> string, PretenureFlag pretenure) { |
+ if (!string->IsConsString()) return string; |
+ Handle<ConsString> cons = Handle<ConsString>::cast(string); |
+ if (cons->IsFlat()) return handle(cons->first()); |
+ return SlowFlatten(cons, pretenure); |
+} |
+ |
+ |
MaybeObject* String::TryFlatten(PretenureFlag pretenure) { |
if (!StringShape(this).IsCons()) return this; |
ConsString* cons = ConsString::cast(this); |