summaryrefslogtreecommitdiff
path: root/compiler/linker/linker_patch.h
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/linker/linker_patch.h')
-rw-r--r--compiler/linker/linker_patch.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/compiler/linker/linker_patch.h b/compiler/linker/linker_patch.h
index f9e3930f56..1c523dee36 100644
--- a/compiler/linker/linker_patch.h
+++ b/compiler/linker/linker_patch.h
@@ -52,6 +52,7 @@ class LinkerPatch {
kTypeBssEntry,
kStringRelative,
kStringBssEntry,
+ kCallEntrypoint,
kBakerReadBarrierBranch,
};
@@ -141,6 +142,15 @@ class LinkerPatch {
return patch;
}
+ static LinkerPatch CallEntrypointPatch(size_t literal_offset,
+ uint32_t entrypoint_offset) {
+ LinkerPatch patch(literal_offset,
+ Type::kCallEntrypoint,
+ /* target_dex_file= */ nullptr);
+ patch.entrypoint_offset_ = entrypoint_offset;
+ return patch;
+ }
+
static LinkerPatch BakerReadBarrierBranchPatch(size_t literal_offset,
uint32_t custom_value1 = 0u,
uint32_t custom_value2 = 0u) {
@@ -216,6 +226,11 @@ class LinkerPatch {
return pc_insn_offset_;
}
+ uint32_t EntrypointOffset() const {
+ DCHECK(patch_type_ == Type::kCallEntrypoint);
+ return entrypoint_offset_;
+ }
+
uint32_t GetBakerCustomValue1() const {
DCHECK(patch_type_ == Type::kBakerReadBarrierBranch);
return baker_custom_value1_;
@@ -249,6 +264,7 @@ class LinkerPatch {
uint32_t type_idx_; // Type index for Type patches.
uint32_t string_idx_; // String index for String patches.
uint32_t intrinsic_data_; // Data for IntrinsicObjects.
+ uint32_t entrypoint_offset_; // Entrypoint offset in the Thread object.
uint32_t baker_custom_value1_;
static_assert(sizeof(method_idx_) == sizeof(cmp1_), "needed by relational operators");
static_assert(sizeof(type_idx_) == sizeof(cmp1_), "needed by relational operators");