summaryrefslogtreecommitdiff
path: root/compiler/compiled_method.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/compiled_method.cc')
-rw-r--r--compiler/compiled_method.cc63
1 files changed, 23 insertions, 40 deletions
diff --git a/compiler/compiled_method.cc b/compiler/compiled_method.cc
index f06d90c81c..29f004cf87 100644
--- a/compiler/compiled_method.cc
+++ b/compiler/compiled_method.cc
@@ -22,11 +22,12 @@
namespace art {
-CompiledCode::CompiledCode(CompilerDriver* compiler_driver, InstructionSet instruction_set,
+CompiledCode::CompiledCode(CompilerDriver* compiler_driver,
+ InstructionSet instruction_set,
const ArrayRef<const uint8_t>& quick_code)
: compiler_driver_(compiler_driver),
- instruction_set_(instruction_set),
- quick_code_(compiler_driver_->GetCompiledMethodStorage()->DeduplicateCode(quick_code)) {
+ quick_code_(compiler_driver_->GetCompiledMethodStorage()->DeduplicateCode(quick_code)),
+ packed_fields_(InstructionSetField::Encode(instruction_set)) {
}
CompiledCode::~CompiledCode() {
@@ -47,7 +48,7 @@ bool CompiledCode::operator==(const CompiledCode& rhs) const {
}
size_t CompiledCode::AlignCode(size_t offset) const {
- return AlignCode(offset, instruction_set_);
+ return AlignCode(offset, GetInstructionSet());
}
size_t CompiledCode::AlignCode(size_t offset, InstructionSet instruction_set) {
@@ -55,19 +56,19 @@ size_t CompiledCode::AlignCode(size_t offset, InstructionSet instruction_set) {
}
size_t CompiledCode::CodeDelta() const {
- return CodeDelta(instruction_set_);
+ return CodeDelta(GetInstructionSet());
}
size_t CompiledCode::CodeDelta(InstructionSet instruction_set) {
switch (instruction_set) {
- case kArm:
- case kArm64:
- case kMips:
- case kMips64:
- case kX86:
- case kX86_64:
+ case InstructionSet::kArm:
+ case InstructionSet::kArm64:
+ case InstructionSet::kMips:
+ case InstructionSet::kMips64:
+ case InstructionSet::kX86:
+ case InstructionSet::kX86_64:
return 0;
- case kThumb2: {
+ case InstructionSet::kThumb2: {
// +1 to set the low-order bit so a BLX will switch to Thumb mode
return 1;
}
@@ -77,17 +78,16 @@ size_t CompiledCode::CodeDelta(InstructionSet instruction_set) {
}
}
-const void* CompiledCode::CodePointer(const void* code_pointer,
- InstructionSet instruction_set) {
+const void* CompiledCode::CodePointer(const void* code_pointer, InstructionSet instruction_set) {
switch (instruction_set) {
- case kArm:
- case kArm64:
- case kMips:
- case kMips64:
- case kX86:
- case kX86_64:
+ case InstructionSet::kArm:
+ case InstructionSet::kArm64:
+ case InstructionSet::kMips:
+ case InstructionSet::kMips64:
+ case InstructionSet::kX86:
+ case InstructionSet::kX86_64:
return code_pointer;
- case kThumb2: {
+ case InstructionSet::kThumb2: {
uintptr_t address = reinterpret_cast<uintptr_t>(code_pointer);
// Set the low-order bit so a BLX will switch to Thumb mode
address |= 0x1;
@@ -102,18 +102,10 @@ const void* CompiledCode::CodePointer(const void* code_pointer,
CompiledMethod::CompiledMethod(CompilerDriver* driver,
InstructionSet instruction_set,
const ArrayRef<const uint8_t>& quick_code,
- const size_t frame_size_in_bytes,
- const uint32_t core_spill_mask,
- const uint32_t fp_spill_mask,
- const ArrayRef<const SrcMapElem>& src_mapping_table,
const ArrayRef<const uint8_t>& vmap_table,
const ArrayRef<const uint8_t>& cfi_info,
- const ArrayRef<const LinkerPatch>& patches)
+ const ArrayRef<const linker::LinkerPatch>& patches)
: 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_(
- driver->GetCompiledMethodStorage()->DeduplicateSrcMappingTable(src_mapping_table)),
vmap_table_(driver->GetCompiledMethodStorage()->DeduplicateVMapTable(vmap_table)),
cfi_info_(driver->GetCompiledMethodStorage()->DeduplicateCFIInfo(cfi_info)),
patches_(driver->GetCompiledMethodStorage()->DeduplicateLinkerPatches(patches)) {
@@ -123,23 +115,15 @@ CompiledMethod* CompiledMethod::SwapAllocCompiledMethod(
CompilerDriver* driver,
InstructionSet instruction_set,
const ArrayRef<const uint8_t>& quick_code,
- const size_t frame_size_in_bytes,
- const uint32_t core_spill_mask,
- const uint32_t fp_spill_mask,
- const ArrayRef<const SrcMapElem>& src_mapping_table,
const ArrayRef<const uint8_t>& vmap_table,
const ArrayRef<const uint8_t>& cfi_info,
- const ArrayRef<const LinkerPatch>& patches) {
+ const ArrayRef<const linker::LinkerPatch>& patches) {
SwapAllocator<CompiledMethod> alloc(driver->GetCompiledMethodStorage()->GetSwapSpaceAllocator());
CompiledMethod* ret = alloc.allocate(1);
alloc.construct(ret,
driver,
instruction_set,
quick_code,
- frame_size_in_bytes,
- core_spill_mask,
- fp_spill_mask,
- src_mapping_table,
vmap_table,
cfi_info, patches);
return ret;
@@ -156,7 +140,6 @@ CompiledMethod::~CompiledMethod() {
storage->ReleaseLinkerPatches(patches_);
storage->ReleaseCFIInfo(cfi_info_);
storage->ReleaseVMapTable(vmap_table_);
- storage->ReleaseSrcMappingTable(src_mapping_table_);
}
} // namespace art