Commit 7d23e5ab authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

cppgc: Remove conservative stack scan guard

Supported HW architectures:
ia32, x64, arm, arm64, ppc64, s390, mips, mips64

Compiler support:
- clang/gcc: all
- msvc tools: ia32, x64, arm64

Thanks all for porting!

Bug: chromium:1056170
Change-Id: I26ea7d727dc6d90929941668b8f115bdbaf226ab
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2153210
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarAnton Bikineev <bikineev@chromium.org>
Reviewed-by: 's avatarOmer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67203}
parent c66cd826
......@@ -351,21 +351,7 @@ config("libbase_config") {
# This config should be applied to code using the cppgc_base.
config("cppgc_base_config") {
# Assume is_clang = false means GCC or other compilers that are compatible
# with gas inline assembly on non-Windows builds. Cross builds for
# Linux->Windows are covered as they use clang.
defines = []
if (is_clang || !is_win) {
if (target_cpu == "x64" || target_cpu == "x86" || target_cpu == "arm" ||
target_cpu == "arm64" || target_cpu == "ppc64" ||
target_cpu == "s390x" || target_cpu == "mipsel" ||
target_cpu == "mips64el") {
defines += [ "CPPGC_SUPPORTS_CONSERVATIVE_STACK_SCAN" ]
}
} else if (is_win) {
# Assume that non-clang builds on Windows use native tools.
defines += [ "CPPGC_SUPPORTS_CONSERVATIVE_STACK_SCAN" ]
}
if (cppgc_enable_object_names) {
defines += [ "CPPGC_SUPPORTS_OBJECT_NAMES" ]
}
......
......@@ -63,8 +63,6 @@ void IterateAsanFakeFrameIfNecessary(StackVisitor* visitor,
#endif // V8_USE_ADDRESS_SANITIZER
#ifdef CPPGC_SUPPORTS_CONSERVATIVE_STACK_SCAN
void IterateSafeStackIfNecessary(StackVisitor* visitor) {
#if defined(__has_feature)
#if __has_feature(safe_stack)
......@@ -118,19 +116,13 @@ void IteratePointersImpl(const Stack* stack, StackVisitor* visitor,
}
}
#endif // CPPGC_SUPPORTS_CONSERVATIVE_STACK_SCAN
} // namespace
void Stack::IteratePointers(StackVisitor* visitor) const {
#ifdef CPPGC_SUPPORTS_CONSERVATIVE_STACK_SCAN
PushAllRegistersAndIterateStack(this, visitor, &IteratePointersImpl);
// No need to deal with callee-saved registers as they will be kept alive by
// the regular conservative stack iteration.
IterateSafeStackIfNecessary(visitor);
#else // !CPPGC_SUPPORTS_CONSERVATIVE_STACK_SCAN
FATAL("Conservative stack scan not supported on current platform.");
#endif // !CPPGC_SUPPORTS_CONSERVATIVE_STACK_SCAN
}
} // namespace internal
......
......@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifdef CPPGC_SUPPORTS_CONSERVATIVE_STACK_SCAN
#include "src/heap/cppgc/heap.h"
#include "include/cppgc/allocation.h"
#include "test/unittests/heap/cppgc/tests.h"
......@@ -72,5 +70,3 @@ TEST_F(GCHeapTest, ConservaitveGCRetainsObjectOnStack) {
} // namespace internal
} // namespace cppgc
#endif // CPPGC_SUPPORTS_CONSERVATIVE_STACK_SCAN
......@@ -46,8 +46,6 @@ TEST_F(GCStackTest, IsOnStackForHeapValue) {
EXPECT_FALSE(GetStack()->IsOnStack(dummy.get()));
}
#ifdef CPPGC_SUPPORTS_CONSERVATIVE_STACK_SCAN
namespace {
class StackScanner final : public StackVisitor {
......@@ -355,7 +353,5 @@ TEST_F(GCStackTest, StackAlignment) {
}
#endif // V8_OS_LINUX && (V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64)
#endif // CPPGC_SUPPORTS_CONSERVATIVE_STACK_SCAN
} // namespace internal
} // namespace cppgc
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment