diff options
author | 2016-10-03 08:46:48 +0000 | |
---|---|---|
committer | 2016-10-04 17:51:46 +0100 | |
commit | aad75c6d5bfab2dc8e30fc99fafe8cd2dc8b74d8 (patch) | |
tree | c1b9e1eabcf35c5cbb5b4f46313a4e062f2d5d51 /compiler/compiled_method.h | |
parent | 82d4838d6bb3480cd25327cedc5179fb2d86881c (diff) |
Revert "Revert "Store resolved Strings for AOT code in .bss.""
Fixed oat_test to keep dex files alive. Fixed mips build.
Rewritten the .bss GC root visiting and added write barrier
to the artResolveStringFromCode().
Test: build aosp_mips-eng
Test: m ART_DEFAULT_GC_TYPE=SS test-art-target-host-gtest-oat_test
Test: Run ART test suite on host and Nexus 9.
Bug: 20323084
Bug: 30627598
This reverts commit 5f926055cb88089d8ca27243f35a9dfd89d981f0.
Change-Id: I07fa2278d82b8eb64964c9a4b66cb93726ccda6b
Diffstat (limited to 'compiler/compiled_method.h')
-rw-r--r-- | compiler/compiled_method.h | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/compiler/compiled_method.h b/compiler/compiled_method.h index 1a87448e80..99b0ac10d1 100644 --- a/compiler/compiled_method.h +++ b/compiler/compiled_method.h @@ -177,6 +177,7 @@ class LinkerPatch { kTypeRelative, // NOTE: Actual patching is instruction_set-dependent. kString, kStringRelative, // NOTE: Actual patching is instruction_set-dependent. + kStringBssEntry, // NOTE: Actual patching is instruction_set-dependent. kDexCacheArray, // NOTE: Actual patching is instruction_set-dependent. }; @@ -244,10 +245,20 @@ class LinkerPatch { return patch; } + static LinkerPatch StringBssEntryPatch(size_t literal_offset, + const DexFile* target_dex_file, + uint32_t pc_insn_offset, + uint32_t target_string_idx) { + LinkerPatch patch(literal_offset, Type::kStringBssEntry, target_dex_file); + patch.string_idx_ = target_string_idx; + patch.pc_insn_offset_ = pc_insn_offset; + return patch; + } + static LinkerPatch DexCacheArrayPatch(size_t literal_offset, const DexFile* target_dex_file, uint32_t pc_insn_offset, - size_t element_offset) { + uint32_t element_offset) { DCHECK(IsUint<32>(element_offset)); LinkerPatch patch(literal_offset, Type::kDexCacheArray, target_dex_file); patch.pc_insn_offset_ = pc_insn_offset; @@ -271,6 +282,7 @@ class LinkerPatch { case Type::kCallRelative: case Type::kTypeRelative: case Type::kStringRelative: + case Type::kStringBssEntry: case Type::kDexCacheArray: return true; default: @@ -296,12 +308,16 @@ class LinkerPatch { } const DexFile* TargetStringDexFile() const { - DCHECK(patch_type_ == Type::kString || patch_type_ == Type::kStringRelative); + DCHECK(patch_type_ == Type::kString || + patch_type_ == Type::kStringRelative || + patch_type_ == Type::kStringBssEntry); return target_dex_file_; } uint32_t TargetStringIndex() const { - DCHECK(patch_type_ == Type::kString || patch_type_ == Type::kStringRelative); + DCHECK(patch_type_ == Type::kString || + patch_type_ == Type::kStringRelative || + patch_type_ == Type::kStringBssEntry); return string_idx_; } @@ -318,6 +334,7 @@ class LinkerPatch { uint32_t PcInsnOffset() const { DCHECK(patch_type_ == Type::kTypeRelative || patch_type_ == Type::kStringRelative || + patch_type_ == Type::kStringBssEntry || patch_type_ == Type::kDexCacheArray); return pc_insn_offset_; } |