Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(671)

Unified Diff: src/runtime/runtime-strings.cc

Issue 1041723002: Added %_NewConsString intrinsic. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime/runtime.h ('k') | test/cctest/compiler/test-run-intrinsics.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/runtime/runtime.h ('k') | test/cctest/compiler/test-run-intrinsics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698