Skip to content

Commit 88dc829

Browse files
rmacnak-googleCommit Queue
authored andcommitted
[vm] Fix clobbered THR/R14 in StoreReleaseLoadAcquire[1204] tests.
Also adjust expected disassembly. TEST=ci Cq-Include-Trybots: luci.dart.try:vm-tsan-linux-release-x64-try,vm-linux-debug-x64-try,vm-linux-release-x64-try Change-Id: I3949145b04c84d48d98fd1629ca98b7cce617410 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397440 Commit-Queue: Ryan Macnak <[email protected]> Reviewed-by: Alexander Aprelev <[email protected]>
1 parent af3bfaa commit 88dc829

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

runtime/vm/compiler/assembler/assembler_x64_test.cc

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6229,12 +6229,10 @@ IMMEDIATE_TEST(AddrImmRAXByte,
62296229
__ popq(RAX))
62306230

62316231
ASSEMBLER_TEST_GENERATE(StoreReleaseLoadAcquire, assembler) {
6232-
if (FLAG_target_thread_sanitizer) {
6233-
// On TSAN builds StoreRelease/LoadAcquire will do a runtime
6234-
// call to tell TSAN about our action.
6235-
__ MoveRegister(THR, CallingConventions::kArg2Reg);
6236-
}
6237-
6232+
// On TSAN builds StoreRelease/LoadAcquire will do a runtime
6233+
// call to tell TSAN about our action.
6234+
__ pushq(THR);
6235+
__ MoveRegister(THR, CallingConventions::kArg2Reg);
62386236
__ pushq(RCX);
62396237
__ xorq(RCX, RCX);
62406238
__ pushq(RCX);
@@ -6299,6 +6297,7 @@ ASSEMBLER_TEST_GENERATE(StoreReleaseLoadAcquire, assembler) {
62996297
__ LoadAcquireFromOffset(CallingConventions::kReturnReg, RSP, 0);
63006298
__ popq(RCX);
63016299
__ popq(RCX);
6300+
__ popq(THR);
63026301
__ ret();
63036302
}
63046303

@@ -6308,12 +6307,10 @@ ASSEMBLER_TEST_RUN(StoreReleaseLoadAcquire, test) {
63086307
}
63096308

63106309
ASSEMBLER_TEST_GENERATE(StoreReleaseLoadAcquire1024, assembler) {
6311-
if (FLAG_target_thread_sanitizer) {
6312-
// On TSAN builds StoreRelease/LoadAcquire will do a runtime
6313-
// call to tell TSAN about our action.
6314-
__ MoveRegister(THR, CallingConventions::kArg2Reg);
6315-
}
6316-
6310+
// On TSAN builds StoreRelease/LoadAcquire will do a runtime
6311+
// call to tell TSAN about our action.
6312+
__ pushq(THR);
6313+
__ MoveRegister(THR, CallingConventions::kArg2Reg);
63176314
__ pushq(RCX);
63186315
__ xorq(RCX, RCX);
63196316
__ pushq(RCX);
@@ -6323,6 +6320,7 @@ ASSEMBLER_TEST_GENERATE(StoreReleaseLoadAcquire1024, assembler) {
63236320
__ addq(RSP, Immediate(1024));
63246321
__ popq(RCX);
63256322
__ popq(RCX);
6323+
__ popq(THR);
63266324
__ ret();
63276325
}
63286326

@@ -6331,6 +6329,8 @@ ASSEMBLER_TEST_RUN(StoreReleaseLoadAcquire1024, test) {
63316329
EXPECT_EQ(123, res);
63326330
if (!FLAG_target_thread_sanitizer) {
63336331
EXPECT_DISASSEMBLY_NOT_WINDOWS(
6332+
"push thr\n"
6333+
"movq thr,rsi\n"
63346334
"push rcx\n"
63356335
"xorq rcx,rcx\n"
63366336
"push rcx\n"
@@ -6340,6 +6340,7 @@ ASSEMBLER_TEST_RUN(StoreReleaseLoadAcquire1024, test) {
63406340
"addq rsp,0x400\n"
63416341
"pop rcx\n"
63426342
"pop rcx\n"
6343+
"pop thr\n"
63436344
"ret\n");
63446345
}
63456346
}

0 commit comments

Comments
 (0)