Compiler: Spring cleaning
Significant restructuring of the Quick compiler to break out the
common frontend more cleanly. Additional C++'ification.
The goal is to move from the monolithic structure of the old
JIT towards a more modular model in which components - in
particular the compiler backend - can be replaced. This CL
focuses on moving MIR-related data from the CompilationUnit
struct into a new MIRGraph class. The next CL will isolate all
LIR-related data and code down into the Quick backend.
This change will happen in multiple steps, and may look uglier
before it starts looking better.
Among the changes:
o Moved all mir-related fields from CompilationUnit to new
MirGraph class.
o Moved the register promotion stuff into the Quick backend.
o Deleted the GBC to LIR conversion code.
o Replaced with old C-style function pointer dataflow analysis
dispatcher with a basic block iterator class.
o Renamed some files to make the name more consistent with what
the code actually does.
o Added the foundation for future inlining support.
o Stripped out the remains of the old fingerprinting mechanism.
Change-Id: I6c30facc642f8084b1c7b2075cf7014de387aa56
diff --git a/src/compiler/dex/frontend.h b/src/compiler/dex/frontend.h
index 4c906be..874ee0b 100644
--- a/src/compiler/dex/frontend.h
+++ b/src/compiler/dex/frontend.h
@@ -31,17 +31,6 @@
class IRBuilder;
}
-#define COMPILER_TRACED(X)
-#define COMPILER_TRACEE(X)
-
-/*
- * Special offsets to denote method entry/exit for debugger update.
- * NOTE: bit pattern must be loadable using 1 instruction and must
- * not be a valid Dalvik offset.
- */
-#define DEBUGGER_METHOD_ENTRY -1
-#define DEBUGGER_METHOD_EXIT -2
-
/*
* Assembly is an iterative process, and usually terminates within
* two or three passes. This should be high enough to handle bizarre
@@ -57,7 +46,6 @@
kNullCheckElimination,
kPromoteRegs,
kTrackLiveTemps,
- kSkipLargeMethodOptimization,
kSafeOptimizations,
kBBOpt,
kMatch,
@@ -86,24 +74,12 @@
};
enum OatMethodAttributes {
- kIsCallee = 0, // Code is part of a callee (invoked by a hot trace).
- kIsHot, // Code is part of a hot trace.
kIsLeaf, // Method is leaf.
- kIsEmpty, // Method is empty.
- kIsThrowFree, // Method doesn't throw.
- kIsGetter, // Method fits the getter pattern.
- kIsSetter, // Method fits the setter pattern.
- kCannotCompile, // Method cannot be compiled.
+ kHasLoop, // Method contains simple loop.
};
-#define METHOD_IS_CALLEE (1 << kIsCallee)
-#define METHOD_IS_HOT (1 << kIsHot)
#define METHOD_IS_LEAF (1 << kIsLeaf)
-#define METHOD_IS_EMPTY (1 << kIsEmpty)
-#define METHOD_IS_THROW_FREE (1 << kIsThrowFree)
-#define METHOD_IS_GETTER (1 << kIsGetter)
-#define METHOD_IS_SETTER (1 << kIsSetter)
-#define METHOD_CANNOT_COMPILE (1 << kCannotCompile)
+#define METHOD_HAS_LOOP (1 << kHasLoop)
class LLVMInfo {
public:
@@ -136,9 +112,6 @@
struct CompilationUnit;
struct BasicBlock;
-BasicBlock* FindBlock(CompilationUnit* cu, unsigned int code_offset);
-void ReplaceSpecialChars(std::string& str);
-
} // namespace art
extern "C" art::CompiledMethod* ArtCompileMethod(art::CompilerDriver& driver,