Reduce namespace pollution.
This leaves us with just the mspace stuff and three libdex functions to clean
up. We deliberately expose the JII API, and I don't think there's anything we
can really do about the art_..._from_code stuff (and at least that starts with
"art_").
Change-Id: I77e58e8330cd2afeb496642302dfe3311e68091a
diff --git a/src/compiler/Frontend.cc b/src/compiler/Frontend.cc
index 5be51f4..8070e6f 100644
--- a/src/compiler/Frontend.cc
+++ b/src/compiler/Frontend.cc
@@ -22,6 +22,8 @@
#include "object.h"
#include "runtime.h"
+namespace art {
+
/* Default optimizer/debug setting for the compiler. */
uint32_t compilerOptimizerDisableFlags = 0 | // Disable specific optimizations
//(1 << kLoadStoreElimination) |
@@ -231,7 +233,7 @@
void oatDumpCFG(CompilationUnit* cUnit, const char* dirPrefix)
{
FILE* file;
- std::string name(art::PrettyMethod(cUnit->method_idx, *cUnit->dex_file));
+ std::string name(PrettyMethod(cUnit->method_idx, *cUnit->dex_file));
char startOffset[80];
sprintf(startOffset, "_%x", cUnit->entryBlock->fallThrough->startOffset);
char* fileName = (char*) oatNew(
@@ -432,7 +434,7 @@
/* Identify code range in try blocks and set up the empty catch blocks */
STATIC void processTryCatchBlocks(CompilationUnit* cUnit)
{
- const art::DexFile::CodeItem* code_item = cUnit->code_item;
+ const DexFile::CodeItem* code_item = cUnit->code_item;
int triesSize = code_item->tries_size_;
int offset;
@@ -443,8 +445,8 @@
ArenaBitVector* tryBlockAddr = cUnit->tryBlockAddr;
for (int i = 0; i < triesSize; i++) {
- const art::DexFile::TryItem* pTry =
- art::DexFile::GetTryItems(*code_item, i);
+ const DexFile::TryItem* pTry =
+ DexFile::GetTryItems(*code_item, i);
int startOffset = pTry->start_addr_;
int endOffset = startOffset + pTry->insn_count_;
for (offset = startOffset; offset < endOffset; offset++) {
@@ -453,11 +455,11 @@
}
// Iterate over each of the handlers to enqueue the empty Catch blocks
- const art::byte* handlers_ptr =
- art::DexFile::GetCatchHandlerData(*code_item, 0);
- uint32_t handlers_size = art::DecodeUnsignedLeb128(&handlers_ptr);
+ const byte* handlers_ptr =
+ DexFile::GetCatchHandlerData(*code_item, 0);
+ uint32_t handlers_size = DecodeUnsignedLeb128(&handlers_ptr);
for (uint32_t idx = 0; idx < handlers_size; idx++) {
- art::CatchHandlerIterator iterator(handlers_ptr);
+ CatchHandlerIterator iterator(handlers_ptr);
for (; iterator.HasNext(); iterator.Next()) {
uint32_t address = iterator.GetHandlerAddress();
findBlock(cUnit, address, false /* split */, true /*create*/,
@@ -639,11 +641,11 @@
ArenaBitVector* tryBlockAddr, const u2* codePtr,
const u2* codeEnd)
{
- const art::DexFile::CodeItem* code_item = cUnit->code_item;
+ const DexFile::CodeItem* code_item = cUnit->code_item;
/* In try block */
if (oatIsBitSet(tryBlockAddr, curOffset)) {
- art::CatchHandlerIterator iterator(*code_item, curOffset);
+ CatchHandlerIterator iterator(*code_item, curOffset);
if (curBlock->successorBlockList.blockListType != kNotUsed) {
LOG(FATAL) << "Successor block list already in use: " <<
@@ -712,10 +714,10 @@
/*
* Compile a method.
*/
-CompiledMethod* oatCompileMethod(const Compiler& compiler, const art::DexFile::CodeItem* code_item,
+CompiledMethod* oatCompileMethod(const Compiler& compiler, const DexFile::CodeItem* code_item,
uint32_t access_flags, uint32_t method_idx,
- const art::ClassLoader* class_loader,
- const art::DexFile& dex_file, art::InstructionSet insnSet)
+ const ClassLoader* class_loader,
+ const DexFile& dex_file, InstructionSet insnSet)
{
VLOG(compiler) << "Compiling " << PrettyMethod(method_idx, dex_file) << "...";
oatArenaReset();
@@ -727,7 +729,7 @@
oatInit(compiler);
- art::ClassLinker* class_linker = art::Runtime::Current()->GetClassLinker();
+ ClassLinker* class_linker = Runtime::Current()->GetClassLinker();
UniquePtr<CompilationUnit> cUnit(new CompilationUnit);
memset(cUnit.get(), 0, sizeof(*cUnit));
cUnit->compiler = &compiler;
@@ -935,7 +937,7 @@
+ __builtin_popcount(cUnit->fpSpillMask)));
DCHECK_GE(vmapTable.size(), 1U); // should always at least one INVALID_VREG for lr
- CompiledMethod* result = new CompiledMethod(art::kThumb2, cUnit->codeBuffer,
+ CompiledMethod* result = new CompiledMethod(kThumb2, cUnit->codeBuffer,
cUnit->frameSize, cUnit->coreSpillMask,
cUnit->fpSpillMask, cUnit->mappingTable,
vmapTable);
@@ -960,3 +962,5 @@
LOG(FATAL) << "Failed to initialize oat heap";
}
}
+
+} // namespace art