Index: src/runtime/runtime-strings.cc |
diff --git a/src/runtime/runtime-strings.cc b/src/runtime/runtime-strings.cc |
index 646e7be20f93efdbd216f0f2ff24c5d648fc1fb6..8bfde943dd0e29e52850bba840a16acc251eabfa 100644 |
--- a/src/runtime/runtime-strings.cc |
+++ b/src/runtime/runtime-strings.cc |
@@ -1221,6 +1221,28 @@ RUNTIME_FUNCTION(Runtime_NewString) { |
} |
+RUNTIME_FUNCTION(Runtime_NewConsString) { |
+ HandleScope scope(isolate); |
+ DCHECK(args.length() == 4); |
+ CONVERT_INT32_ARG_CHECKED(length, 0); |
+ CONVERT_BOOLEAN_ARG_CHECKED(is_one_byte, 1); |
+ CONVERT_ARG_HANDLE_CHECKED(String, left, 2); |
+ CONVERT_ARG_HANDLE_CHECKED(String, right, 3); |
+ |
+ Handle<String> result; |
+ if (is_one_byte) { |
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
+ isolate, result, |
+ isolate->factory()->NewOneByteConsString(length, left, right)); |
+ } else { |
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
+ isolate, result, |
+ isolate->factory()->NewTwoByteConsString(length, left, right)); |
+ } |
+ return *result; |
+} |
+ |
+ |
RUNTIME_FUNCTION(Runtime_StringEquals) { |
HandleScope handle_scope(isolate); |
DCHECK(args.length() == 2); |