// Size in bytes of the should_deoptimize flag on stack. // We just need 4 bytes for our purpose regardless of the architecture. Frame size // calculation will automatically do alignment for the final frame size. static constexpr size_t kShouldDeoptimizeFlagSize = 4;
// OatQuickMethodHeader precedes the raw code chunk generated by the compiler. class PACKED(4) OatQuickMethodHeader { public:
OatQuickMethodHeader(uint32_t code_info_offset = 0) {
SetCodeInfoOffset(code_info_offset);
}
// Check if this is hard-written assembly (i.e. inside libart.so). // Returns std::nullop on Mac. static std::optional<bool> IsStub(const uint8_t* pc);
bool Contains(uintptr_t pc) const {
uintptr_t code_start = reinterpret_cast<uintptr_t>(code_); // Let's not make assumptions about other architectures. #ifdefined(__aarch64__) || defined(__riscv__) || defined(__riscv) // Verify that the code pointer is not tagged. Memory for code gets allocated with // mspace_memalign or memory mapped from a file, neither of which is tagged by MTE/HWASan.
DCHECK_EQ(code_start, reinterpret_cast<uintptr_t>(code_start) & ((UINT64_C(1) << 56) - 1)); #endif
static_assert(kRuntimeQuickCodeISA != InstructionSet::kThumb2, "kThumb2 cannot be a runtime ISA"); if (kRuntimeQuickCodeISA == InstructionSet::kArm) { // On Thumb-2, the pc is offset by one.
code_start++;
} return code_start <= pc && pc <= (code_start + GetCodeSize());
}
const uint8_t* GetEntryPoint() const { // When the runtime architecture is ARM, `kRuntimeQuickCodeISA` is set to `kArm` // (not `kThumb2`), *but* we always generate code for the Thumb-2 // instruction set anyway. Thumb-2 requires the entrypoint to be of // offset 1.
static_assert(kRuntimeQuickCodeISA != InstructionSet::kThumb2, "kThumb2 cannot be a runtime ISA"); return (kRuntimeQuickCodeISA == InstructionSet::kArm)
? reinterpret_cast<uint8_t*>(reinterpret_cast<uintptr_t>(code_) | 1)
: code_;
}
// For non-catch handlers. Only used in test code.
EXPORT uintptr_t ToNativeQuickPc(ArtMethod* method, const uint32_t dex_pc, bool abort_on_failure = true) const;
// For catch handlers.
uintptr_t ToNativeQuickPcForCatchHandlers(ArtMethod* method,
ArrayRef<const uint32_t> dex_pc_list, /* out */ uint32_t* stack_map_row, bool abort_on_failure = true) const;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.