Commit d6fa333d authored by Michael Lippautz's avatar Michael Lippautz Committed by V8 LUCI CQ

cppgc: Replace SetUp/TearDown with ctor/dtor

Change-Id: I8a8ce7008887f807726ddafdbd8048b64e1e1b84
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2867472
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: 's avatarAnton Bikineev <bikineev@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74332}
parent d4c3c1a5
...@@ -22,18 +22,14 @@ constexpr GCInfo GetEmptyGCInfo() { return {nullptr, nullptr, nullptr, false}; } ...@@ -22,18 +22,14 @@ constexpr GCInfo GetEmptyGCInfo() { return {nullptr, nullptr, nullptr, false}; }
class GCInfoTableTest : public ::testing::Test { class GCInfoTableTest : public ::testing::Test {
public: public:
GCInfoTableTest() : table_(std::make_unique<GCInfoTable>(&page_allocator_)) {}
GCInfoIndex RegisterNewGCInfoForTesting(const GCInfo& info) { GCInfoIndex RegisterNewGCInfoForTesting(const GCInfo& info) {
// Unused registered index will result in registering a new index. // Unused registered index will result in registering a new index.
std::atomic<GCInfoIndex> registered_index{0}; std::atomic<GCInfoIndex> registered_index{0};
return table().RegisterNewGCInfo(registered_index, info); return table().RegisterNewGCInfo(registered_index, info);
} }
void SetUp() override {
table_ = std::make_unique<GCInfoTable>(&page_allocator_);
}
void TearDown() override { table_.reset(); }
GCInfoTable& table() { return *table_; } GCInfoTable& table() { return *table_; }
const GCInfoTable& table() const { return *table_; } const GCInfoTable& table() const { return *table_; }
......
...@@ -24,12 +24,9 @@ using heap::base::StackVisitor; ...@@ -24,12 +24,9 @@ using heap::base::StackVisitor;
namespace { namespace {
class GCStackTest : public ::testing::Test { class GCStackTest : public ::testing::Test {
protected: public:
void SetUp() override { GCStackTest()
stack_.reset(new Stack(v8::base::Stack::GetStackStart())); : stack_(std::make_unique<Stack>(v8::base::Stack::GetStackStart())) {}
}
void TearDown() override { stack_.reset(); }
Stack* GetStack() const { return stack_.get(); } Stack* GetStack() const { return stack_.get(); }
...@@ -111,7 +108,7 @@ namespace { ...@@ -111,7 +108,7 @@ namespace {
// Prevent inlining as that would allow the compiler to prove that the parameter // Prevent inlining as that would allow the compiler to prove that the parameter
// must not actually be materialized. // must not actually be materialized.
// //
// Parameter positiosn are explicit to test various calling conventions. // Parameter positions are explicit to test various calling conventions.
V8_NOINLINE void* RecursivelyPassOnParameterImpl(void* p1, void* p2, void* p3, V8_NOINLINE void* RecursivelyPassOnParameterImpl(void* p1, void* p2, void* p3,
void* p4, void* p5, void* p6, void* p4, void* p5, void* p6,
void* p7, void* p8, void* p7, void* p8,
......
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