diff options
author | 2017-09-21 22:50:39 +0100 | |
---|---|---|
committer | 2017-09-25 15:45:01 +0100 | |
commit | 0ebe0d83138bba1996e9c8007969b5381d972b32 (patch) | |
tree | a5ee66ebc5b587ade97e56ac8fc7d832fbbed4af /compiler/optimizing/builder.cc | |
parent | e1e347dace0ded83774999bb26c37527dcdb1d5a (diff) |
ART: Introduce compiler data type.
Replace most uses of the runtime's Primitive in compiler
with a new class DataType. This prepares for introducing
new types, such as Uint8, that the runtime does not need
to know about.
Test: m test-art-host-gtest
Test: testrunner.py --host
Bug: 23964345
Change-Id: Iec2ad82454eec678fffcd8279a9746b90feb9b0c
Diffstat (limited to 'compiler/optimizing/builder.cc')
-rw-r--r-- | compiler/optimizing/builder.cc | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc index 0d9d3d4c92..0e708ed408 100644 --- a/compiler/optimizing/builder.cc +++ b/compiler/optimizing/builder.cc @@ -20,17 +20,52 @@ #include "base/arena_bit_vector.h" #include "base/bit_vector-inl.h" #include "base/logging.h" +#include "data_type-inl.h" #include "dex/verified_method.h" #include "driver/compiler_options.h" #include "mirror/class_loader.h" #include "mirror/dex_cache.h" #include "nodes.h" -#include "primitive.h" #include "thread.h" #include "utils/dex_cache_arrays_layout-inl.h" namespace art { +HGraphBuilder::HGraphBuilder(HGraph* graph, + DexCompilationUnit* dex_compilation_unit, + const DexCompilationUnit* const outer_compilation_unit, + CompilerDriver* driver, + CodeGenerator* code_generator, + OptimizingCompilerStats* compiler_stats, + const uint8_t* interpreter_metadata, + Handle<mirror::DexCache> dex_cache, + VariableSizedHandleScope* handles) + : graph_(graph), + dex_file_(&graph->GetDexFile()), + code_item_(*dex_compilation_unit->GetCodeItem()), + dex_compilation_unit_(dex_compilation_unit), + compiler_driver_(driver), + compilation_stats_(compiler_stats), + block_builder_(graph, dex_file_, code_item_), + ssa_builder_(graph, + dex_compilation_unit->GetClassLoader(), + dex_compilation_unit->GetDexCache(), + handles), + instruction_builder_(graph, + &block_builder_, + &ssa_builder_, + dex_file_, + code_item_, + DataType::FromShorty(dex_compilation_unit_->GetShorty()[0]), + dex_compilation_unit, + outer_compilation_unit, + driver, + code_generator, + interpreter_metadata, + compiler_stats, + dex_cache, + handles) {} + bool HGraphBuilder::SkipCompilation(size_t number_of_branches) { if (compiler_driver_ == nullptr) { // Note that the compiler driver is null when unit testing. |