Commit 16f13300 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

Move compiler cctests into v8::internal::compiler namespace.

This moves all cctest files for the compiler to live in the same
namespace as the components they are testing. Hence we can avoid the
forbidden using directives pulling in entire namespaces.

From the Google C++ style guide: "You may not use a using-directive to
make all names from a namespace available". This would be covered by
presubmit linter checks if build/namespaces were not blacklisted.

R=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#31671}
parent 86c27e01
...@@ -6,8 +6,9 @@ ...@@ -6,8 +6,9 @@
#include "test/cctest/compiler/codegen-tester.h" #include "test/cctest/compiler/codegen-tester.h"
#include "test/cctest/compiler/value-helper.h" #include "test/cctest/compiler/value-helper.h"
using namespace v8::internal; namespace v8 {
using namespace v8::internal::compiler; namespace internal {
namespace compiler {
TEST(CompareWrapper) { TEST(CompareWrapper) {
// Who tests the testers? // Who tests the testers?
...@@ -568,3 +569,7 @@ TEST(RunBinopTester) { ...@@ -568,3 +569,7 @@ TEST(RunBinopTester) {
FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(*i, bt.call(-11.25, *i)); } FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(*i, bt.call(-11.25, *i)); }
} }
} }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -9,8 +9,9 @@ ...@@ -9,8 +9,9 @@
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
#include "test/cctest/compiler/codegen-tester.h" #include "test/cctest/compiler/codegen-tester.h"
using namespace v8::internal; namespace v8 {
using namespace v8::internal::compiler; namespace internal {
namespace compiler {
typedef RawMachineAssembler::Label MLabel; typedef RawMachineAssembler::Label MLabel;
...@@ -109,3 +110,7 @@ TEST(ProfileLoop) { ...@@ -109,3 +110,7 @@ TEST(ProfileLoop) {
m.Expect(arraysize(expected), expected); m.Expect(arraysize(expected), expected);
} }
} }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -9,8 +9,9 @@ ...@@ -9,8 +9,9 @@
#include "test/cctest/compiler/codegen-tester.h" #include "test/cctest/compiler/codegen-tester.h"
#include "test/cctest/compiler/value-helper.h" #include "test/cctest/compiler/value-helper.h"
using namespace v8::internal; namespace v8 {
using namespace v8::internal::compiler; namespace internal {
namespace compiler {
typedef RawMachineAssembler::Label MLabel; typedef RawMachineAssembler::Label MLabel;
...@@ -458,3 +459,7 @@ TEST(BranchCombineFloat64Compares) { ...@@ -458,3 +459,7 @@ TEST(BranchCombineFloat64Compares) {
} }
} }
} }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -27,8 +27,9 @@ ...@@ -27,8 +27,9 @@
#include "test/cctest/compiler/graph-builder-tester.h" #include "test/cctest/compiler/graph-builder-tester.h"
#include "test/cctest/compiler/value-helper.h" #include "test/cctest/compiler/value-helper.h"
using namespace v8::internal; namespace v8 {
using namespace v8::internal::compiler; namespace internal {
namespace compiler {
template <typename ReturnType> template <typename ReturnType>
class ChangesLoweringTester : public GraphBuilderTester<ReturnType> { class ChangesLoweringTester : public GraphBuilderTester<ReturnType> {
...@@ -286,3 +287,7 @@ TEST(RunChangeBitToBool) { ...@@ -286,3 +287,7 @@ TEST(RunChangeBitToBool) {
CHECK_EQ(false_obj, result); CHECK_EQ(false_obj, result);
} }
} }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -10,8 +10,9 @@ ...@@ -10,8 +10,9 @@
#include "src/base/utils/random-number-generator.h" #include "src/base/utils/random-number-generator.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::internal; namespace v8 {
using namespace v8::internal::compiler; namespace internal {
namespace compiler {
// The state of our move interpreter is the mapping of operands to values. Note // The state of our move interpreter is the mapping of operands to values. Note
// that the actual values don't really matter, all we care about is equality. // that the actual values don't really matter, all we care about is equality.
...@@ -255,3 +256,7 @@ TEST(FuzzResolver) { ...@@ -255,3 +256,7 @@ TEST(FuzzResolver) {
} }
} }
} }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -18,8 +18,9 @@ ...@@ -18,8 +18,9 @@
#include "src/compiler/verifier.h" #include "src/compiler/verifier.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::internal; namespace v8 {
using namespace v8::internal::compiler; namespace internal {
namespace compiler {
static Operator dummy_operator1(IrOpcode::kParameter, Operator::kNoWrite, static Operator dummy_operator1(IrOpcode::kParameter, Operator::kNoWrite,
"dummy", 1, 0, 0, 1, 0, 0); "dummy", 1, 0, 0, 1, 0, 0);
...@@ -128,3 +129,7 @@ TEST(NodeNetworkOfDummiesReachableFromEnd) { ...@@ -128,3 +129,7 @@ TEST(NodeNetworkOfDummiesReachableFromEnd) {
SourcePositionTable table(&graph); SourcePositionTable table(&graph);
os << AsJSON(graph, &table); os << AsJSON(graph, &table);
} }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -17,8 +17,9 @@ ...@@ -17,8 +17,9 @@
#include "src/compiler/scheduler.h" #include "src/compiler/scheduler.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::internal; namespace v8 {
using namespace v8::internal::compiler; namespace internal {
namespace compiler {
typedef v8::internal::compiler::Instruction TestInstr; typedef v8::internal::compiler::Instruction TestInstr;
typedef v8::internal::compiler::InstructionSequence TestInstrSeq; typedef v8::internal::compiler::InstructionSequence TestInstrSeq;
...@@ -322,3 +323,7 @@ TEST(InstructionOperands) { ...@@ -322,3 +323,7 @@ TEST(InstructionOperands) {
} }
} }
} }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -13,8 +13,9 @@ ...@@ -13,8 +13,9 @@
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
#include "test/cctest/compiler/value-helper.h" #include "test/cctest/compiler/value-helper.h"
using namespace v8::internal; namespace v8 {
using namespace v8::internal::compiler; namespace internal {
namespace compiler {
class JSCacheTesterHelper { class JSCacheTesterHelper {
protected: protected:
...@@ -474,3 +475,7 @@ TEST(JSGraph_GetCachedNodes_together) { ...@@ -474,3 +475,7 @@ TEST(JSGraph_GetCachedNodes_together) {
CHECK(Contains(&nodes, constants[i])); CHECK(Contains(&nodes, constants[i]));
} }
} }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -15,8 +15,9 @@ ...@@ -15,8 +15,9 @@
#include "test/cctest/compiler/function-tester.h" #include "test/cctest/compiler/function-tester.h"
#include "test/cctest/compiler/graph-builder-tester.h" #include "test/cctest/compiler/graph-builder-tester.h"
using namespace v8::internal; namespace v8 {
using namespace v8::internal::compiler; namespace internal {
namespace compiler {
class ContextSpecializationTester : public HandleAndZoneScope { class ContextSpecializationTester : public HandleAndZoneScope {
public: public:
...@@ -318,3 +319,7 @@ TEST(SpecializeJSFunction_ToConstant_uninit) { ...@@ -318,3 +319,7 @@ TEST(SpecializeJSFunction_ToConstant_uninit) {
CHECK(T.Call(T.Val(-2.1), T.Val(0.0)).ToHandleChecked()->IsNaN()); CHECK(T.Call(T.Val(-2.1), T.Val(0.0)).ToHandleChecked()->IsNaN());
} }
} }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -15,8 +15,9 @@ ...@@ -15,8 +15,9 @@
#include "src/compiler/typer.h" #include "src/compiler/typer.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::internal; namespace v8 {
using namespace v8::internal::compiler; namespace internal {
namespace compiler {
#ifndef TEST_WITH_STRONG #ifndef TEST_WITH_STRONG
#define TEST_WITH_STRONG(Name) \ #define TEST_WITH_STRONG(Name) \
...@@ -1262,3 +1263,7 @@ TEST_WITH_STRONG(Int32Comparisons) { ...@@ -1262,3 +1263,7 @@ TEST_WITH_STRONG(Int32Comparisons) {
} }
} }
} }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -20,8 +20,9 @@ ...@@ -20,8 +20,9 @@
#include "src/compiler/schedule.h" #include "src/compiler/schedule.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::internal; namespace v8 {
using namespace v8::internal::compiler; namespace internal {
namespace compiler {
static Operator dummy_operator(IrOpcode::kParameter, Operator::kNoWrite, static Operator dummy_operator(IrOpcode::kParameter, Operator::kNoWrite,
"dummy", 0, 0, 0, 0, 0, 0); "dummy", 0, 0, 0, 0, 0, 0);
...@@ -113,3 +114,7 @@ TEST(TestLinkageRuntimeCall) { ...@@ -113,3 +114,7 @@ TEST(TestLinkageRuntimeCall) {
TEST(TestLinkageStubCall) { TEST(TestLinkageStubCall) {
// TODO(titzer): test linkage creation for outgoing stub calls. // TODO(titzer): test linkage creation for outgoing stub calls.
} }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -21,8 +21,9 @@ ...@@ -21,8 +21,9 @@
#include "src/compiler/verifier.h" #include "src/compiler/verifier.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::internal; namespace v8 {
using namespace v8::internal::compiler; namespace internal {
namespace compiler {
static Operator kIntAdd(IrOpcode::kInt32Add, Operator::kPure, "Int32Add", 2, 0, static Operator kIntAdd(IrOpcode::kInt32Add, Operator::kPure, "Int32Add", 2, 0,
0, 1, 0, 0); 0, 1, 0, 0);
...@@ -1013,3 +1014,7 @@ TEST(LaManyNested_64) { RunManyNestedLoops_i(64); } ...@@ -1013,3 +1014,7 @@ TEST(LaManyNested_64) { RunManyNestedLoops_i(64); }
TEST(LaPhiTangle) { LoopFinderTester t; } TEST(LaPhiTangle) { LoopFinderTester t; }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -11,8 +11,9 @@ ...@@ -11,8 +11,9 @@
#include "src/scopes.h" #include "src/scopes.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::internal; namespace v8 {
using namespace v8::internal::compiler; namespace internal {
namespace compiler {
namespace { namespace {
const int kBufferSize = 1024; const int kBufferSize = 1024;
...@@ -296,3 +297,7 @@ TEST(NestedLoops3c) { ...@@ -296,3 +297,7 @@ TEST(NestedLoops3c) {
f.CheckLoopAssignedCount(5, "z"); f.CheckLoopAssignedCount(5, "z");
f.CheckLoopAssignedCount(0, "w"); f.CheckLoopAssignedCount(0, "w");
} }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -14,8 +14,9 @@ ...@@ -14,8 +14,9 @@
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
#include "test/cctest/compiler/value-helper.h" #include "test/cctest/compiler/value-helper.h"
using namespace v8::internal; namespace v8 {
using namespace v8::internal::compiler; namespace internal {
namespace compiler {
template <typename T> template <typename T>
const Operator* NewConstantOperator(CommonOperatorBuilder* common, const Operator* NewConstantOperator(CommonOperatorBuilder* common,
...@@ -750,3 +751,7 @@ TEST(ReduceLoadStore) { ...@@ -750,3 +751,7 @@ TEST(ReduceLoadStore) {
// TODO(titzer): test MachineOperatorReducer for Float64Mul // TODO(titzer): test MachineOperatorReducer for Float64Mul
// TODO(titzer): test MachineOperatorReducer for Float64Div // TODO(titzer): test MachineOperatorReducer for Float64Div
// TODO(titzer): test MachineOperatorReducer for Float64Mod // TODO(titzer): test MachineOperatorReducer for Float64Mod
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -20,11 +20,9 @@ ...@@ -20,11 +20,9 @@
#include "test/cctest/compiler/codegen-tester.h" #include "test/cctest/compiler/codegen-tester.h"
#include "test/cctest/compiler/value-helper.h" #include "test/cctest/compiler/value-helper.h"
namespace v8 {
using namespace v8::base; namespace internal {
using namespace v8::internal; namespace compiler {
using namespace v8::internal::compiler;
namespace { namespace {
...@@ -117,3 +115,7 @@ TEST(ReturnThreeValues) { ...@@ -117,3 +115,7 @@ TEST(ReturnThreeValues) {
#endif #endif
CHECK_EQ((123 + 456) + (123 - 456) + (123 * 456), mt.Call()); CHECK_EQ((123 + 456) + (123 - 456) + (123 * 456), mt.Call());
} }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -12,8 +12,9 @@ ...@@ -12,8 +12,9 @@
#include "src/compiler/operator.h" #include "src/compiler/operator.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::internal; namespace v8 {
using namespace v8::internal::compiler; namespace internal {
namespace compiler {
#define NONE reinterpret_cast<Node*>(1) #define NONE reinterpret_cast<Node*>(1)
...@@ -785,3 +786,7 @@ TEST(AppendAndTrim) { ...@@ -785,3 +786,7 @@ TEST(AppendAndTrim) {
CHECK_USES(last, NONE); CHECK_USES(last, NONE);
} }
} }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -10,8 +10,9 @@ ...@@ -10,8 +10,9 @@
#include "src/compiler/operator.h" #include "src/compiler/operator.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::internal; namespace v8 {
using namespace v8::internal::compiler; namespace internal {
namespace compiler {
#define NONE Operator::kNoProperties #define NONE Operator::kNoProperties
#define FOLD Operator::kFoldable #define FOLD Operator::kFoldable
...@@ -282,3 +283,7 @@ TEST(Operator_CountsOrder) { ...@@ -282,3 +283,7 @@ TEST(Operator_CountsOrder) {
CHECK_EQ(55, op.EffectOutputCount()); CHECK_EQ(55, op.EffectOutputCount());
CHECK_EQ(66, op.ControlOutputCount()); CHECK_EQ(66, op.ControlOutputCount());
} }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -16,8 +16,9 @@ ...@@ -16,8 +16,9 @@
#include "src/compiler/osr.h" #include "src/compiler/osr.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::internal; namespace v8 {
using namespace v8::internal::compiler; namespace internal {
namespace compiler {
// TODO(titzer): move this method to a common testing place. // TODO(titzer): move this method to a common testing place.
...@@ -566,3 +567,7 @@ TEST(Deconstruct_osr_nested3) { ...@@ -566,3 +567,7 @@ TEST(Deconstruct_osr_nested3) {
// depends on the copy of the outer loop0. // depends on the copy of the outer loop0.
CheckInputs(new_ret, new_loop0_phi, T.graph.start(), new_loop0_exit); CheckInputs(new_ret, new_loop0_phi, T.graph.start(), new_loop0_exit);
} }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -11,8 +11,9 @@ ...@@ -11,8 +11,9 @@
#include "src/parser.h" #include "src/parser.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::internal; namespace v8 {
using namespace v8::internal::compiler; namespace internal {
namespace compiler {
static void RunPipeline(Zone* zone, const char* source) { static void RunPipeline(Zone* zone, const char* source) {
Handle<JSFunction> function = Handle<JSFunction>::cast(v8::Utils::OpenHandle( Handle<JSFunction> function = Handle<JSFunction>::cast(v8::Utils::OpenHandle(
...@@ -40,3 +41,7 @@ TEST(PipelineGeneric) { ...@@ -40,3 +41,7 @@ TEST(PipelineGeneric) {
FLAG_turbo_types = false; FLAG_turbo_types = false;
RunPipeline(handles.main_zone(), "(function(a,b) { return a + b; })"); RunPipeline(handles.main_zone(), "(function(a,b) { return a + b; })");
} }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -15,10 +15,7 @@ ...@@ -15,10 +15,7 @@
#include "src/compiler/node-matchers.h" #include "src/compiler/node-matchers.h"
#include "src/compiler/representation-change.h" #include "src/compiler/representation-change.h"
using namespace v8::internal; namespace v8 {
using namespace v8::internal::compiler;
namespace v8 { // for friendiness.
namespace internal { namespace internal {
namespace compiler { namespace compiler {
...@@ -102,9 +99,6 @@ class RepresentationChangerTester : public HandleAndZoneScope, ...@@ -102,9 +99,6 @@ class RepresentationChangerTester : public HandleAndZoneScope,
CHECK_EQ(n, c); CHECK_EQ(n, c);
} }
}; };
} // namespace compiler
} // namespace internal
} // namespace v8
static const MachineType all_reps[] = {kRepBit, kRepWord32, kRepWord64, static const MachineType all_reps[] = {kRepBit, kRepWord32, kRepWord64,
...@@ -553,3 +547,7 @@ TEST(TypeErrors) { ...@@ -553,3 +547,7 @@ TEST(TypeErrors) {
} }
} }
} }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -112,13 +112,6 @@ class BytecodeGraphTester { ...@@ -112,13 +112,6 @@ class BytecodeGraphTester {
DISALLOW_COPY_AND_ASSIGN(BytecodeGraphTester); DISALLOW_COPY_AND_ASSIGN(BytecodeGraphTester);
}; };
} // namespace compiler
} // namespace internal
} // namespace v8
using namespace v8::internal;
using namespace v8::internal::compiler;
template <int N> template <int N>
struct ExpectedSnippet { struct ExpectedSnippet {
...@@ -260,3 +253,7 @@ TEST(BytecodeGraphBuilderTwoParameterTests) { ...@@ -260,3 +253,7 @@ TEST(BytecodeGraphBuilderTwoParameterTests) {
CHECK(return_value->SameValue(*snippets[i].return_value())); CHECK(return_value->SameValue(*snippets[i].return_value()));
} }
} }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -9,8 +9,9 @@ ...@@ -9,8 +9,9 @@
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
#include "test/cctest/compiler/function-tester.h" #include "test/cctest/compiler/function-tester.h"
using namespace v8::internal; namespace v8 {
using namespace v8::internal::compiler; namespace internal {
namespace compiler {
static void IsOptimized(const v8::FunctionCallbackInfo<v8::Value>& args) { static void IsOptimized(const v8::FunctionCallbackInfo<v8::Value>& args) {
JavaScriptFrameIterator it(CcTest::i_isolate()); JavaScriptFrameIterator it(CcTest::i_isolate());
...@@ -117,3 +118,7 @@ TEST(DeoptTrivial) { ...@@ -117,3 +118,7 @@ TEST(DeoptTrivial) {
T.CheckCall(T.Val(1)); T.CheckCall(T.Val(1));
} }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -8,8 +8,9 @@ ...@@ -8,8 +8,9 @@
#include "src/frames-inl.h" #include "src/frames-inl.h"
#include "test/cctest/compiler/function-tester.h" #include "test/cctest/compiler/function-tester.h"
using namespace v8::internal; namespace v8 {
using namespace v8::internal::compiler; namespace internal {
namespace compiler {
namespace { namespace {
...@@ -603,3 +604,7 @@ TEST(InlineMutuallyRecursive) { ...@@ -603,3 +604,7 @@ TEST(InlineMutuallyRecursive) {
InstallAssertInlineCountHelper(CcTest::isolate()); InstallAssertInlineCountHelper(CcTest::isolate());
T.CheckCall(T.Val(42), T.Val(1)); T.CheckCall(T.Val(42), T.Val(1));
} }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -7,8 +7,10 @@ ...@@ -7,8 +7,10 @@
#include "test/cctest/compiler/function-tester.h" #include "test/cctest/compiler/function-tester.h"
using namespace v8::internal; namespace v8 {
using namespace v8::internal::compiler; namespace internal {
namespace compiler {
uint32_t flags = CompilationInfo::kInliningEnabled; uint32_t flags = CompilationInfo::kInliningEnabled;
...@@ -321,3 +323,7 @@ TEST(ValueOf) { ...@@ -321,3 +323,7 @@ TEST(ValueOf) {
T.CheckCall(T.Val(123), T.Val(123)); T.CheckCall(T.Val(123), T.Val(123));
T.CheckCall(T.Val(456), T.NewObject("(new Number(456))")); T.CheckCall(T.Val(456), T.NewObject("(new Number(456))"));
} }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -7,8 +7,9 @@ ...@@ -7,8 +7,9 @@
#include "test/cctest/compiler/function-tester.h" #include "test/cctest/compiler/function-tester.h"
using namespace v8::internal; namespace v8 {
using namespace v8::internal::compiler; namespace internal {
namespace compiler {
TEST(Conditional) { TEST(Conditional) {
FunctionTester T("(function(a) { return a ? 23 : 42; })"); FunctionTester T("(function(a) { return a ? 23 : 42; })");
...@@ -383,3 +384,7 @@ TEST(EmptyFor) { ...@@ -383,3 +384,7 @@ TEST(EmptyFor) {
T.CheckCall(T.Val(8126.1), T.Val(0.0), T.Val(8126.1)); T.CheckCall(T.Val(8126.1), T.Val(0.0), T.Val(8126.1));
T.CheckCall(T.Val(1123.1), T.Val(0.0), T.Val(1123.1)); T.CheckCall(T.Val(1123.1), T.Val(0.0), T.Val(1123.1));
} }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -7,8 +7,9 @@ ...@@ -7,8 +7,9 @@
#include "test/cctest/compiler/function-tester.h" #include "test/cctest/compiler/function-tester.h"
using namespace v8::internal; namespace v8 {
using namespace v8::internal::compiler; namespace internal {
namespace compiler {
TEST(SimpleCall) { TEST(SimpleCall) {
FunctionTester T("(function(foo,a) { return foo(a); })"); FunctionTester T("(function(foo,a) { return foo(a); })");
...@@ -246,3 +247,7 @@ TEST(BuiltinLoadedFromActivation) { ...@@ -246,3 +247,7 @@ TEST(BuiltinLoadedFromActivation) {
CompileRun("var x = 24;"); CompileRun("var x = 24;");
ExpectObject("foo()", context->Global()); ExpectObject("foo()", context->Global());
} }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -7,8 +7,9 @@ ...@@ -7,8 +7,9 @@
#include "test/cctest/compiler/function-tester.h" #include "test/cctest/compiler/function-tester.h"
using namespace v8::internal; namespace v8 {
using namespace v8::internal::compiler; namespace internal {
namespace compiler {
TEST(Throw) { TEST(Throw) {
FunctionTester T("(function(a,b) { if (a) { throw b; } else { return b; }})"); FunctionTester T("(function(a,b) { if (a) { throw b; } else { return b; }})");
...@@ -278,3 +279,7 @@ TEST(DeoptFinallyReThrow) { ...@@ -278,3 +279,7 @@ TEST(DeoptFinallyReThrow) {
T.CheckThrows(T.NewObject("new Error"), T.Val(1)); T.CheckThrows(T.NewObject("new Error"), T.Val(1));
#endif #endif
} }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -7,8 +7,9 @@ ...@@ -7,8 +7,9 @@
#include "test/cctest/compiler/function-tester.h" #include "test/cctest/compiler/function-tester.h"
using namespace v8::internal; namespace v8 {
using namespace v8::internal::compiler; namespace internal {
namespace compiler {
TEST(ArgumentsMapped) { TEST(ArgumentsMapped) {
FunctionTester T("(function(a) { return arguments; })"); FunctionTester T("(function(a) { return arguments; })");
...@@ -48,3 +49,7 @@ TEST(ArgumentsRest) { ...@@ -48,3 +49,7 @@ TEST(ArgumentsRest) {
Handle<Object> length = JSObject::GetProperty(arguments, l).ToHandleChecked(); Handle<Object> length = JSObject::GetProperty(arguments, l).ToHandleChecked();
CHECK_EQ(3, length->Number()); CHECK_EQ(3, length->Number());
} }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -7,8 +7,9 @@ ...@@ -7,8 +7,9 @@
#include "test/cctest/compiler/function-tester.h" #include "test/cctest/compiler/function-tester.h"
using namespace v8::internal; namespace v8 {
using namespace v8::internal::compiler; namespace internal {
namespace compiler {
TEST(BinopAdd) { TEST(BinopAdd) {
FunctionTester T("(function(a,b) { return a + b; })"); FunctionTester T("(function(a,b) { return a + b; })");
...@@ -540,3 +541,7 @@ TEST(ClassLiteral) { ...@@ -540,3 +541,7 @@ TEST(ClassLiteral) {
T.CheckCall(T.Val(65), T.Val(23), T.Val(42)); T.CheckCall(T.Val(65), T.Val(23), T.Val(42));
T.CheckCall(T.Val("ab"), T.Val("a"), T.Val("b")); T.CheckCall(T.Val("ab"), T.Val("a"), T.Val("b"));
} }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -18,8 +18,10 @@ ...@@ -18,8 +18,10 @@
#include "test/cctest/compiler/value-helper.h" #include "test/cctest/compiler/value-helper.h"
using namespace v8::base; using namespace v8::base;
using namespace v8::internal;
using namespace v8::internal::compiler; namespace v8 {
namespace internal {
namespace compiler {
typedef RawMachineAssembler::Label MLabel; typedef RawMachineAssembler::Label MLabel;
...@@ -5567,3 +5569,7 @@ TEST(RunComputedCodeObject) { ...@@ -5567,3 +5569,7 @@ TEST(RunComputedCodeObject) {
CHECK_EQ(33, r.Call(1)); CHECK_EQ(33, r.Call(1));
CHECK_EQ(44, r.Call(0)); CHECK_EQ(44, r.Call(0));
} }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
#include "test/cctest/compiler/graph-builder-tester.h" #include "test/cctest/compiler/graph-builder-tester.h"
#include "test/cctest/compiler/value-helper.h" #include "test/cctest/compiler/value-helper.h"
using namespace v8::base; namespace v8 {
using namespace v8::internal; namespace internal {
using namespace v8::internal::compiler; namespace compiler {
typedef RawMachineAssembler::Label MLabel; typedef RawMachineAssembler::Label MLabel;
...@@ -1167,3 +1167,7 @@ TEST(MixedParams_0) { MixedParamTest(0); } ...@@ -1167,3 +1167,7 @@ TEST(MixedParams_0) { MixedParamTest(0); }
TEST(MixedParams_1) { MixedParamTest(1); } TEST(MixedParams_1) { MixedParamTest(1); }
TEST(MixedParams_2) { MixedParamTest(2); } TEST(MixedParams_2) { MixedParamTest(2); }
TEST(MixedParams_3) { MixedParamTest(3); } TEST(MixedParams_3) { MixedParamTest(3); }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -7,8 +7,9 @@ ...@@ -7,8 +7,9 @@
#include "test/cctest/compiler/function-tester.h" #include "test/cctest/compiler/function-tester.h"
using namespace v8::internal; namespace v8 {
using namespace v8::internal::compiler; namespace internal {
namespace compiler {
template <typename U> template <typename U>
static void TypedArrayLoadHelper(const char* array_type) { static void TypedArrayLoadHelper(const char* array_type) {
...@@ -138,3 +139,7 @@ TEST(TypedArrayStore) { ...@@ -138,3 +139,7 @@ TEST(TypedArrayStore) {
TypedArrayStoreHelper<double>("Float64"); TypedArrayStoreHelper<double>("Float64");
// TODO(mstarzinger): Add tests for ClampedUint8. // TODO(mstarzinger): Add tests for ClampedUint8.
} }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -7,8 +7,9 @@ ...@@ -7,8 +7,9 @@
#include "test/cctest/compiler/function-tester.h" #include "test/cctest/compiler/function-tester.h"
using namespace v8::internal; namespace v8 {
using namespace v8::internal::compiler; namespace internal {
namespace compiler {
TEST(TerminateAtMethodEntry) { TEST(TerminateAtMethodEntry) {
FunctionTester T("(function(a,b) { return 23; })"); FunctionTester T("(function(a,b) { return 23; })");
...@@ -17,3 +18,7 @@ TEST(TerminateAtMethodEntry) { ...@@ -17,3 +18,7 @@ TEST(TerminateAtMethodEntry) {
T.isolate->stack_guard()->RequestTerminateExecution(); T.isolate->stack_guard()->RequestTerminateExecution();
T.CheckThrows(T.undefined(), T.undefined()); T.CheckThrows(T.undefined(), T.undefined());
} }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -17,8 +17,9 @@ ...@@ -17,8 +17,9 @@
#include "src/parser.h" #include "src/parser.h"
#include "test/cctest/compiler/function-tester.h" #include "test/cctest/compiler/function-tester.h"
using namespace v8::internal; namespace v8 {
using namespace v8::internal::compiler; namespace internal {
namespace compiler {
TEST(RunOptimizedMathFloorStub) { TEST(RunOptimizedMathFloorStub) {
...@@ -143,3 +144,7 @@ TEST(RunStringAddTFStub) { ...@@ -143,3 +144,7 @@ TEST(RunStringAddTFStub) {
Handle<Object> result = ft.Call(leftArg, rightArg).ToHandleChecked(); Handle<Object> result = ft.Call(leftArg, rightArg).ToHandleChecked();
CHECK(String::Equals(ft.Val("linksrechts"), Handle<String>::cast(result))); CHECK(String::Equals(ft.Val("linksrechts"), Handle<String>::cast(result)));
} }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -7,8 +7,9 @@ ...@@ -7,8 +7,9 @@
#include "test/cctest/compiler/function-tester.h" #include "test/cctest/compiler/function-tester.h"
using namespace v8::internal; namespace v8 {
using namespace v8::internal::compiler; namespace internal {
namespace compiler {
static const char* throws = NULL; static const char* throws = NULL;
...@@ -119,3 +120,7 @@ TEST(SelfReferenceVariable) { ...@@ -119,3 +120,7 @@ TEST(SelfReferenceVariable) {
CompileRun("var self = 'not a function'"); CompileRun("var self = 'not a function'");
T.CheckCall(T.function); T.CheckCall(T.function);
} }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -29,8 +29,9 @@ ...@@ -29,8 +29,9 @@
#include "test/cctest/compiler/graph-builder-tester.h" #include "test/cctest/compiler/graph-builder-tester.h"
#include "test/cctest/compiler/value-helper.h" #include "test/cctest/compiler/value-helper.h"
using namespace v8::internal; namespace v8 {
using namespace v8::internal::compiler; namespace internal {
namespace compiler {
template <typename ReturnType> template <typename ReturnType>
class SimplifiedLoweringTester : public GraphBuilderTester<ReturnType> { class SimplifiedLoweringTester : public GraphBuilderTester<ReturnType> {
...@@ -2006,3 +2007,7 @@ TEST(PhiRepresentation) { ...@@ -2006,3 +2007,7 @@ TEST(PhiRepresentation) {
CHECK_EQ(d.expected, OpParameter<MachineType>(phi)); CHECK_EQ(d.expected, OpParameter<MachineType>(phi));
} }
} }
} // namespace compiler
} // namespace internal
} // 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