summaryrefslogtreecommitdiff
path: root/compiler/compiled_method.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2015-02-24 08:10:57 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2015-02-24 08:10:57 +0000
commita5ca888d715cd0c6c421313211caa1928be3e399 (patch)
treebdb08a2cbcf277ab7f02626a23b52a3fdf272ffe /compiler/compiled_method.cc
parent2535abe7d1fcdd0e6aca782b1f1932a703ed50a4 (diff)
Revert "Add JIT"
Sorry, run-test crashes on target: 0-05 12:15:51.633 I/DEBUG (27995): Abort message: 'art/runtime/mirror/art_method.cc:349] Check failed: PcIsWithinQuickCode(reinterpret_cast<uintptr_t>(code), pc) java.lang.Throwable java.lang.Throwable.fillInStackTrace() pc=71e3366b code=0x71e3362d size=ad000000' 10-05 12:15:51.633 I/DEBUG (27995): r0 00000000 r1 0000542b r2 00000006 r3 00000000 10-05 12:15:51.633 I/DEBUG (27995): r4 00000006 r5 b6f9addc r6 00000002 r7 0000010c 10-05 12:15:51.633 I/DEBUG (27995): r8 b63fe1e8 r9 be8e1418 sl b6427400 fp b63fcce0 10-05 12:15:51.633 I/DEBUG (27995): ip 0000542b sp be8e1358 lr b6e9a27b pc b6e9c280 cpsr 40070010 10-05 12:15:51.633 I/DEBUG (27995): Bug: 17950037 This reverts commit 2535abe7d1fcdd0e6aca782b1f1932a703ed50a4. Change-Id: I6f88849bc6f2befed0c0aaa0b7b2a08c967a83c3
Diffstat (limited to 'compiler/compiled_method.cc')
-rw-r--r--compiler/compiled_method.cc75
1 files changed, 15 insertions, 60 deletions
diff --git a/compiler/compiled_method.cc b/compiler/compiled_method.cc
index 1849e7ef64..22be28c4d9 100644
--- a/compiler/compiled_method.cc
+++ b/compiler/compiled_method.cc
@@ -20,29 +20,16 @@
namespace art {
CompiledCode::CompiledCode(CompilerDriver* compiler_driver, InstructionSet instruction_set,
- const ArrayRef<const uint8_t>& quick_code, bool owns_code_array)
+ const ArrayRef<const uint8_t>& quick_code)
: compiler_driver_(compiler_driver), instruction_set_(instruction_set),
- owns_code_array_(owns_code_array), quick_code_(nullptr) {
+ quick_code_(nullptr) {
SetCode(&quick_code);
}
void CompiledCode::SetCode(const ArrayRef<const uint8_t>* quick_code) {
if (quick_code != nullptr) {
CHECK(!quick_code->empty());
- if (owns_code_array_) {
- // If we are supposed to own the code, don't deduplicate it.
- CHECK(quick_code_ == nullptr);
- quick_code_ = new SwapVector<uint8_t>(quick_code->begin(), quick_code->end(),
- compiler_driver_->GetSwapSpaceAllocator());
- } else {
- quick_code_ = compiler_driver_->DeduplicateCode(*quick_code);
- }
- }
-}
-
-CompiledCode::~CompiledCode() {
- if (owns_code_array_) {
- delete quick_code_;
+ quick_code_ = compiler_driver_->DeduplicateCode(*quick_code);
}
}
@@ -59,11 +46,11 @@ bool CompiledCode::operator==(const CompiledCode& rhs) const {
return (rhs.quick_code_ == nullptr);
}
-size_t CompiledCode::AlignCode(size_t offset) const {
+uint32_t CompiledCode::AlignCode(uint32_t offset) const {
return AlignCode(offset, instruction_set_);
}
-size_t CompiledCode::AlignCode(size_t offset, InstructionSet instruction_set) {
+uint32_t CompiledCode::AlignCode(uint32_t offset, InstructionSet instruction_set) {
return RoundUp(offset, GetInstructionSetAlignment(instruction_set));
}
@@ -133,39 +120,17 @@ CompiledMethod::CompiledMethod(CompilerDriver* driver,
const ArrayRef<const uint8_t>& native_gc_map,
const ArrayRef<const uint8_t>& cfi_info,
const ArrayRef<LinkerPatch>& patches)
- : CompiledCode(driver, instruction_set, quick_code, !driver->DedupeEnabled()),
- owns_arrays_(!driver->DedupeEnabled()),
- frame_size_in_bytes_(frame_size_in_bytes), core_spill_mask_(core_spill_mask),
- fp_spill_mask_(fp_spill_mask),
+ : 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),
+ src_mapping_table_(src_mapping_table == nullptr ?
+ driver->DeduplicateSrcMappingTable(ArrayRef<SrcMapElem>()) :
+ driver->DeduplicateSrcMappingTable(ArrayRef<SrcMapElem>(src_mapping_table->Arrange()))),
+ mapping_table_(mapping_table.data() == nullptr ?
+ nullptr : driver->DeduplicateMappingTable(mapping_table)),
+ vmap_table_(driver->DeduplicateVMapTable(vmap_table)),
+ gc_map_(native_gc_map.data() == nullptr ? nullptr : driver->DeduplicateGCMap(native_gc_map)),
+ cfi_info_(cfi_info.data() == nullptr ? nullptr : driver->DeduplicateCFIInfo(cfi_info)),
patches_(patches.begin(), patches.end(), driver->GetSwapSpaceAllocator()) {
- if (owns_arrays_) {
- if (src_mapping_table == nullptr) {
- src_mapping_table_ = new SwapSrcMap(driver->GetSwapSpaceAllocator());
- } else {
- src_mapping_table->Arrange();
- src_mapping_table_ = new SwapSrcMap(src_mapping_table->begin(), src_mapping_table->end(),
- driver->GetSwapSpaceAllocator());
- }
- mapping_table_ = mapping_table.empty() ?
- nullptr : new SwapVector<uint8_t>(mapping_table.begin(), mapping_table.end(),
- driver->GetSwapSpaceAllocator());
- vmap_table_ = new SwapVector<uint8_t>(vmap_table.begin(), vmap_table.end(),
- driver->GetSwapSpaceAllocator());
- gc_map_ = native_gc_map.empty() ? nullptr :
- new SwapVector<uint8_t>(native_gc_map.begin(), native_gc_map.end(),
- driver->GetSwapSpaceAllocator());
- cfi_info_ = cfi_info.empty() ? nullptr :
- new SwapVector<uint8_t>(cfi_info.begin(), cfi_info.end(), driver->GetSwapSpaceAllocator());
- } else {
- src_mapping_table_ = src_mapping_table == nullptr ?
- driver->DeduplicateSrcMappingTable(ArrayRef<SrcMapElem>()) :
- driver->DeduplicateSrcMappingTable(ArrayRef<SrcMapElem>(src_mapping_table->Arrange()));
- mapping_table_ = mapping_table.empty() ?
- nullptr : driver->DeduplicateMappingTable(mapping_table);
- vmap_table_ = driver->DeduplicateVMapTable(vmap_table);
- gc_map_ = native_gc_map.empty() ? nullptr : driver->DeduplicateGCMap(native_gc_map);
- cfi_info_ = cfi_info.empty() ? nullptr : driver->DeduplicateCFIInfo(cfi_info);
- }
}
CompiledMethod* CompiledMethod::SwapAllocCompiledMethod(
@@ -229,14 +194,4 @@ void CompiledMethod::ReleaseSwapAllocatedCompiledMethod(CompilerDriver* driver,
alloc.deallocate(m, 1);
}
-CompiledMethod::~CompiledMethod() {
- if (owns_arrays_) {
- delete src_mapping_table_;
- delete mapping_table_;
- delete vmap_table_;
- delete gc_map_;
- delete cfi_info_;
- }
-}
-
} // namespace art