Commit 02fdbcc0 authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[turbofan] Avoid disallowed "using namespace" directive.

R=leszeks@chromium.org

Change-Id: Iae67b6b81459304192c81b1367a11fba076c7512
Reviewed-on: https://chromium-review.googlesource.com/645630Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47741}
parent 88212a2a
......@@ -12,7 +12,9 @@ namespace v8 {
namespace internal {
namespace compiler {
using namespace interpreter;
using interpreter::Bytecode;
using interpreter::Bytecodes;
using interpreter::OperandType;
BytecodeLoopAssignments::BytecodeLoopAssignments(int parameter_count,
int register_count, Zone* zone)
......@@ -74,7 +76,7 @@ BytecodeAnalysis::BytecodeAnalysis(Handle<BytecodeArray> bytecode_array,
namespace {
void UpdateInLiveness(Bytecode bytecode, BytecodeLivenessState& in_liveness,
const BytecodeArrayAccessor& accessor) {
const interpreter::BytecodeArrayAccessor& accessor) {
int num_operands = Bytecodes::NumberOfOperands(bytecode);
const OperandType* operand_types = Bytecodes::GetOperandTypes(bytecode);
......@@ -167,7 +169,7 @@ void UpdateInLiveness(Bytecode bytecode, BytecodeLivenessState& in_liveness,
void UpdateOutLiveness(Bytecode bytecode, BytecodeLivenessState& out_liveness,
BytecodeLivenessState* next_bytecode_in_liveness,
const BytecodeArrayAccessor& accessor,
const interpreter::BytecodeArrayAccessor& accessor,
const BytecodeLivenessMap& liveness_map) {
int current_offset = accessor.current_offset();
const Handle<BytecodeArray>& bytecode_array = accessor.bytecode_array();
......@@ -219,7 +221,7 @@ void UpdateOutLiveness(Bytecode bytecode, BytecodeLivenessState& out_liveness,
}
void UpdateAssignments(Bytecode bytecode, BytecodeLoopAssignments& assignments,
const BytecodeArrayAccessor& accessor) {
const interpreter::BytecodeArrayAccessor& accessor) {
int num_operands = Bytecodes::NumberOfOperands(bytecode);
const OperandType* operand_types = Bytecodes::GetOperandTypes(bytecode);
......@@ -260,7 +262,7 @@ void BytecodeAnalysis::Analyze(BailoutId osr_bailout_id) {
int osr_loop_end_offset =
osr_bailout_id.IsNone() ? -1 : osr_bailout_id.ToInt();
BytecodeArrayRandomIterator iterator(bytecode_array(), zone());
interpreter::BytecodeArrayRandomIterator iterator(bytecode_array(), zone());
for (iterator.GoToEnd(); iterator.IsValid(); --iterator) {
Bytecode bytecode = iterator.current_bytecode();
int current_offset = iterator.current_offset();
......@@ -495,7 +497,7 @@ std::ostream& BytecodeAnalysis::PrintLivenessTo(std::ostream& os) const {
#if DEBUG
bool BytecodeAnalysis::LivenessIsValid() {
BytecodeArrayRandomIterator iterator(bytecode_array(), zone());
interpreter::BytecodeArrayRandomIterator iterator(bytecode_array(), zone());
BytecodeLivenessState previous_liveness(bytecode_array()->register_count(),
zone());
......@@ -585,7 +587,7 @@ bool BytecodeAnalysis::LivenessIsValid() {
int loop_indent = 0;
BytecodeArrayIterator forward_iterator(bytecode_array());
interpreter::BytecodeArrayIterator forward_iterator(bytecode_array());
for (; !forward_iterator.done(); forward_iterator.Advance()) {
int current_offset = forward_iterator.current_offset();
const BitVector& in_liveness =
......
......@@ -15,8 +15,6 @@
#include "src/snapshot/partial-serializer.h"
#include "src/snapshot/startup-serializer.h"
using namespace v8;
class SnapshotWriter {
public:
SnapshotWriter() : snapshot_cpp_path_(NULL), snapshot_blob_path_(NULL) {}
......@@ -103,7 +101,7 @@ class SnapshotWriter {
}
static FILE* GetFileDescriptorOrDie(const char* filename) {
FILE* fp = base::OS::FOpen(filename, "wb");
FILE* fp = v8::base::OS::FOpen(filename, "wb");
if (fp == NULL) {
i::PrintF("Unable to open file \"%s\" for writing.\n", filename);
exit(1);
......@@ -118,7 +116,7 @@ class SnapshotWriter {
char* GetExtraCode(char* filename, const char* description) {
if (filename == NULL || strlen(filename) == 0) return NULL;
::printf("Loading script for %s: %s\n", description, filename);
FILE* file = base::OS::FOpen(filename, "rb");
FILE* file = v8::base::OS::FOpen(filename, "rb");
if (file == NULL) {
fprintf(stderr, "Failed to open '%s': errno %d\n", filename, errno);
exit(1);
......@@ -156,7 +154,7 @@ int main(int argc, char** argv) {
}
i::CpuFeatures::Probe(true);
V8::InitializeICUDefaultLocation(argv[0]);
v8::V8::InitializeICUDefaultLocation(argv[0]);
v8::Platform* platform = v8::platform::CreateDefaultPlatform();
v8::V8::InitializePlatform(platform);
v8::V8::Initialize();
......@@ -167,12 +165,12 @@ int main(int argc, char** argv) {
if (i::FLAG_startup_blob) writer.SetStartupBlobFile(i::FLAG_startup_blob);
char* embed_script = GetExtraCode(argc >= 2 ? argv[1] : NULL, "embedding");
StartupData blob = v8::V8::CreateSnapshotDataBlob(embed_script);
v8::StartupData blob = v8::V8::CreateSnapshotDataBlob(embed_script);
delete[] embed_script;
char* warmup_script = GetExtraCode(argc >= 3 ? argv[2] : NULL, "warm up");
if (warmup_script) {
StartupData cold = blob;
v8::StartupData cold = blob;
blob = v8::V8::WarmUpSnapshotDataBlob(cold, warmup_script);
delete[] cold.data;
delete[] warmup_script;
......@@ -183,8 +181,8 @@ int main(int argc, char** argv) {
delete[] blob.data;
}
V8::Dispose();
V8::ShutdownPlatform();
v8::V8::Dispose();
v8::V8::ShutdownPlatform();
delete platform;
return 0;
}
......@@ -5,12 +5,13 @@
#include "src/eh-frame.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace v8 {
namespace internal {
// Test enabled only on supported architectures.
#if defined(V8_TARGET_ARCH_X64) || defined(V8_TARGET_ARCH_ARM) || \
defined(V8_TARGET_ARCH_ARM64)
using namespace v8::internal;
namespace {
class EhFrameIteratorTest : public testing::Test {};
......@@ -59,3 +60,6 @@ TEST_F(EhFrameIteratorTest, SLEB128DecodingNegative) {
}
#endif
} // namespace internal
} // namespace v8
......@@ -5,12 +5,13 @@
#include "src/eh-frame.h"
#include "test/unittests/test-utils.h"
namespace v8 {
namespace internal {
// Test enabled only on supported architectures.
#if defined(V8_TARGET_ARCH_X64) || defined(V8_TARGET_ARCH_ARM) || \
defined(V8_TARGET_ARCH_ARM64)
using namespace v8::internal;
namespace {
class EhFrameWriterTest : public TestWithZone {
......@@ -467,3 +468,6 @@ TEST_F(EhFrameWriterTest, EhFrameHdrLayout) {
}
#endif
} // 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