summaryrefslogtreecommitdiffstats
path: root/compiler/dex/compiler_ir.h
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/dex/compiler_ir.h')
-rw-r--r--compiler/dex/compiler_ir.h54
1 files changed, 19 insertions, 35 deletions
diff --git a/compiler/dex/compiler_ir.h b/compiler/dex/compiler_ir.h
index 34585c1f87..e7182a919b 100644
--- a/compiler/dex/compiler_ir.h
+++ b/compiler/dex/compiler_ir.h
@@ -17,31 +17,25 @@
#ifndef ART_COMPILER_DEX_COMPILER_IR_H_
#define ART_COMPILER_DEX_COMPILER_IR_H_
+#include "jni.h"
#include <string>
#include <vector>
-#include "compiler_enums.h"
-#include "driver/compiler_driver.h"
-#include "utils/scoped_arena_allocator.h"
#include "base/timing_logger.h"
+#include "invoke_type.h"
+#include "safe_map.h"
#include "utils/arena_allocator.h"
+#include "utils/scoped_arena_allocator.h"
namespace art {
class Backend;
class ClassLinker;
+class CompilerDriver;
class MIRGraph;
-/*
- * TODO: refactoring pass to move these (and other) typedefs towards usage style of runtime to
- * add type safety (see runtime/offsets.h).
- */
-typedef uint32_t DexOffset; // Dex offset in code units.
-typedef uint16_t NarrowDexOffset; // For use in structs, Dex offsets range from 0 .. 0xffff.
-typedef uint32_t CodeOffset; // Native code offset in bytes.
-
struct CompilationUnit {
- explicit CompilationUnit(ArenaPool* pool);
+ CompilationUnit(ArenaPool* pool, InstructionSet isa, CompilerDriver* driver, ClassLinker* linker);
~CompilationUnit();
void StartTimingSplit(const char* label);
@@ -52,30 +46,20 @@ struct CompilationUnit {
* Fields needed/generated by common frontend and generally used throughout
* the compiler.
*/
- CompilerDriver* compiler_driver;
- ClassLinker* class_linker; // Linker to resolve fields and methods.
- const DexFile* dex_file; // DexFile containing the method being compiled.
- jobject class_loader; // compiling method's class loader.
- uint16_t class_def_idx; // compiling method's defining class definition index.
- uint32_t method_idx; // compiling method's index into method_ids of DexFile.
- uint32_t access_flags; // compiling method's access flags.
- InvokeType invoke_type; // compiling method's invocation type.
- const char* shorty; // compiling method's shorty.
- uint32_t disable_opt; // opt_control_vector flags.
- uint32_t enable_debug; // debugControlVector flags.
+ CompilerDriver* const compiler_driver;
+ ClassLinker* const class_linker; // Linker to resolve fields and methods.
+ const DexFile* dex_file; // DexFile containing the method being compiled.
+ jobject class_loader; // compiling method's class loader.
+ uint16_t class_def_idx; // compiling method's defining class definition index.
+ uint32_t method_idx; // compiling method's index into method_ids of DexFile.
+ uint32_t access_flags; // compiling method's access flags.
+ InvokeType invoke_type; // compiling method's invocation type.
+ const char* shorty; // compiling method's shorty.
+ uint32_t disable_opt; // opt_control_vector flags.
+ uint32_t enable_debug; // debugControlVector flags.
bool verbose;
- const Compiler* compiler;
- InstructionSet instruction_set;
- bool target64;
-
- const InstructionSetFeatures* GetInstructionSetFeatures() {
- return compiler_driver->GetInstructionSetFeatures();
- }
-
- // If non-empty, apply optimizer/debug flags only to matching methods.
- std::string compiler_method_match;
- // Flips sense of compiler_method_match - apply flags if doesn't match.
- bool compiler_flip_match;
+ const InstructionSet instruction_set;
+ const bool target64;
// TODO: move memory management to mir_graph, or just switch to using standard containers.
ArenaAllocator arena;