Reviewers: Michael Starzinger,
Message:
PTAL
Description:
Distinquish TestWithIsolateAndZone from TestWithZone
Allows unit tests that just need a zone and no isolate to avoid the
overhead of
creating one.
[email protected]
LOG=N
Please review this at https://codereview.chromium.org/871843004/
Base URL: https://chromium.googlesource.com/v8/v8.git@no_zone_isolate
Affected files (+22, -5 lines):
M test/unittests/compiler/graph-unittest.h
M test/unittests/compiler/instruction-selector-unittest.h
M test/unittests/compiler/instruction-sequence-unittest.h
M test/unittests/compiler/schedule-unittest.cc
M test/unittests/test-utils.h
M test/unittests/test-utils.cc
Index: test/unittests/compiler/graph-unittest.h
diff --git a/test/unittests/compiler/graph-unittest.h
b/test/unittests/compiler/graph-unittest.h
index
0ab81a7190abae1c4dced9399c148f75a27deefd..217c44db1a24950e14f17141fad8e7683b81ba3b
100644
--- a/test/unittests/compiler/graph-unittest.h
+++ b/test/unittests/compiler/graph-unittest.h
@@ -26,7 +26,7 @@ namespace compiler {
using ::testing::Matcher;
-class GraphTest : public TestWithContext, public TestWithZone {
+class GraphTest : public TestWithContext, public TestWithIsolateAndZone {
public:
explicit GraphTest(int num_parameters = 1);
~GraphTest() OVERRIDE;
Index: test/unittests/compiler/instruction-selector-unittest.h
diff --git a/test/unittests/compiler/instruction-selector-unittest.h
b/test/unittests/compiler/instruction-selector-unittest.h
index
408f32611aae59d68b3655050a946bdf36adbd99..983e5c0aed3b40c31790734f810c6107ae15761e
100644
--- a/test/unittests/compiler/instruction-selector-unittest.h
+++ b/test/unittests/compiler/instruction-selector-unittest.h
@@ -18,7 +18,8 @@ namespace v8 {
namespace internal {
namespace compiler {
-class InstructionSelectorTest : public TestWithContext, public
TestWithZone {
+class InstructionSelectorTest : public TestWithContext,
+ public TestWithIsolateAndZone {
public:
InstructionSelectorTest();
~InstructionSelectorTest() OVERRIDE;
Index: test/unittests/compiler/instruction-sequence-unittest.h
diff --git a/test/unittests/compiler/instruction-sequence-unittest.h
b/test/unittests/compiler/instruction-sequence-unittest.h
index
ce0a5b460db8ec7d0cfd1ff086cf27592ac9aeca..9ce1cc330ee7f80a316b9297c9cffc4dc7a28388
100644
--- a/test/unittests/compiler/instruction-sequence-unittest.h
+++ b/test/unittests/compiler/instruction-sequence-unittest.h
@@ -13,7 +13,7 @@ namespace v8 {
namespace internal {
namespace compiler {
-class InstructionSequenceTest : public TestWithZone {
+class InstructionSequenceTest : public TestWithIsolateAndZone {
public:
static const int kDefaultNRegs = 4;
static const int kNoValue = kMinInt;
Index: test/unittests/compiler/schedule-unittest.cc
diff --git a/test/unittests/compiler/schedule-unittest.cc
b/test/unittests/compiler/schedule-unittest.cc
index
22debd3cc58e80e178d5e892140534fbe4e0e21c..70fd4d50ad135aaaf44e7e6539a2d2e00bb27237
100644
--- a/test/unittests/compiler/schedule-unittest.cc
+++ b/test/unittests/compiler/schedule-unittest.cc
@@ -13,7 +13,7 @@ namespace v8 {
namespace internal {
namespace compiler {
-typedef TestWithZone BasicBlockTest;
+typedef TestWithIsolateAndZone BasicBlockTest;
TEST_F(BasicBlockTest, Constructor) {
Index: test/unittests/test-utils.cc
diff --git a/test/unittests/test-utils.cc b/test/unittests/test-utils.cc
index
31d724ab6888a8f241da0fe9d276d387d48188b9..5d1c1f14f650c44210a7e0c123bab7bd4fecdd11
100644
--- a/test/unittests/test-utils.cc
+++ b/test/unittests/test-utils.cc
@@ -94,6 +94,7 @@ namespace internal {
TestWithIsolate::~TestWithIsolate() {}
+TestWithIsolateAndZone::~TestWithIsolateAndZone() {}
Factory* TestWithIsolate::factory() const { return isolate()->factory(); }
Index: test/unittests/test-utils.h
diff --git a/test/unittests/test-utils.h b/test/unittests/test-utils.h
index
718fd5ac5977e8e6cc999418264af31de1cfb9e3..765b97dd3798b0d9fecfaefd5750bd6a5eae1ece
100644
--- a/test/unittests/test-utils.h
+++ b/test/unittests/test-utils.h
@@ -90,7 +90,7 @@ class TestWithIsolate : public
virtual ::v8::TestWithIsolate {
};
-class TestWithZone : public TestWithIsolate {
+class TestWithZone : public virtual ::testing::Test {
public:
TestWithZone() {}
virtual ~TestWithZone();
@@ -103,6 +103,21 @@ class TestWithZone : public TestWithIsolate {
DISALLOW_COPY_AND_ASSIGN(TestWithZone);
};
+
+class TestWithIsolateAndZone : public virtual TestWithIsolate {
+ public:
+ TestWithIsolateAndZone() {}
+ virtual ~TestWithIsolateAndZone();
+
+ Zone* zone() { return &zone_; }
+
+ private:
+ Zone zone_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestWithIsolateAndZone);
+};
+
+
} // namespace internal
} // namespace v8
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.