Commit cddbe282 authored by Mostyn Bramley-Moore's avatar Mostyn Bramley-Moore Committed by Commit Bot

Start preparing test/cctest for jumbo compilation

* Avoid "using namespace" statements, which trigger clang's -Wheader-hygiene
  warnings in jumbo builds.
* Undefine created macros at the end of source files.

BUG=chromium:746958

Change-Id: I5d25432c314437f607b0e1be22765a6764267ba6
Reviewed-on: https://chromium-review.googlesource.com/610962Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Mostyn Bramley-Moore <mostynb@opera.com>
Cr-Commit-Position: refs/heads/master@{#47347}
parent 4c503b65
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
namespace v8 { namespace v8 {
namespace internal { namespace internal {
namespace compiler { namespace compiler {
namespace node {
#define NONE reinterpret_cast<Node*>(1) #define NONE reinterpret_cast<Node*>(1)
...@@ -875,6 +876,11 @@ TEST(AppendAndTrim) { ...@@ -875,6 +876,11 @@ TEST(AppendAndTrim) {
} }
} }
#undef NONE
#undef CHECK_USES
#undef CHECK_INPUTS
} // namespace node
} // namespace compiler } // namespace compiler
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
...@@ -281,6 +281,9 @@ TEST(Operator_CountsOrder) { ...@@ -281,6 +281,9 @@ TEST(Operator_CountsOrder) {
CHECK_EQ(66, op.ControlOutputCount()); CHECK_EQ(66, op.ControlOutputCount());
} }
#undef NONE
#undef FOLD
} // namespace compiler } // namespace compiler
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#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 { namespace {
template <typename Type> template <typename Type>
......
This diff is collapsed.
...@@ -15,8 +15,9 @@ ...@@ -15,8 +15,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 {
static void UpdateMemoryReferences(Handle<Code> code, Address old_base, static void UpdateMemoryReferences(Handle<Code> code, Address old_base,
Address new_base, uint32_t old_size, Address new_base, uint32_t old_size,
...@@ -212,3 +213,7 @@ TEST(Uint32LessThanFunctionTableRelocation) { ...@@ -212,3 +213,7 @@ TEST(Uint32LessThanFunctionTableRelocation) {
// Check that after limit is increased, index is within bounds. // Check that after limit is increased, index is within bounds.
CHECK_EQ(0xaced, m.Call()); CHECK_EQ(0xaced, m.Call());
} }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -35,8 +35,6 @@ ...@@ -35,8 +35,6 @@
#include "test/cctest/heap/heap-tester.h" #include "test/cctest/heap/heap-tester.h"
#include "test/cctest/heap/heap-utils.h" #include "test/cctest/heap/heap-utils.h"
using namespace v8::internal;
namespace v8 { namespace v8 {
namespace internal { namespace internal {
namespace heap { namespace heap {
......
...@@ -48,9 +48,6 @@ ...@@ -48,9 +48,6 @@
#include "test/cctest/heap/heap-tester.h" #include "test/cctest/heap/heap-tester.h"
#include "test/cctest/heap/heap-utils.h" #include "test/cctest/heap/heap-utils.h"
using namespace v8::internal;
using v8::Just;
namespace v8 { namespace v8 {
namespace internal { namespace internal {
namespace heap { namespace heap {
......
...@@ -18,7 +18,8 @@ ...@@ -18,7 +18,8 @@
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::internal; namespace v8 {
namespace internal {
namespace { namespace {
...@@ -105,3 +106,6 @@ TEST(CommaFunctionSequence) { ...@@ -105,3 +106,6 @@ TEST(CommaFunctionSequence) {
DCHECK(is_compiled["b"]); DCHECK(is_compiled["b"]);
DCHECK(is_compiled["c"]); DCHECK(is_compiled["c"]);
} }
} // namespace internal
} // namespace v8
...@@ -12,7 +12,8 @@ ...@@ -12,7 +12,8 @@
#include "src/unicode-cache.h" #include "src/unicode-cache.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::internal; namespace v8 {
namespace internal {
namespace { namespace {
...@@ -129,3 +130,6 @@ TEST(ContextualKeywordTokens) { ...@@ -129,3 +130,6 @@ TEST(ContextualKeywordTokens) {
CHECK_TOK(Token::IDENTIFIER, scanner->current_token()); CHECK_TOK(Token::IDENTIFIER, scanner->current_token());
CHECK_TOK(Token::UNINITIALIZED, scanner->current_contextual_token()); CHECK_TOK(Token::UNINITIALIZED, scanner->current_contextual_token());
} }
} // namespace internal
} // namespace v8
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef V8_TEST_CCTEST_TEST_API_H_
#define V8_TEST_CCTEST_TEST_API_H_
#include "src/v8.h" #include "src/v8.h"
#include "src/api.h" #include "src/api.h"
...@@ -38,3 +41,5 @@ static void CheckReturnValue(const T& t, i::Address callback) { ...@@ -38,3 +41,5 @@ static void CheckReturnValue(const T& t, i::Address callback) {
CHECK_EQ(callback, isolate->external_callback_scope()->callback()); CHECK_EQ(callback, isolate->external_callback_scope()->callback());
} }
} }
#endif // V8_TEST_CCTEST_TEST_API_H_
...@@ -39,7 +39,8 @@ ...@@ -39,7 +39,8 @@
#include "src/ostreams.h" #include "src/ostreams.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::internal; namespace v8 {
namespace internal {
// Test the x64 assembler by compiling some simple functions into // Test the x64 assembler by compiling some simple functions into
// a buffer and executing them. These tests do not initialize the // a buffer and executing them. These tests do not initialize the
...@@ -2538,3 +2539,6 @@ TEST(AssemblerX64vmovups) { ...@@ -2538,3 +2539,6 @@ TEST(AssemblerX64vmovups) {
} }
#undef __ #undef __
} // namespace internal
} // namespace v8
...@@ -35,7 +35,8 @@ ...@@ -35,7 +35,8 @@
#include "src/zone/accounting-allocator.h" #include "src/zone/accounting-allocator.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::internal; namespace v8 {
namespace internal {
TEST(List) { TEST(List) {
v8::V8::Initialize(); v8::V8::Initialize();
...@@ -65,3 +66,6 @@ TEST(List) { ...@@ -65,3 +66,6 @@ TEST(List) {
CHECK_EQ(0, list->length()); CHECK_EQ(0, list->length());
delete list; delete list;
} }
} // namespace internal
} // namespace v8
...@@ -38,8 +38,8 @@ ...@@ -38,8 +38,8 @@
#include "test/cctest/gay-precision.h" #include "test/cctest/gay-precision.h"
#include "test/cctest/gay-shortest.h" #include "test/cctest/gay-shortest.h"
using namespace v8::internal; namespace v8 {
namespace internal {
// Removes trailing '0' digits. // Removes trailing '0' digits.
// Can return the empty string if all digits are 0. // Can return the empty string if all digits are 0.
...@@ -313,3 +313,6 @@ TEST(BignumDtoaGayPrecision) { ...@@ -313,3 +313,6 @@ TEST(BignumDtoaGayPrecision) {
CHECK_EQ(0, strcmp(current_test.representation, buffer.start())); CHECK_EQ(0, strcmp(current_test.representation, buffer.start()));
} }
} }
} // namespace internal
} // namespace v8
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
#include "src/bignum.h" #include "src/bignum.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::internal; namespace v8 {
namespace internal {
static const int kBufferSize = 1024; static const int kBufferSize = 1024;
...@@ -1540,3 +1540,6 @@ TEST(AssignPowerUInt16) { ...@@ -1540,3 +1540,6 @@ TEST(AssignPowerUInt16) {
"343362267A7E8833119D31D02E18DB5B0E8F6A64B0ED0D0062FFFF", "343362267A7E8833119D31D02E18DB5B0E8F6A64B0ED0D0062FFFF",
buffer)); buffer));
} }
} // namespace internal
} // namespace v8
...@@ -32,7 +32,8 @@ ...@@ -32,7 +32,8 @@
#include "src/bit-vector.h" #include "src/bit-vector.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::internal; namespace v8 {
namespace internal {
TEST(BitVector) { TEST(BitVector) {
v8::internal::AccountingAllocator allocator; v8::internal::AccountingAllocator allocator;
...@@ -143,3 +144,6 @@ TEST(BitVector) { ...@@ -143,3 +144,6 @@ TEST(BitVector) {
CHECK(!v.Contains(243)); CHECK(!v.Contains(243));
} }
} }
} // namespace internal
} // namespace v8
...@@ -14,7 +14,8 @@ ...@@ -14,7 +14,8 @@
#include "src/feedback-vector-inl.h" #include "src/feedback-vector-inl.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::internal; namespace v8 {
namespace internal {
TEST(CodeLayoutWithoutUnwindingInfo) { TEST(CodeLayoutWithoutUnwindingInfo) {
CcTest::InitializeVM(); CcTest::InitializeVM();
...@@ -91,3 +92,6 @@ TEST(CodeLayoutWithUnwindingInfo) { ...@@ -91,3 +92,6 @@ TEST(CodeLayoutWithUnwindingInfo) {
Code::kHeaderSize + RoundUp(buffer_size, kInt64Size) + kInt64Size + Code::kHeaderSize + RoundUp(buffer_size, kInt64Size) + kInt64Size +
unwinding_info_size - kHeapObjectTag); unwinding_info_size - kHeapObjectTag);
} }
} // namespace internal
} // namespace v8
...@@ -38,7 +38,8 @@ ...@@ -38,7 +38,8 @@
#include "src/objects-inl.h" #include "src/objects-inl.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::internal; namespace v8 {
namespace internal {
static Handle<Object> GetGlobalProperty(const char* name) { static Handle<Object> GetGlobalProperty(const char* name) {
Isolate* isolate = CcTest::i_isolate(); Isolate* isolate = CcTest::i_isolate();
...@@ -705,3 +706,6 @@ TEST(InvocationCount) { ...@@ -705,3 +706,6 @@ TEST(InvocationCount) {
CompileRun("foo(); foo()"); CompileRun("foo(); foo()");
CHECK_EQ(4, foo->feedback_vector()->invocation_count()); CHECK_EQ(4, foo->feedback_vector()->invocation_count());
} }
} // namespace internal
} // namespace v8
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
#include "src/assembler.h" #include "src/assembler.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::internal; namespace v8 {
namespace internal {
const ConstantPoolEntry::Type kPtrType = ConstantPoolEntry::INTPTR; const ConstantPoolEntry::Type kPtrType = ConstantPoolEntry::INTPTR;
const ConstantPoolEntry::Type kDblType = ConstantPoolEntry::DOUBLE; const ConstantPoolEntry::Type kDblType = ConstantPoolEntry::DOUBLE;
...@@ -245,3 +246,6 @@ TEST(ConstantPoolNoSharing) { ...@@ -245,3 +246,6 @@ TEST(ConstantPoolNoSharing) {
access = builder.AddEntry(pos, dblValue); access = builder.AddEntry(pos, dblValue);
CHECK_EQ(access, kOvflAccess); CHECK_EQ(access, kOvflAccess);
} }
} // namespace internal
} // namespace v8
...@@ -43,8 +43,8 @@ ...@@ -43,8 +43,8 @@
#include "src/v8.h" #include "src/v8.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::internal; namespace v8 {
namespace internal {
TEST(Hex) { TEST(Hex) {
UnicodeCache uc; UnicodeCache uc;
...@@ -502,3 +502,6 @@ TEST(PositiveNumberToUint32) { ...@@ -502,3 +502,6 @@ TEST(PositiveNumberToUint32) {
number = factory->NewHeapNumber(std::nan("")); number = factory->NewHeapNumber(std::nan(""));
CHECK_EQ(PositiveNumberToUint32(*number), 0u); CHECK_EQ(PositiveNumberToUint32(*number), 0u);
} }
} // namespace internal
} // namespace v8
...@@ -31,7 +31,8 @@ ...@@ -31,7 +31,8 @@
#include "src/v8.h" #include "src/v8.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::internal; namespace v8 {
namespace internal {
class DateCacheMock: public DateCache { class DateCacheMock: public DateCache {
public: public:
...@@ -216,3 +217,6 @@ TEST(DateCacheVersion) { ...@@ -216,3 +217,6 @@ TEST(DateCacheVersion) {
CHECK_EQ(1.0, date_cache_version->NumberValue(context).FromMaybe(-1.0)); CHECK_EQ(1.0, date_cache_version->NumberValue(context).FromMaybe(-1.0));
} }
#endif // V8_INTL_SUPPORT #endif // V8_INTL_SUPPORT
} // namespace internal
} // namespace v8
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include "src/heap/heap.h" #include "src/heap/heap.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8; namespace v8 {
namespace { namespace {
...@@ -1174,3 +1174,5 @@ TEST(Regress3941_Reads) { ...@@ -1174,3 +1174,5 @@ TEST(Regress3941_Reads) {
context.Check("'use strict'; f(); let x = 2; x", EXPECT_EXCEPTION); context.Check("'use strict'; f(); let x = 2; x", EXPECT_EXCEPTION);
} }
} }
} // namespace v8
...@@ -39,7 +39,8 @@ ...@@ -39,7 +39,8 @@
#include "src/objects-inl.h" #include "src/objects-inl.h"
#include "test/cctest/heap/heap-utils.h" #include "test/cctest/heap/heap-utils.h"
using namespace v8::internal; namespace v8 {
namespace internal {
namespace { namespace {
...@@ -310,3 +311,6 @@ TEST(MaximumClonedShallowObjectProperties) { ...@@ -310,3 +311,6 @@ TEST(MaximumClonedShallowObjectProperties) {
} }
} // namespace } // namespace
} // namespace internal
} // namespace v8
...@@ -38,8 +38,8 @@ ...@@ -38,8 +38,8 @@
#include "src/objects-inl.h" #include "src/objects-inl.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::internal; namespace v8 {
namespace internal {
#define __ assm. #define __ assm.
...@@ -959,3 +959,6 @@ TEST(DisasmX64) { ...@@ -959,3 +959,6 @@ TEST(DisasmX64) {
} }
#undef __ #undef __
} // namespace internal
} // namespace v8
...@@ -33,9 +33,8 @@ ...@@ -33,9 +33,8 @@
#include "src/diy-fp.h" #include "src/diy-fp.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
namespace v8 {
using namespace v8::internal; namespace internal {
TEST(Subtract) { TEST(Subtract) {
DiyFp diy_fp1 = DiyFp(3, 0); DiyFp diy_fp1 = DiyFp(3, 0);
...@@ -90,3 +89,6 @@ TEST(Multiply) { ...@@ -90,3 +89,6 @@ TEST(Multiply) {
CHECK(V8_2PART_UINT64_C(0xFFFFFFFF, FFFFFFFe) == product.f()); CHECK(V8_2PART_UINT64_C(0xFFFFFFFF, FFFFFFFe) == product.f());
CHECK_EQ(11 + 13 + 64, product.e()); CHECK_EQ(11 + 13 + 64, product.e());
} }
} // namespace internal
} // namespace v8
...@@ -34,9 +34,8 @@ ...@@ -34,9 +34,8 @@
#include "src/double.h" #include "src/double.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
namespace v8 {
using namespace v8::internal; namespace internal {
TEST(Uint64Conversions) { TEST(Uint64Conversions) {
// Start by checking the byte-order. // Start by checking the byte-order.
...@@ -229,3 +228,6 @@ TEST(NextDouble) { ...@@ -229,3 +228,6 @@ TEST(NextDouble) {
CHECK_EQ(V8_INFINITY, CHECK_EQ(V8_INFINITY,
Double(V8_2PART_UINT64_C(0x7fefffff, ffffffff)).NextDouble()); Double(V8_2PART_UINT64_C(0x7fefffff, ffffffff)).NextDouble());
} }
} // namespace internal
} // namespace v8
...@@ -38,9 +38,8 @@ ...@@ -38,9 +38,8 @@
#include "test/cctest/gay-precision.h" #include "test/cctest/gay-precision.h"
#include "test/cctest/gay-shortest.h" #include "test/cctest/gay-shortest.h"
namespace v8 {
using namespace v8::internal; namespace internal {
// Removes trailing '0' digits. // Removes trailing '0' digits.
static void TrimRepresentation(Vector<char> representation) { static void TrimRepresentation(Vector<char> representation) {
...@@ -329,3 +328,6 @@ TEST(DtoaGayPrecision) { ...@@ -329,3 +328,6 @@ TEST(DtoaGayPrecision) {
CHECK_EQ(0, strcmp(current_test.representation, buffer.start())); CHECK_EQ(0, strcmp(current_test.representation, buffer.start()));
} }
} }
} // namespace internal
} // namespace v8
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
#include "src/ic/stub-cache.h" #include "src/ic/stub-cache.h"
#include "src/objects-inl.h" #include "src/objects-inl.h"
using namespace v8::internal; namespace v8 {
namespace internal {
// //
// Helper functions. // Helper functions.
...@@ -478,3 +478,6 @@ TEST(JSArrayAddingElementsGeneralizingiFastDoubleElements) { ...@@ -478,3 +478,6 @@ TEST(JSArrayAddingElementsGeneralizingiFastDoubleElements) {
.Check(); .Check();
CHECK_EQ(array->map(), *previous_map); CHECK_EQ(array->map(), *previous_map);
} }
} // namespace internal
} // namespace v8
...@@ -37,7 +37,8 @@ ...@@ -37,7 +37,8 @@
#include "test/cctest/gay-precision.h" #include "test/cctest/gay-precision.h"
#include "test/cctest/gay-shortest.h" #include "test/cctest/gay-shortest.h"
using namespace v8::internal; namespace v8 {
namespace internal {
static const int kBufferSize = 100; static const int kBufferSize = 100;
...@@ -291,3 +292,6 @@ TEST(FastDtoaGayPrecision) { ...@@ -291,3 +292,6 @@ TEST(FastDtoaGayPrecision) {
// succeed. // succeed.
CHECK_GT(succeeded_15*1.0/total_15, 0.9999); CHECK_GT(succeeded_15*1.0/total_15, 0.9999);
} }
} // namespace internal
} // namespace v8
...@@ -14,7 +14,8 @@ ...@@ -14,7 +14,8 @@
#include "src/objects-inl.h" #include "src/objects-inl.h"
#include "test/cctest/test-feedback-vector.h" #include "test/cctest/test-feedback-vector.h"
using namespace v8::internal; namespace v8 {
namespace internal {
namespace { namespace {
...@@ -668,3 +669,6 @@ TEST(StoreOwnIC) { ...@@ -668,3 +669,6 @@ TEST(StoreOwnIC) {
} }
} // namespace } // namespace
} // namespace internal
} // namespace v8
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
#include "src/property.h" #include "src/property.h"
#include "src/transitions.h" #include "src/transitions.h"
using namespace v8::internal; namespace v8 {
namespace internal {
// TODO(ishell): fix this once TransitionToPrototype stops generalizing // TODO(ishell): fix this once TransitionToPrototype stops generalizing
// all field representations (similar to crbug/448711 where elements kind // all field representations (similar to crbug/448711 where elements kind
...@@ -2739,3 +2739,6 @@ TEST(HoleyMutableHeapNumber) { ...@@ -2739,3 +2739,6 @@ TEST(HoleyMutableHeapNumber) {
CHECK(obj->IsMutableHeapNumber()); CHECK(obj->IsMutableHeapNumber());
CHECK_EQ(kHoleNanInt64, HeapNumber::cast(*obj)->value_as_bits()); CHECK_EQ(kHoleNanInt64, HeapNumber::cast(*obj)->value_as_bits());
} }
} // namespace internal
} // namespace v8
...@@ -35,7 +35,8 @@ ...@@ -35,7 +35,8 @@
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
#include "test/cctest/gay-fixed.h" #include "test/cctest/gay-fixed.h"
using namespace v8::internal; namespace v8 {
namespace internal {
static const int kBufferSize = 500; static const int kBufferSize = 500;
...@@ -510,3 +511,6 @@ TEST(FastFixedDtoaGayFixed) { ...@@ -510,3 +511,6 @@ TEST(FastFixedDtoaGayFixed) {
CHECK_EQ(0, strcmp(current_test.representation, buffer.start())); CHECK_EQ(0, strcmp(current_test.representation, buffer.start()));
} }
} }
} // namespace internal
} // namespace v8
...@@ -31,7 +31,8 @@ ...@@ -31,7 +31,8 @@
#include "src/v8.h" #include "src/v8.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::internal; namespace v8 {
namespace internal {
// This test must be executed first! // This test must be executed first!
TEST(Default) { TEST(Default) {
...@@ -259,3 +260,6 @@ TEST(FlagsRemoveIncomplete) { ...@@ -259,3 +260,6 @@ TEST(FlagsRemoveIncomplete) {
CHECK(argv[1]); CHECK(argv[1]);
CHECK_EQ(2, argc); CHECK_EQ(2, argc);
} }
} // namespace internal
} // namespace v8
...@@ -33,7 +33,8 @@ ...@@ -33,7 +33,8 @@
#include "src/objects.h" #include "src/objects.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::internal; namespace v8 {
namespace internal {
TEST(EternalHandles) { TEST(EternalHandles) {
CcTest::InitializeVM(); CcTest::InitializeVM();
...@@ -183,3 +184,6 @@ TEST(PhatomHandlesWithoutCallbacks) { ...@@ -183,3 +184,6 @@ TEST(PhatomHandlesWithoutCallbacks) {
CHECK_EQ(2u, isolate->NumberOfPhantomHandleResetsSinceLastCall()); CHECK_EQ(2u, isolate->NumberOfPhantomHandleResetsSinceLastCall());
CHECK_EQ(0u, isolate->NumberOfPhantomHandleResetsSinceLastCall()); CHECK_EQ(0u, isolate->NumberOfPhantomHandleResetsSinceLastCall());
} }
} // namespace internal
} // namespace v8
...@@ -32,7 +32,8 @@ ...@@ -32,7 +32,8 @@
#include "src/v8.h" #include "src/v8.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::internal; namespace v8 {
namespace internal {
// Use a testing allocator that clears memory before deletion. // Use a testing allocator that clears memory before deletion.
class ZeroingAllocationPolicy { class ZeroingAllocationPolicy {
...@@ -165,3 +166,6 @@ TEST(DeleteEmpty) { ...@@ -165,3 +166,6 @@ TEST(DeleteEmpty) {
List<int> list(0); List<int> list(0);
} }
} }
} // namespace internal
} // namespace v8
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
#include "src/objects-inl.h" #include "src/objects-inl.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
namespace v8 {
using namespace v8::internal; namespace internal {
// Anonymous namespace. // Anonymous namespace.
namespace { namespace {
...@@ -176,3 +176,6 @@ TEST(LiveEditDiffer) { ...@@ -176,3 +176,6 @@ TEST(LiveEditDiffer) {
CompareStrings("abbabababababaaabbabababababbabbbbbbbababa", CompareStrings("abbabababababaaabbabababababbabbbbbbbababa",
"bbbbabababbbabababbbabababababbabbababa"); "bbbbabababbbabababbbabababababbabbababa");
} }
} // namespace internal
} // namespace v8
...@@ -41,19 +41,8 @@ ...@@ -41,19 +41,8 @@
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
#include "test/cctest/trace-extension.h" #include "test/cctest/trace-extension.h"
using v8::Function; namespace v8 {
using v8::Local; namespace internal {
using v8::Object;
using v8::Script;
using v8::String;
using v8::TickSample;
using v8::Value;
using v8::internal::byte;
using v8::internal::Address;
using v8::internal::Handle;
using v8::internal::Isolate;
using v8::internal::JSFunction;
static bool IsAddressWithinFuncCode(JSFunction* function, void* addr) { static bool IsAddressWithinFuncCode(JSFunction* function, void* addr) {
Address address = reinterpret_cast<Address>(addr); Address address = reinterpret_cast<Address>(addr);
...@@ -294,3 +283,6 @@ TEST(JsEntrySp) { ...@@ -294,3 +283,6 @@ TEST(JsEntrySp) {
CompileRun("js_entry_sp_level2();"); CompileRun("js_entry_sp_level2();");
CHECK(!i::TraceExtension::GetJsEntrySp()); CHECK(!i::TraceExtension::GetJsEntrySp());
} }
} // namespace internal
} // namespace v8
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
#include "src/objects-inl.h" #include "src/objects-inl.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::base; namespace v8 {
using namespace v8::internal; namespace internal {
class DeleteRecorder { class DeleteRecorder {
public: public:
...@@ -76,3 +76,6 @@ TEST(DisposeCollect) { ...@@ -76,3 +76,6 @@ TEST(DisposeCollect) {
CHECK(deleted1); CHECK(deleted1);
CHECK(deleted2); CHECK(deleted2);
} }
} // namespace internal
} // namespace v8
...@@ -37,8 +37,8 @@ ...@@ -37,8 +37,8 @@
#include "src/feedback-vector-inl.h" #include "src/feedback-vector-inl.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::internal; namespace v8 {
namespace internal {
static void SetUpNewSpaceWithPoisonedMementoAtTop() { static void SetUpNewSpaceWithPoisonedMementoAtTop() {
Isolate* isolate = CcTest::i_isolate(); Isolate* isolate = CcTest::i_isolate();
...@@ -104,3 +104,6 @@ TEST(BadMementoAfterTopForceScavenge) { ...@@ -104,3 +104,6 @@ TEST(BadMementoAfterTopForceScavenge) {
// Force GC to test the poisoned memento handling // Force GC to test the poisoned memento handling
CcTest::CollectGarbage(i::NEW_SPACE); CcTest::CollectGarbage(i::NEW_SPACE);
} }
} // namespace internal
} // namespace v8
...@@ -11,7 +11,8 @@ ...@@ -11,7 +11,8 @@
#include "src/v8.h" #include "src/v8.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::internal; namespace v8 {
namespace internal {
static void CheckObject(Isolate* isolate, Handle<Object> obj, static void CheckObject(Isolate* isolate, Handle<Object> obj,
const char* string) { const char* string) {
...@@ -71,3 +72,6 @@ TEST(NoSideEffectsToString) { ...@@ -71,3 +72,6 @@ TEST(NoSideEffectsToString) {
CheckObject(isolate, factory->NewJSObject(isolate->object_function()), CheckObject(isolate, factory->NewJSObject(isolate->object_function()),
"#<Object>"); "#<Object>");
} }
} // namespace internal
} // namespace v8
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
#include "src/objects-inl.h" #include "src/objects-inl.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::internal; namespace v8 {
namespace internal {
static Isolate* GetIsolateFrom(LocalContext* context) { static Isolate* GetIsolateFrom(LocalContext* context) {
return reinterpret_cast<Isolate*>((*context)->GetIsolate()); return reinterpret_cast<Isolate*>((*context)->GetIsolate());
...@@ -909,3 +910,6 @@ TEST(OrderedHashSetDuplicateHashCodeDeletion) { ...@@ -909,3 +910,6 @@ TEST(OrderedHashSetDuplicateHashCodeDeletion) {
CHECK(OrderedHashSet::HasKey(isolate, *set, *key1)); CHECK(OrderedHashSet::HasKey(isolate, *set, *key1));
CHECK(!OrderedHashSet::HasKey(isolate, *set, *key2)); CHECK(!OrderedHashSet::HasKey(isolate, *set, *key2));
} }
} // namespace internal
} // namespace v8
...@@ -36,8 +36,8 @@ ...@@ -36,8 +36,8 @@
#include "src/base/platform/platform.h" #include "src/base/platform/platform.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace ::v8::internal; namespace v8 {
namespace internal {
TEST(VirtualMemory) { TEST(VirtualMemory) {
v8::base::VirtualMemory* vm = v8::base::VirtualMemory* vm =
...@@ -52,3 +52,6 @@ TEST(VirtualMemory) { ...@@ -52,3 +52,6 @@ TEST(VirtualMemory) {
CHECK(vm->Uncommit(block_addr, block_size)); CHECK(vm->Uncommit(block_addr, block_size));
delete vm; delete vm;
} }
} // namespace internal
} // namespace v8
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
#include "src/base/utils/random-number-generator.h" #include "src/base/utils/random-number-generator.h"
using namespace v8::internal; namespace v8 {
namespace internal {
static const int64_t kRandomSeeds[] = {-1, 1, 42, 100, 1234567890, 987654321}; static const int64_t kRandomSeeds[] = {-1, 1, 42, 100, 1234567890, 987654321};
...@@ -174,3 +174,6 @@ TEST_RANDOM_BIT(30) ...@@ -174,3 +174,6 @@ TEST_RANDOM_BIT(30)
TEST_RANDOM_BIT(31) TEST_RANDOM_BIT(31)
#undef TEST_RANDOM_BIT #undef TEST_RANDOM_BIT
} // namespace internal
} // namespace v8
...@@ -89,8 +89,8 @@ ...@@ -89,8 +89,8 @@
#endif // V8_INTERPRETED_REGEXP #endif // V8_INTERPRETED_REGEXP
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::internal; namespace v8 {
namespace internal {
static bool CheckParse(const char* input) { static bool CheckParse(const char* input) {
v8::HandleScope scope(CcTest::isolate()); v8::HandleScope scope(CcTest::isolate());
...@@ -2032,3 +2032,6 @@ TEST(UncachedExternalString) { ...@@ -2032,3 +2032,6 @@ TEST(UncachedExternalString) {
CompileRun("var re = /y(.)/; re.test('ab');"); CompileRun("var re = /y(.)/; re.test('ab');");
ExpectString("external.substring(1).match(re)[1]", "z"); ExpectString("external.substring(1).match(re)[1]", "z");
} }
} // namespace internal
} // namespace v8
...@@ -29,8 +29,8 @@ ...@@ -29,8 +29,8 @@
#include "src/property-details.h" #include "src/property-details.h"
using namespace v8::internal; namespace v8 {
namespace internal {
void TestPairPositive(Representation more_general, void TestPairPositive(Representation more_general,
Representation less_general) { Representation less_general) {
...@@ -126,3 +126,6 @@ TEST(RepresentationMoreGeneralThan) { ...@@ -126,3 +126,6 @@ TEST(RepresentationMoreGeneralThan) {
TestPairNegative(Representation::External(), Representation::External()); TestPairNegative(Representation::External(), Representation::External());
TestPairPositive(Representation::External(), Representation::None()); TestPairPositive(Representation::External(), Representation::None());
} }
} // namespace internal
} // namespace v8
...@@ -17,8 +17,9 @@ ...@@ -17,8 +17,9 @@
#include "test/cctest/compiler/c-signature.h" #include "test/cctest/compiler/c-signature.h"
#include "test/cctest/compiler/call-tester.h" #include "test/cctest/compiler/call-tester.h"
using namespace v8::internal; namespace v8 {
using namespace v8::internal::compiler; namespace internal {
namespace compiler {
#define __ assm. #define __ assm.
...@@ -134,3 +135,7 @@ TEST(WasmRelocationX64WasmMemorySizeReference) { ...@@ -134,3 +135,7 @@ TEST(WasmRelocationX64WasmMemorySizeReference) {
#endif #endif
} }
#undef __ #undef __
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -95,9 +95,8 @@ class MyRandomNumberGenerator { ...@@ -95,9 +95,8 @@ class MyRandomNumberGenerator {
uint32_t i; uint32_t i;
}; };
namespace v8 {
using namespace v8::internal; namespace internal {
static const int DEEP_DEPTH = 8 * 1024; static const int DEEP_DEPTH = 8 * 1024;
static const int SUPER_DEEP_DEPTH = 80 * 1024; static const int SUPER_DEEP_DEPTH = 80 * 1024;
...@@ -1667,3 +1666,6 @@ TEST(ExternalStringIndexOf) { ...@@ -1667,3 +1666,6 @@ TEST(ExternalStringIndexOf) {
->Int32Value(context.local()) ->Int32Value(context.local())
.FromJust()); .FromJust());
} }
} // namespace internal
} // namespace v8
...@@ -36,7 +36,8 @@ ...@@ -36,7 +36,8 @@
#include "src/strtod.h" #include "src/strtod.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::internal; namespace v8 {
namespace internal {
static Vector<const char> StringToVector(const char* str) { static Vector<const char> StringToVector(const char* str) {
return Vector<const char>(str, StrLength(str)); return Vector<const char>(str, StrLength(str));
...@@ -478,3 +479,6 @@ TEST(RandomStrtod) { ...@@ -478,3 +479,6 @@ TEST(RandomStrtod) {
} }
} }
} }
} // namespace internal
} // namespace v8
...@@ -44,8 +44,8 @@ ...@@ -44,8 +44,8 @@
#include "src/v8.h" #include "src/v8.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::internal; namespace v8 {
namespace internal {
TEST(Create) { TEST(Create) {
CcTest::InitializeVM(); CcTest::InitializeVM();
...@@ -82,3 +82,6 @@ TEST(Create) { ...@@ -82,3 +82,6 @@ TEST(Create) {
} }
} }
} }
} // namespace internal
} // namespace v8
...@@ -10,10 +10,6 @@ ...@@ -10,10 +10,6 @@
#include "src/list-inl.h" #include "src/list-inl.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using v8::IdleTask;
using v8::Task;
using v8::Isolate;
#include "src/tracing/trace-event.h" #include "src/tracing/trace-event.h"
#define GET_TRACE_OBJECTS_LIST platform.GetMockTraceObjects() #define GET_TRACE_OBJECTS_LIST platform.GetMockTraceObjects()
......
...@@ -19,7 +19,8 @@ ...@@ -19,7 +19,8 @@
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
#include "test/cctest/test-transitions.h" #include "test/cctest/test-transitions.h"
using namespace v8::internal; namespace v8 {
namespace internal {
TEST(TransitionArray_SimpleFieldTransitions) { TEST(TransitionArray_SimpleFieldTransitions) {
CcTest::InitializeVM(); CcTest::InitializeVM();
...@@ -302,3 +303,6 @@ TEST(TransitionArray_SameFieldNamesDifferentAttributes) { ...@@ -302,3 +303,6 @@ TEST(TransitionArray_SameFieldNamesDifferentAttributes) {
DCHECK(transitions.IsSortedNoDuplicates()); DCHECK(transitions.IsSortedNoDuplicates());
} }
} // namespace internal
} // namespace v8
...@@ -12,7 +12,8 @@ ...@@ -12,7 +12,8 @@
#include "src/objects-inl.h" #include "src/objects-inl.h"
#include "src/objects.h" #include "src/objects.h"
using namespace v8::internal; namespace v8 {
namespace internal {
void TestArrayBufferViewContents(LocalContext& env, bool should_use_buffer) { void TestArrayBufferViewContents(LocalContext& env, bool should_use_buffer) {
v8::Local<v8::Object> obj_a = v8::Local<v8::Object>::Cast( v8::Local<v8::Object> obj_a = v8::Local<v8::Object>::Cast(
...@@ -83,3 +84,6 @@ TEST(AllocateNotExternal) { ...@@ -83,3 +84,6 @@ TEST(AllocateNotExternal) {
CHECK(!buffer->IsExternal()); CHECK(!buffer->IsExternal());
CHECK_EQ(memory, buffer->GetContents().Data()); CHECK_EQ(memory, buffer->GetContents().Data());
} }
} // namespace internal
} // namespace v8
...@@ -18,8 +18,9 @@ ...@@ -18,8 +18,9 @@
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
#include "test/cctest/types-fuzz.h" #include "test/cctest/types-fuzz.h"
using namespace v8::internal; namespace v8 {
using namespace v8::internal::compiler; namespace internal {
namespace compiler {
namespace { namespace {
...@@ -1131,3 +1132,7 @@ TEST(Intersect) { Tests().Intersect(); } ...@@ -1131,3 +1132,7 @@ TEST(Intersect) { Tests().Intersect(); }
TEST(Distributivity) { Tests().Distributivity(); } TEST(Distributivity) { Tests().Distributivity(); }
TEST(GetRange) { Tests().GetRange(); } TEST(GetRange) { Tests().GetRange(); }
} // namespace compiler
} // namespace internal
} // namespace v8
...@@ -36,8 +36,8 @@ ...@@ -36,8 +36,8 @@
#include "src/conversions.h" #include "src/conversions.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::internal; namespace v8 {
namespace internal {
TEST(Utils1) { TEST(Utils1) {
CHECK_EQ(-1000000, FastD2I(-1000000.0)); CHECK_EQ(-1000000, FastD2I(-1000000.0));
...@@ -287,3 +287,6 @@ TEST(CPlusPlus11Features) { ...@@ -287,3 +287,6 @@ TEST(CPlusPlus11Features) {
j += 11; j += 11;
} }
} }
} // namespace internal
} // namespace v8
...@@ -30,8 +30,6 @@ ...@@ -30,8 +30,6 @@
#include "src/version.h" #include "src/version.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
using namespace v8::internal;
namespace v8 { namespace v8 {
namespace internal { namespace internal {
...@@ -46,10 +44,6 @@ void SetVersion(int major, int minor, int build, int patch, ...@@ -46,10 +44,6 @@ void SetVersion(int major, int minor, int build, int patch,
Version::soname_ = soname; Version::soname_ = soname;
} }
} // namespace internal
} // namespace v8
static void CheckVersion(int major, int minor, int build, static void CheckVersion(int major, int minor, int build,
int patch, bool candidate, int patch, bool candidate,
const char* expected_version_string, const char* expected_version_string,
...@@ -103,3 +97,6 @@ TEST(VersionString) { ...@@ -103,3 +97,6 @@ TEST(VersionString) {
"2.5.10.7 (candidate)", "libv8-2.5.10.7-candidate.so"); "2.5.10.7 (candidate)", "libv8-2.5.10.7-candidate.so");
#endif #endif
} }
} // namespace internal
} // namespace v8
...@@ -42,7 +42,8 @@ ...@@ -42,7 +42,8 @@
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
#include "test/cctest/heap/heap-utils.h" #include "test/cctest/heap/heap-utils.h"
using namespace v8::internal; namespace v8 {
namespace internal {
static Isolate* GetIsolateFrom(LocalContext* context) { static Isolate* GetIsolateFrom(LocalContext* context) {
return reinterpret_cast<Isolate*>((*context)->GetIsolate()); return reinterpret_cast<Isolate*>((*context)->GetIsolate());
...@@ -261,3 +262,6 @@ TEST(Regress399527) { ...@@ -261,3 +262,6 @@ TEST(Regress399527) {
// marking bits which makes the weak map garbage. // marking bits which makes the weak map garbage.
CcTest::CollectAllGarbage(); CcTest::CollectAllGarbage();
} }
} // namespace internal
} // namespace v8
...@@ -42,7 +42,8 @@ ...@@ -42,7 +42,8 @@
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
#include "test/cctest/heap/heap-utils.h" #include "test/cctest/heap/heap-utils.h"
using namespace v8::internal; namespace v8 {
namespace internal {
static Isolate* GetIsolateFrom(LocalContext* context) { static Isolate* GetIsolateFrom(LocalContext* context) {
return reinterpret_cast<Isolate*>((*context)->GetIsolate()); return reinterpret_cast<Isolate*>((*context)->GetIsolate());
...@@ -242,3 +243,6 @@ TEST(WeakSet_Regress2060b) { ...@@ -242,3 +243,6 @@ TEST(WeakSet_Regress2060b) {
CcTest::CollectAllGarbage(); CcTest::CollectAllGarbage();
CcTest::CollectAllGarbage(); CcTest::CollectAllGarbage();
} }
} // 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