Index: src/factory.cc |
diff --git a/src/factory.cc b/src/factory.cc |
index 6ea782760fa71e47aabb2420b00e233361605a09..1cdce60874abfe6671852f1c725202a7f27efc61 100644 |
--- a/src/factory.cc |
+++ b/src/factory.cc |
@@ -538,10 +538,30 @@ MaybeHandle<String> Factory::NewConsString(Handle<String> left, |
NewRawTwoByteString(length).ToHandleChecked(), left, right); |
} |
- Handle<Map> map = (is_one_byte || is_one_byte_data_in_two_byte_string) |
- ? cons_one_byte_string_map() |
- : cons_string_map(); |
- Handle<ConsString> result = New<ConsString>(map, NEW_SPACE); |
+ return (is_one_byte || is_one_byte_data_in_two_byte_string) |
+ ? NewOneByteConsString(length, left, right) |
+ : NewTwoByteConsString(length, left, right); |
+} |
+ |
+ |
+MaybeHandle<String> Factory::NewOneByteConsString(int length, |
+ Handle<String> left, |
+ Handle<String> right) { |
+ return NewRawConsString(cons_one_byte_string_map(), length, left, right); |
+} |
+ |
+ |
+MaybeHandle<String> Factory::NewTwoByteConsString(int length, |
+ Handle<String> left, |
+ Handle<String> right) { |
+ return NewRawConsString(cons_string_map(), length, left, right); |
+} |
+ |
+ |
+MaybeHandle<String> Factory::NewRawConsString(Handle<Map> map, int length, |
+ Handle<String> left, |
+ Handle<String> right) { |
+ Handle<ConsString> result = New<ConsString>(map, NEW_SPACE); |
DisallowHeapAllocation no_gc; |
WriteBarrierMode mode = result->GetWriteBarrierMode(no_gc); |