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

Unified Diff: test/cctest/compiler/test-run-intrinsics.cc

Issue 1013753016: Add full TurboFan support for accessing SeqString contents. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed return value 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-strings.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-run-intrinsics.cc
diff --git a/test/cctest/compiler/test-run-intrinsics.cc b/test/cctest/compiler/test-run-intrinsics.cc
index 3b8e1ded695b5f9c167d1138ceed6d671a7824f8..65a180c11a054c90df8faf6cda636f55a9359202 100644
--- a/test/cctest/compiler/test-run-intrinsics.cc
+++ b/test/cctest/compiler/test-run-intrinsics.cc
@@ -176,6 +176,39 @@ TEST(ObjectEquals) {
}
+TEST(OneByteSeqStringGetChar) {
+ FLAG_turbo_deoptimization = true;
+ FunctionTester T("(function(a,b) { return %_OneByteSeqStringGetChar(a,b); })",
+ flags);
+
+ Handle<SeqOneByteString> string =
+ T.main_isolate()->factory()->NewRawOneByteString(3).ToHandleChecked();
+ string->SeqOneByteStringSet(0, 'b');
+ string->SeqOneByteStringSet(1, 'a');
+ string->SeqOneByteStringSet(2, 'r');
+ T.CheckCall(T.Val('b'), string, T.Val(0.0));
+ T.CheckCall(T.Val('a'), string, T.Val(1));
+ T.CheckCall(T.Val('r'), string, T.Val(2));
+}
+
+
+TEST(OneByteSeqStringSetChar) {
+ FLAG_turbo_deoptimization = true;
+ FunctionTester T("(function(a,b) { %_OneByteSeqStringSetChar(a,88,b); })",
+ flags);
+
+ Handle<SeqOneByteString> string =
+ T.main_isolate()->factory()->NewRawOneByteString(3).ToHandleChecked();
+ string->SeqOneByteStringSet(0, 'b');
+ string->SeqOneByteStringSet(1, 'a');
+ string->SeqOneByteStringSet(2, 'r');
+ T.Call(T.Val(1), string);
+ CHECK_EQ('b', string->SeqOneByteStringGet(0));
+ CHECK_EQ('X', string->SeqOneByteStringGet(1));
+ CHECK_EQ('r', string->SeqOneByteStringGet(2));
+}
+
+
TEST(SetValueOf) {
FLAG_turbo_deoptimization = true;
FunctionTester T("(function(a,b) { return %_SetValueOf(a,b); })", flags);
@@ -247,6 +280,39 @@ TEST(SubString) {
}
+TEST(TwoByteSeqStringGetChar) {
+ FLAG_turbo_deoptimization = true;
+ FunctionTester T("(function(a,b) { return %_TwoByteSeqStringGetChar(a,b); })",
+ flags);
+
+ Handle<SeqTwoByteString> string =
+ T.main_isolate()->factory()->NewRawTwoByteString(3).ToHandleChecked();
+ string->SeqTwoByteStringSet(0, 'b');
+ string->SeqTwoByteStringSet(1, 'a');
+ string->SeqTwoByteStringSet(2, 'r');
+ T.CheckCall(T.Val('b'), string, T.Val(0.0));
+ T.CheckCall(T.Val('a'), string, T.Val(1));
+ T.CheckCall(T.Val('r'), string, T.Val(2));
+}
+
+
+TEST(TwoByteSeqStringSetChar) {
+ FLAG_turbo_deoptimization = true;
+ FunctionTester T("(function(a,b) { %_TwoByteSeqStringSetChar(a,88,b); })",
+ flags);
+
+ Handle<SeqTwoByteString> string =
+ T.main_isolate()->factory()->NewRawTwoByteString(3).ToHandleChecked();
+ string->SeqTwoByteStringSet(0, 'b');
+ string->SeqTwoByteStringSet(1, 'a');
+ string->SeqTwoByteStringSet(2, 'r');
+ T.Call(T.Val(1), string);
+ CHECK_EQ('b', string->SeqTwoByteStringGet(0));
+ CHECK_EQ('X', string->SeqTwoByteStringGet(1));
+ CHECK_EQ('r', string->SeqTwoByteStringGet(2));
+}
+
+
TEST(ValueOf) {
FLAG_turbo_deoptimization = true;
FunctionTester T("(function(a) { return %_ValueOf(a); })", flags);
« no previous file with comments | « src/runtime/runtime-strings.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698