From 33f7c8aa87831945c567f57c8b860f216c4371ae Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Mon, 19 Nov 2018 10:22:01 +0000 Subject: Remove CompiledMethod dependency on CompilerDriver. Test: m test-art-host-gtest Change-Id: Ibee78d5c54d3ff8162258963fde25065b579a000 --- compiler/compiled_method.cc | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'compiler/compiled_method.cc') 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& 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& quick_code, const ArrayRef& vmap_table, const ArrayRef& cfi_info, const ArrayRef& 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& quick_code, const ArrayRef& vmap_table, const ArrayRef& cfi_info, const ArrayRef& patches) { - SwapAllocator alloc(driver->GetCompiledMethodStorage()->GetSwapSpaceAllocator()); + SwapAllocator 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 alloc(driver->GetCompiledMethodStorage()->GetSwapSpaceAllocator()); +void CompiledMethod::ReleaseSwapAllocatedCompiledMethod(CompiledMethodStorage* storage, + CompiledMethod* m) { + SwapAllocator 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_); -- cgit v1.2.3-59-g8ed1b