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

Unified Diff: runtime/vm/assembler_ia32_test.cc

Issue 14122002: Use rep_movsb for copying one-byte strings in substring intrinsic. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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 | « runtime/vm/assembler_ia32.cc ('k') | runtime/vm/assembler_x64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_ia32_test.cc
===================================================================
--- runtime/vm/assembler_ia32_test.cc (revision 21290)
+++ runtime/vm/assembler_ia32_test.cc (working copy)
@@ -2521,6 +2521,35 @@
}
+ASSEMBLER_TEST_GENERATE(TestRepMovsBytes, assembler) {
+ // Preserve registers.
+ __ pushl(ESI);
+ __ pushl(EDI);
+ __ pushl(ECX);
+ __ movl(ESI, Address(ESP, 4 * kWordSize)); // from.
+ __ movl(EDI, Address(ESP, 5 * kWordSize)); // to.
+ __ movl(ECX, Address(ESP, 6 * kWordSize)); // count.
+ __ rep_movsb();
+ __ popl(ECX);
+ __ popl(EDI);
+ __ popl(ESI);
+ __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(TestRepMovsBytes, test) {
+ const char* from = "0123456789";
+ const char* to = new char[10];
+ typedef void (*TestRepMovsBytes)(const char* from, const char* to, int count);
+ reinterpret_cast<TestRepMovsBytes>(test->entry())(from, to, 10);
+ EXPECT_EQ(to[0], '0');
+ for (int i = 0; i < 10; i++) {
+ EXPECT_EQ(from[i], to[i]);
+ }
+ delete [] to;
+}
+
+
// Called from assembler_test.cc.
ASSEMBLER_TEST_GENERATE(StoreIntoObject, assembler) {
__ pushl(CTX);
@@ -2536,7 +2565,6 @@
__ ret();
}
-
} // namespace dart
#endif // defined TARGET_ARCH_IA32
« no previous file with comments | « runtime/vm/assembler_ia32.cc ('k') | runtime/vm/assembler_x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698