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

Unified Diff: runtime/vm/assembler_x64_test.cc

Issue 2965723002: VM: Reland Inline instance object hash code into object header on 64bit. (Closed)
Patch Set: Fix snapshot incompatibility that sank Flutter Gallery Created 3 years, 6 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
Index: runtime/vm/assembler_x64_test.cc
diff --git a/runtime/vm/assembler_x64_test.cc b/runtime/vm/assembler_x64_test.cc
index 5a9a8128547d45c8a9f36fdbd9b6c35435acb30d..8c04d7d4f9afb17d219c5681d8ca335ed501f33f 100644
--- a/runtime/vm/assembler_x64_test.cc
+++ b/runtime/vm/assembler_x64_test.cc
@@ -1749,7 +1749,7 @@ ASSEMBLER_TEST_GENERATE(CompareSwapEQ, assembler) {
__ movq(RAX, Immediate(4));
__ movq(RCX, Immediate(0));
__ movq(Address(RSP, 0), RAX);
- __ lock_cmpxchgq(Address(RSP, 0), RCX);
+ __ LockCmpxchgq(Address(RSP, 0), RCX);
__ popq(RAX);
__ ret();
}
@@ -1767,7 +1767,7 @@ ASSEMBLER_TEST_GENERATE(CompareSwapNEQ, assembler) {
__ movq(RAX, Immediate(2));
__ movq(RCX, Immediate(4));
__ movq(Address(RSP, 0), RCX);
- __ lock_cmpxchgq(Address(RSP, 0), RCX);
+ __ LockCmpxchgq(Address(RSP, 0), RCX);
__ popq(RAX);
__ ret();
}
@@ -1779,6 +1779,47 @@ ASSEMBLER_TEST_RUN(CompareSwapNEQ, test) {
}
+ASSEMBLER_TEST_GENERATE(CompareSwapEQ32, assembler) {
+ __ movq(RAX, Immediate(0x100000000));
+ __ pushq(RAX);
+ __ movq(RAX, Immediate(4));
+ __ movq(RCX, Immediate(0));
+ // 32 bit store of 4.
+ __ movl(Address(RSP, 0), RAX);
+ // Compare 32 bit memory location with RAX (4) and write 0.
+ __ LockCmpxchgl(Address(RSP, 0), RCX);
+ // Pop unchanged high word and zeroed out low word.
+ __ popq(RAX);
+ __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(CompareSwapEQ32, test) {
+ typedef intptr_t (*CompareSwapEQ32Code)();
+ EXPECT_EQ(0x100000000,
+ reinterpret_cast<CompareSwapEQ32Code>(test->entry())());
+}
+
+
+ASSEMBLER_TEST_GENERATE(CompareSwapNEQ32, assembler) {
+ __ movq(RAX, Immediate(0x100000000));
+ __ pushq(RAX);
+ __ movq(RAX, Immediate(2));
+ __ movq(RCX, Immediate(4));
+ __ movl(Address(RSP, 0), RCX);
+ __ LockCmpxchgl(Address(RSP, 0), RCX);
+ __ popq(RAX);
+ __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(CompareSwapNEQ32, test) {
+ typedef intptr_t (*CompareSwapNEQ32Code)();
+ EXPECT_EQ(0x100000004l,
+ reinterpret_cast<CompareSwapNEQ32Code>(test->entry())());
+}
+
+
ASSEMBLER_TEST_GENERATE(Exchange, assembler) {
__ movq(RAX, Immediate(kLargeConstant));
__ movq(RDX, Immediate(kAnotherLargeConstant));
« no previous file with comments | « runtime/vm/assembler_x64.cc ('k') | runtime/vm/become.h » ('j') | runtime/vm/intrinsifier.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698