Revert "cppgc: Fix test IteratePointersFindsCalleeSavedRegisters"
This reverts commit 4ff37d3a3f
.
Reason for revert: Fails with stress_incremental_marking - https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20TSAN%20-%20stress-incremental-marking/3049/blamelist
Original change's description:
> cppgc: Fix test IteratePointersFindsCalleeSavedRegisters
>
> call the compiler can clobber the tested register. Moving this tricky
> part into a noninlinable lambda allows to reduce pressure from the
> register allocator and thereby avoid such clobbering.
>
> Subtle: between the first inline assembly and the IteratePointers()
> Change-Id: Ibeca8fa2f4fd54d07c2f585a4e876504a6a991b7
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2859843
> Commit-Queue: Anton Bikineev <bikineev@chromium.org>
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#74280}
Change-Id: Ib257e30273f382d19ec922e2fa3279c39e918cde
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2859847
Auto-Submit: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#74282}
This commit is contained in:
parent
19b705682c
commit
14bc096e31
@ -308,8 +308,6 @@ TEST_F(GCStackTest, IteratePointersFindsParameterNesting8) {
|
|||||||
|
|
||||||
#ifdef FOR_ALL_CALLEE_SAVED_REGS
|
#ifdef FOR_ALL_CALLEE_SAVED_REGS
|
||||||
|
|
||||||
// Note: the test is brittle and can fail on some archs/configurations (see
|
|
||||||
// below).
|
|
||||||
TEST_F(GCStackTest, IteratePointersFindsCalleeSavedRegisters) {
|
TEST_F(GCStackTest, IteratePointersFindsCalleeSavedRegisters) {
|
||||||
auto scanner = std::make_unique<StackScanner>();
|
auto scanner = std::make_unique<StackScanner>();
|
||||||
|
|
||||||
@ -329,32 +327,17 @@ TEST_F(GCStackTest, IteratePointersFindsCalleeSavedRegisters) {
|
|||||||
// Moves |local_scanner->needle()| into a callee-saved register, leaving the
|
// Moves |local_scanner->needle()| into a callee-saved register, leaving the
|
||||||
// callee-saved register as the only register referencing the needle.
|
// callee-saved register as the only register referencing the needle.
|
||||||
// (Ignoring implementation-dependent dirty registers/stack.)
|
// (Ignoring implementation-dependent dirty registers/stack.)
|
||||||
//
|
#define KEEP_ALIVE_FROM_CALLEE_SAVED(reg) \
|
||||||
// Subtle: between the first inline assembly and the IteratePointers() call the
|
local_scanner->Reset(); \
|
||||||
// compiler can clobber the tested register. Moving this tricky part into a
|
/* This moves the temporary into the calee-saved register. */ \
|
||||||
// noninlinable lambda allows to reduce pressure from the register allocator and
|
asm("mov %0, %%" reg : : "r"(local_scanner->needle()) : reg); \
|
||||||
// thereby avoid such clobbering.
|
/* Register is unprotected from here till the actual invocation. */ \
|
||||||
#define KEEP_ALIVE_FROM_CALLEE_SAVED(reg) \
|
local_stack->IteratePointers(local_scanner); \
|
||||||
{ \
|
EXPECT_TRUE(local_scanner->found()) \
|
||||||
local_scanner->Reset(); \
|
<< "pointer in callee-saved register not found. register: " << reg \
|
||||||
const bool found = [local_scanner, local_stack]() V8_NOINLINE { \
|
<< std::endl; \
|
||||||
/* This moves the temporary into the callee-saved register. */ \
|
/* Clear out the register again */ \
|
||||||
asm volatile("mov %0, %%" reg \
|
asm("mov $0, %%" reg : : : reg);
|
||||||
: \
|
|
||||||
: "r"(local_scanner->needle()) \
|
|
||||||
: "memory", reg); \
|
|
||||||
/* Register is unprotected from here till the actual invocation. The \
|
|
||||||
* compiler is free to clobber the register which makes the test \
|
|
||||||
* fail. */ \
|
|
||||||
local_stack->IteratePointers(local_scanner); \
|
|
||||||
/* Clear out the register again */ \
|
|
||||||
asm volatile("mov $0, %%" reg : : : "memory", reg); \
|
|
||||||
return local_scanner->found(); \
|
|
||||||
}(); \
|
|
||||||
EXPECT_TRUE(found) \
|
|
||||||
<< "pointer in callee-saved register not found. register: " << reg \
|
|
||||||
<< std::endl; \
|
|
||||||
}
|
|
||||||
|
|
||||||
FOR_ALL_CALLEE_SAVED_REGS(KEEP_ALIVE_FROM_CALLEE_SAVED)
|
FOR_ALL_CALLEE_SAVED_REGS(KEEP_ALIVE_FROM_CALLEE_SAVED)
|
||||||
#undef KEEP_ALIVE_FROM_CALLEE_SAVED
|
#undef KEEP_ALIVE_FROM_CALLEE_SAVED
|
||||||
|
Loading…
Reference in New Issue
Block a user