-// Copyright 2014 the V8 project authors. All rights reserved.
+// Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "src/v8.h"
-
#include "src/compiler/access-builder.h"
#include "src/compiler/common-operator.h"
#include "src/compiler/graph.h"
#include "src/compiler/scheduler.h"
#include "src/compiler/simplified-operator.h"
#include "src/compiler/verifier.h"
+#include "test/unittests/compiler/compiler-test-utils.h"
#include "test/unittests/test-utils.h"
-using namespace v8::internal;
-using namespace v8::internal::compiler;
-
-namespace {
+namespace v8 {
+namespace internal {
+namespace compiler {
-class SchedulerTest : public virtual TestWithZone {
+class SchedulerTest : public TestWithZone {
public:
SchedulerTest()
- : TestWithZone(),
- graph_(zone()),
- common_(zone()),
- simplified_(zone()),
- js_(zone()) {}
+ : graph_(zone()), common_(zone()), simplified_(zone()), js_(zone()) {}
static Schedule* ComputeAndVerifySchedule(int expected, Graph* graph) {
if (FLAG_trace_turbo) {
JSOperatorBuilder js_;
};
-class SchedulerRPOTest : public virtual SchedulerTest {
+
+class SchedulerRPOTest : public SchedulerTest {
public:
SchedulerRPOTest() {}
}
};
-class SchedulerTestWithIsolate : public virtual SchedulerTest,
- public virtual TestWithIsolate {
+
+class SchedulerTestWithIsolate : public SchedulerTest, public TestWithIsolate {
public:
SchedulerTestWithIsolate() {}
}
};
-Operator kIntAdd(IrOpcode::kInt32Add, Operator::kPure, "Int32Add", 2, 0, 0, 1,
- 0, 0);
+namespace {
+
+const Operator kIntAdd(IrOpcode::kInt32Add, Operator::kPure, "Int32Add", 2, 0,
+ 0, 1, 0, 0);
} // namespace
}
-#if V8_TURBOFAN_TARGET
+namespace {
-static Node* CreateDiamond(Graph* graph, CommonOperatorBuilder* common,
- Node* cond) {
+Node* CreateDiamond(Graph* graph, CommonOperatorBuilder* common, Node* cond) {
Node* tv = graph->NewNode(common->Int32Constant(6));
Node* fv = graph->NewNode(common->Int32Constant(7));
Node* br = graph->NewNode(common->Branch(), cond, graph->start());
return phi;
}
+} // namespace
+
-TEST_F(SchedulerTest, FloatingDiamond1) {
+TARGET_TEST_F(SchedulerTest, FloatingDiamond1) {
Node* start = graph()->NewNode(common()->Start(1));
graph()->SetStart(start);
}
-TEST_F(SchedulerTest, FloatingDiamond2) {
+TARGET_TEST_F(SchedulerTest, FloatingDiamond2) {
Node* start = graph()->NewNode(common()->Start(2));
graph()->SetStart(start);
}
-TEST_F(SchedulerTest, FloatingDiamond3) {
+TARGET_TEST_F(SchedulerTest, FloatingDiamond3) {
Node* start = graph()->NewNode(common()->Start(2));
graph()->SetStart(start);
}
-TEST_F(SchedulerTest, NestedFloatingDiamonds) {
+TARGET_TEST_F(SchedulerTest, NestedFloatingDiamonds) {
Node* start = graph()->NewNode(common()->Start(2));
graph()->SetStart(start);
}
-TEST_F(SchedulerTest, NestedFloatingDiamondWithChain) {
+TARGET_TEST_F(SchedulerTest, NestedFloatingDiamondWithChain) {
Node* start = graph()->NewNode(common()->Start(2));
graph()->SetStart(start);
}
-TEST_F(SchedulerTest, NestedFloatingDiamondWithLoop) {
+TARGET_TEST_F(SchedulerTest, NestedFloatingDiamondWithLoop) {
Node* start = graph()->NewNode(common()->Start(2));
graph()->SetStart(start);
}
-TEST_F(SchedulerTest, LoopedFloatingDiamond1) {
+TARGET_TEST_F(SchedulerTest, LoopedFloatingDiamond1) {
Node* start = graph()->NewNode(common()->Start(2));
graph()->SetStart(start);
}
-TEST_F(SchedulerTest, LoopedFloatingDiamond2) {
+TARGET_TEST_F(SchedulerTest, LoopedFloatingDiamond2) {
Node* start = graph()->NewNode(common()->Start(2));
graph()->SetStart(start);
}
-TEST_F(SchedulerTest, LoopedFloatingDiamond3) {
+TARGET_TEST_F(SchedulerTest, LoopedFloatingDiamond3) {
Node* start = graph()->NewNode(common()->Start(2));
graph()->SetStart(start);
}
-TEST_F(SchedulerTest, PhisPushedDownToDifferentBranches) {
+TARGET_TEST_F(SchedulerTest, PhisPushedDownToDifferentBranches) {
Node* start = graph()->NewNode(common()->Start(2));
graph()->SetStart(start);
}
-TEST_F(SchedulerTest, BranchHintTrue) {
+TARGET_TEST_F(SchedulerTest, BranchHintTrue) {
Node* start = graph()->NewNode(common()->Start(1));
graph()->SetStart(start);
}
-TEST_F(SchedulerTest, BranchHintFalse) {
+TARGET_TEST_F(SchedulerTest, BranchHintFalse) {
Node* start = graph()->NewNode(common()->Start(1));
graph()->SetStart(start);
}
-TEST_F(SchedulerTest, ScheduleTerminate) {
+TARGET_TEST_F(SchedulerTest, ScheduleTerminate) {
Node* start = graph()->NewNode(common()->Start(1));
graph()->SetStart(start);
CHECK_GE(block->rpo_number(), 0);
}
-#endif
+} // namespace compiler
+} // namespace internal
+} // namespace v8