Commit d1e45d9b authored by danno's avatar danno Committed by Commit bot

Distinquish TestWithIsolateAndZone from TestWithZone

Allows unit tests that just need a zone and no isolate to avoid the overhead of
creating one.

R=mstarzinger@chromium.org
LOG=N

Review URL: https://codereview.chromium.org/871843004

Cr-Commit-Position: refs/heads/master@{#26256}
parent ab8744d2
...@@ -26,7 +26,7 @@ namespace compiler { ...@@ -26,7 +26,7 @@ namespace compiler {
using ::testing::Matcher; using ::testing::Matcher;
class GraphTest : public TestWithContext, public TestWithZone { class GraphTest : public TestWithContext, public TestWithIsolateAndZone {
public: public:
explicit GraphTest(int num_parameters = 1); explicit GraphTest(int num_parameters = 1);
~GraphTest() OVERRIDE; ~GraphTest() OVERRIDE;
......
...@@ -18,7 +18,8 @@ namespace v8 { ...@@ -18,7 +18,8 @@ namespace v8 {
namespace internal { namespace internal {
namespace compiler { namespace compiler {
class InstructionSelectorTest : public TestWithContext, public TestWithZone { class InstructionSelectorTest : public TestWithContext,
public TestWithIsolateAndZone {
public: public:
InstructionSelectorTest(); InstructionSelectorTest();
~InstructionSelectorTest() OVERRIDE; ~InstructionSelectorTest() OVERRIDE;
......
...@@ -13,7 +13,7 @@ namespace v8 { ...@@ -13,7 +13,7 @@ namespace v8 {
namespace internal { namespace internal {
namespace compiler { namespace compiler {
class InstructionSequenceTest : public TestWithZone { class InstructionSequenceTest : public TestWithIsolateAndZone {
public: public:
static const int kDefaultNRegs = 4; static const int kDefaultNRegs = 4;
static const int kNoValue = kMinInt; static const int kNoValue = kMinInt;
......
...@@ -13,7 +13,7 @@ namespace v8 { ...@@ -13,7 +13,7 @@ namespace v8 {
namespace internal { namespace internal {
namespace compiler { namespace compiler {
typedef TestWithZone BasicBlockTest; typedef TestWithIsolateAndZone BasicBlockTest;
TEST_F(BasicBlockTest, Constructor) { TEST_F(BasicBlockTest, Constructor) {
......
...@@ -94,6 +94,7 @@ namespace internal { ...@@ -94,6 +94,7 @@ namespace internal {
TestWithIsolate::~TestWithIsolate() {} TestWithIsolate::~TestWithIsolate() {}
TestWithIsolateAndZone::~TestWithIsolateAndZone() {}
Factory* TestWithIsolate::factory() const { return isolate()->factory(); } Factory* TestWithIsolate::factory() const { return isolate()->factory(); }
......
...@@ -90,7 +90,7 @@ class TestWithIsolate : public virtual ::v8::TestWithIsolate { ...@@ -90,7 +90,7 @@ class TestWithIsolate : public virtual ::v8::TestWithIsolate {
}; };
class TestWithZone : public TestWithIsolate { class TestWithZone : public virtual ::testing::Test {
public: public:
TestWithZone() {} TestWithZone() {}
virtual ~TestWithZone(); virtual ~TestWithZone();
...@@ -103,6 +103,21 @@ class TestWithZone : public TestWithIsolate { ...@@ -103,6 +103,21 @@ class TestWithZone : public TestWithIsolate {
DISALLOW_COPY_AND_ASSIGN(TestWithZone); 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 internal
} // namespace v8 } // namespace v8
......
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