From 72d32629303f8f39362a4099481f48646aed042f Mon Sep 17 00:00:00 2001 From: Ian Rogers Date: Tue, 6 May 2014 16:20:11 -0700 Subject: Give Compiler a back reference to the driver. The compiler driver is a single object delegating work to the compiler, rather than passing it through to every Compiler call make it a member of Compiler so that it maybe queried. This simplifies the Compiler API and makes the relationship to CompilerDriver more explicit. Remove reference arguments that contravene code style. Change-Id: Iba47f2e3cbda679a7ec7588f26188d77643aa2c6 --- compiler/compiled_method.cc | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'compiler/compiled_method.cc') diff --git a/compiler/compiled_method.cc b/compiler/compiled_method.cc index 59ed8277d0..7441daccfe 100644 --- a/compiler/compiled_method.cc +++ b/compiler/compiled_method.cc @@ -138,7 +138,7 @@ void CompiledCode::AddOatdataOffsetToCompliledCodeOffset(uint32_t offset) { oatdata_offsets_to_compiled_code_offset_.push_back(offset); } -CompiledMethod::CompiledMethod(CompilerDriver& driver, +CompiledMethod::CompiledMethod(CompilerDriver* driver, InstructionSet instruction_set, const std::vector& quick_code, const size_t frame_size_in_bytes, @@ -148,48 +148,48 @@ CompiledMethod::CompiledMethod(CompilerDriver& driver, const std::vector& vmap_table, const std::vector& native_gc_map, const std::vector* cfi_info) - : CompiledCode(&driver, instruction_set, quick_code), frame_size_in_bytes_(frame_size_in_bytes), + : CompiledCode(driver, instruction_set, quick_code), frame_size_in_bytes_(frame_size_in_bytes), core_spill_mask_(core_spill_mask), fp_spill_mask_(fp_spill_mask), - mapping_table_(driver.DeduplicateMappingTable(mapping_table)), - vmap_table_(driver.DeduplicateVMapTable(vmap_table)), - gc_map_(driver.DeduplicateGCMap(native_gc_map)), - cfi_info_(driver.DeduplicateCFIInfo(cfi_info)) { + mapping_table_(driver->DeduplicateMappingTable(mapping_table)), + vmap_table_(driver->DeduplicateVMapTable(vmap_table)), + gc_map_(driver->DeduplicateGCMap(native_gc_map)), + cfi_info_(driver->DeduplicateCFIInfo(cfi_info)) { } -CompiledMethod::CompiledMethod(CompilerDriver& driver, +CompiledMethod::CompiledMethod(CompilerDriver* driver, InstructionSet instruction_set, const std::vector& code, const size_t frame_size_in_bytes, const uint32_t core_spill_mask, const uint32_t fp_spill_mask) - : CompiledCode(&driver, instruction_set, code), + : CompiledCode(driver, instruction_set, code), frame_size_in_bytes_(frame_size_in_bytes), core_spill_mask_(core_spill_mask), fp_spill_mask_(fp_spill_mask), - mapping_table_(driver.DeduplicateMappingTable(std::vector())), - vmap_table_(driver.DeduplicateVMapTable(std::vector())), - gc_map_(driver.DeduplicateGCMap(std::vector())), + mapping_table_(driver->DeduplicateMappingTable(std::vector())), + vmap_table_(driver->DeduplicateVMapTable(std::vector())), + gc_map_(driver->DeduplicateGCMap(std::vector())), cfi_info_(nullptr) { } // Constructs a CompiledMethod for the Portable compiler. -CompiledMethod::CompiledMethod(CompilerDriver& driver, InstructionSet instruction_set, +CompiledMethod::CompiledMethod(CompilerDriver* driver, InstructionSet instruction_set, const std::string& code, const std::vector& gc_map, const std::string& symbol) - : CompiledCode(&driver, instruction_set, code, symbol), + : CompiledCode(driver, instruction_set, code, symbol), frame_size_in_bytes_(kStackAlignment), core_spill_mask_(0), - fp_spill_mask_(0), gc_map_(driver.DeduplicateGCMap(gc_map)) { - mapping_table_ = driver.DeduplicateMappingTable(std::vector()); - vmap_table_ = driver.DeduplicateVMapTable(std::vector()); + fp_spill_mask_(0), gc_map_(driver->DeduplicateGCMap(gc_map)) { + mapping_table_ = driver->DeduplicateMappingTable(std::vector()); + vmap_table_ = driver->DeduplicateVMapTable(std::vector()); } -CompiledMethod::CompiledMethod(CompilerDriver& driver, InstructionSet instruction_set, +CompiledMethod::CompiledMethod(CompilerDriver* driver, InstructionSet instruction_set, const std::string& code, const std::string& symbol) - : CompiledCode(&driver, instruction_set, code, symbol), + : CompiledCode(driver, instruction_set, code, symbol), frame_size_in_bytes_(kStackAlignment), core_spill_mask_(0), fp_spill_mask_(0) { - mapping_table_ = driver.DeduplicateMappingTable(std::vector()); - vmap_table_ = driver.DeduplicateVMapTable(std::vector()); - gc_map_ = driver.DeduplicateGCMap(std::vector()); + mapping_table_ = driver->DeduplicateMappingTable(std::vector()); + vmap_table_ = driver->DeduplicateVMapTable(std::vector()); + gc_map_ = driver->DeduplicateGCMap(std::vector()); } } // namespace art -- cgit v1.2.3-59-g8ed1b