summaryrefslogtreecommitdiff
path: root/deps/v8/src/runtime/runtime-strings.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/runtime/runtime-strings.cc')
-rw-r--r--deps/v8/src/runtime/runtime-strings.cc100
1 files changed, 74 insertions, 26 deletions
diff --git a/deps/v8/src/runtime/runtime-strings.cc b/deps/v8/src/runtime/runtime-strings.cc
index df2210c635..8bfde943dd 100644
--- a/deps/v8/src/runtime/runtime-strings.cc
+++ b/deps/v8/src/runtime/runtime-strings.cc
@@ -279,7 +279,7 @@ RUNTIME_FUNCTION(Runtime_StringLocaleCompare) {
}
-RUNTIME_FUNCTION(Runtime_SubString) {
+RUNTIME_FUNCTION(Runtime_SubStringRT) {
HandleScope scope(isolate);
DCHECK(args.length() == 3);
@@ -307,7 +307,13 @@ RUNTIME_FUNCTION(Runtime_SubString) {
}
-RUNTIME_FUNCTION(Runtime_StringAdd) {
+RUNTIME_FUNCTION(Runtime_SubString) {
+ SealHandleScope shs(isolate);
+ return __RT_impl_Runtime_SubStringRT(args, isolate);
+}
+
+
+RUNTIME_FUNCTION(Runtime_StringAddRT) {
HandleScope scope(isolate);
DCHECK(args.length() == 2);
CONVERT_ARG_HANDLE_CHECKED(String, str1, 0);
@@ -320,6 +326,12 @@ RUNTIME_FUNCTION(Runtime_StringAdd) {
}
+RUNTIME_FUNCTION(Runtime_StringAdd) {
+ SealHandleScope shs(isolate);
+ return __RT_impl_Runtime_StringAddRT(args, isolate);
+}
+
+
RUNTIME_FUNCTION(Runtime_InternalizeString) {
HandleScope handles(isolate);
RUNTIME_ASSERT(args.length() == 1);
@@ -414,7 +426,7 @@ RUNTIME_FUNCTION(Runtime_CharFromCode) {
}
-RUNTIME_FUNCTION(Runtime_StringCompare) {
+RUNTIME_FUNCTION(Runtime_StringCompareRT) {
HandleScope handle_scope(isolate);
DCHECK(args.length() == 2);
@@ -483,6 +495,12 @@ RUNTIME_FUNCTION(Runtime_StringCompare) {
}
+RUNTIME_FUNCTION(Runtime_StringCompare) {
+ SealHandleScope shs(isolate);
+ return __RT_impl_Runtime_StringCompareRT(args, isolate);
+}
+
+
RUNTIME_FUNCTION(Runtime_StringBuilderConcat) {
HandleScope scope(isolate);
DCHECK(args.length() == 3);
@@ -1203,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);
@@ -1229,13 +1269,13 @@ RUNTIME_FUNCTION(Runtime_FlattenString) {
}
-RUNTIME_FUNCTION(RuntimeReference_StringCharFromCode) {
+RUNTIME_FUNCTION(Runtime_StringCharFromCode) {
SealHandleScope shs(isolate);
return __RT_impl_Runtime_CharFromCode(args, isolate);
}
-RUNTIME_FUNCTION(RuntimeReference_StringCharAt) {
+RUNTIME_FUNCTION(Runtime_StringCharAt) {
SealHandleScope shs(isolate);
DCHECK(args.length() == 2);
if (!args[0]->IsString()) return Smi::FromInt(0);
@@ -1247,7 +1287,16 @@ RUNTIME_FUNCTION(RuntimeReference_StringCharAt) {
}
-RUNTIME_FUNCTION(RuntimeReference_OneByteSeqStringSetChar) {
+RUNTIME_FUNCTION(Runtime_OneByteSeqStringGetChar) {
+ SealHandleScope shs(isolate);
+ DCHECK(args.length() == 2);
+ CONVERT_ARG_CHECKED(SeqOneByteString, string, 0);
+ CONVERT_INT32_ARG_CHECKED(index, 1);
+ return Smi::FromInt(string->SeqOneByteStringGet(index));
+}
+
+
+RUNTIME_FUNCTION(Runtime_OneByteSeqStringSetChar) {
SealHandleScope shs(isolate);
DCHECK(args.length() == 3);
CONVERT_INT32_ARG_CHECKED(index, 0);
@@ -1258,7 +1307,16 @@ RUNTIME_FUNCTION(RuntimeReference_OneByteSeqStringSetChar) {
}
-RUNTIME_FUNCTION(RuntimeReference_TwoByteSeqStringSetChar) {
+RUNTIME_FUNCTION(Runtime_TwoByteSeqStringGetChar) {
+ SealHandleScope shs(isolate);
+ DCHECK(args.length() == 2);
+ CONVERT_ARG_CHECKED(SeqTwoByteString, string, 0);
+ CONVERT_INT32_ARG_CHECKED(index, 1);
+ return Smi::FromInt(string->SeqTwoByteStringGet(index));
+}
+
+
+RUNTIME_FUNCTION(Runtime_TwoByteSeqStringSetChar) {
SealHandleScope shs(isolate);
DCHECK(args.length() == 3);
CONVERT_INT32_ARG_CHECKED(index, 0);
@@ -1269,13 +1327,7 @@ RUNTIME_FUNCTION(RuntimeReference_TwoByteSeqStringSetChar) {
}
-RUNTIME_FUNCTION(RuntimeReference_StringCompare) {
- SealHandleScope shs(isolate);
- return __RT_impl_Runtime_StringCompare(args, isolate);
-}
-
-
-RUNTIME_FUNCTION(RuntimeReference_StringCharCodeAt) {
+RUNTIME_FUNCTION(Runtime_StringCharCodeAt) {
SealHandleScope shs(isolate);
DCHECK(args.length() == 2);
if (!args[0]->IsString()) return isolate->heap()->undefined_value();
@@ -1285,21 +1337,17 @@ RUNTIME_FUNCTION(RuntimeReference_StringCharCodeAt) {
}
-RUNTIME_FUNCTION(RuntimeReference_SubString) {
- SealHandleScope shs(isolate);
- return __RT_impl_Runtime_SubString(args, isolate);
-}
-
-
-RUNTIME_FUNCTION(RuntimeReference_StringAdd) {
- SealHandleScope shs(isolate);
- return __RT_impl_Runtime_StringAdd(args, isolate);
+RUNTIME_FUNCTION(Runtime_IsStringWrapperSafeForDefaultValueOf) {
+ UNIMPLEMENTED();
+ return NULL;
}
-RUNTIME_FUNCTION(RuntimeReference_IsStringWrapperSafeForDefaultValueOf) {
- UNIMPLEMENTED();
- return NULL;
+RUNTIME_FUNCTION(Runtime_StringGetLength) {
+ HandleScope scope(isolate);
+ DCHECK(args.length() == 1);
+ CONVERT_ARG_HANDLE_CHECKED(String, s, 0);
+ return Smi::FromInt(s->length());
}
}
} // namespace v8::internal