diff options
author | 2018-11-19 10:22:01 +0000 | |
---|---|---|
committer | 2018-11-19 10:45:13 +0000 | |
commit | 33f7c8aa87831945c567f57c8b860f216c4371ae (patch) | |
tree | 9022cb2fe8bf889c0a32f4478b249145318a7a65 /compiler/compiled_method.cc | |
parent | 54c7da9c50ee85ade636605cd6ea18b4c2bc69fa (diff) |
Remove CompiledMethod dependency on CompilerDriver.
Test: m test-art-host-gtest
Change-Id: Ibee78d5c54d3ff8162258963fde25065b579a000
Diffstat (limited to 'compiler/compiled_method.cc')
-rw-r--r-- | compiler/compiled_method.cc | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/compiler/compiled_method.cc b/compiler/compiled_method.cc index 29f004cf87..ef9d919c75 100644 --- a/compiler/compiled_method.cc +++ b/compiler/compiled_method.cc @@ -17,21 +17,20 @@ #include "compiled_method.h" #include "driver/compiled_method_storage.h" -#include "driver/compiler_driver.h" #include "utils/swap_space.h" namespace art { -CompiledCode::CompiledCode(CompilerDriver* compiler_driver, +CompiledCode::CompiledCode(CompiledMethodStorage* storage, InstructionSet instruction_set, const ArrayRef<const uint8_t>& quick_code) - : compiler_driver_(compiler_driver), - quick_code_(compiler_driver_->GetCompiledMethodStorage()->DeduplicateCode(quick_code)), + : storage_(storage), + quick_code_(storage->DeduplicateCode(quick_code)), packed_fields_(InstructionSetField::Encode(instruction_set)) { } CompiledCode::~CompiledCode() { - compiler_driver_->GetCompiledMethodStorage()->ReleaseCode(quick_code_); + GetStorage()->ReleaseCode(quick_code_); } bool CompiledCode::operator==(const CompiledCode& rhs) const { @@ -99,29 +98,29 @@ const void* CompiledCode::CodePointer(const void* code_pointer, InstructionSet i } } -CompiledMethod::CompiledMethod(CompilerDriver* driver, +CompiledMethod::CompiledMethod(CompiledMethodStorage* storage, InstructionSet instruction_set, const ArrayRef<const uint8_t>& quick_code, const ArrayRef<const uint8_t>& vmap_table, const ArrayRef<const uint8_t>& cfi_info, const ArrayRef<const linker::LinkerPatch>& patches) - : CompiledCode(driver, instruction_set, quick_code), - vmap_table_(driver->GetCompiledMethodStorage()->DeduplicateVMapTable(vmap_table)), - cfi_info_(driver->GetCompiledMethodStorage()->DeduplicateCFIInfo(cfi_info)), - patches_(driver->GetCompiledMethodStorage()->DeduplicateLinkerPatches(patches)) { + : CompiledCode(storage, instruction_set, quick_code), + vmap_table_(storage->DeduplicateVMapTable(vmap_table)), + cfi_info_(storage->DeduplicateCFIInfo(cfi_info)), + patches_(storage->DeduplicateLinkerPatches(patches)) { } CompiledMethod* CompiledMethod::SwapAllocCompiledMethod( - CompilerDriver* driver, + CompiledMethodStorage* storage, InstructionSet instruction_set, const ArrayRef<const uint8_t>& quick_code, const ArrayRef<const uint8_t>& vmap_table, const ArrayRef<const uint8_t>& cfi_info, const ArrayRef<const linker::LinkerPatch>& patches) { - SwapAllocator<CompiledMethod> alloc(driver->GetCompiledMethodStorage()->GetSwapSpaceAllocator()); + SwapAllocator<CompiledMethod> alloc(storage->GetSwapSpaceAllocator()); CompiledMethod* ret = alloc.allocate(1); alloc.construct(ret, - driver, + storage, instruction_set, quick_code, vmap_table, @@ -129,14 +128,15 @@ CompiledMethod* CompiledMethod::SwapAllocCompiledMethod( return ret; } -void CompiledMethod::ReleaseSwapAllocatedCompiledMethod(CompilerDriver* driver, CompiledMethod* m) { - SwapAllocator<CompiledMethod> alloc(driver->GetCompiledMethodStorage()->GetSwapSpaceAllocator()); +void CompiledMethod::ReleaseSwapAllocatedCompiledMethod(CompiledMethodStorage* storage, + CompiledMethod* m) { + SwapAllocator<CompiledMethod> alloc(storage->GetSwapSpaceAllocator()); alloc.destroy(m); alloc.deallocate(m, 1); } CompiledMethod::~CompiledMethod() { - CompiledMethodStorage* storage = GetCompilerDriver()->GetCompiledMethodStorage(); + CompiledMethodStorage* storage = GetStorage(); storage->ReleaseLinkerPatches(patches_); storage->ReleaseCFIInfo(cfi_info_); storage->ReleaseVMapTable(vmap_table_); |