// Copy instructions out of assembly buffer into the given region of memory virtualvoid CopyInstructions(const MemoryRegion& region) = 0;
// Emit code that will create an activation on the stack virtualvoid BuildFrame(size_t frame_size,
ManagedRegister method_reg,
ArrayRef<const ManagedRegister> callee_save_regs) = 0;
// Emit code that will remove an activation from the stack // // Argument `may_suspend` must be `true` if the compiled method may be // suspended during its execution (otherwise `false`, if it is impossible // to suspend during its execution). virtualvoid RemoveFrame(size_t frame_size,
ArrayRef<const ManagedRegister> callee_save_regs, bool may_suspend) = 0;
// Return the same core register but with correct size if the architecture-specific // ManagedRegister has different representation for different sizes. virtual ManagedRegister CoreRegisterWithSize(ManagedRegister src, size_t size) = 0;
// Stores stack pointer by tagging it if required so we can walk the stack. In debuggable runtimes // we use tag to tell if we are using JITed code or AOT code. In non-debuggable runtimes we never // use JITed code when AOT code is present. So checking for AOT code is sufficient to detect which // code is being executed. We avoid tagging in non-debuggable runtimes to reduce instructions. virtualvoid StoreStackPointerToThread(ThreadOffset<kPointerSize> thr_offs, bool tag_sp) = 0;
// Load reference from a `GcRoot<>`. The default is to load as `jint`. Some architectures // (say, RISC-V) override this to provide a different sign- or zero-extension. virtualvoid LoadGcRootWithoutReadBarrier(ManagedRegister dest,
ManagedRegister base,
MemberOffset offs);
// Load reference from a `StackReference<>`. The default is to load as `jint`. Some architectures // (say, RISC-V) override this to provide a different sign- or zero-extension. virtualvoid LoadStackReference(ManagedRegister dest, FrameOffset offs);
// Copying routines
// Move arguments from `srcs` locations to `dests` locations. // // References shall be spilled to `refs` frame offsets (kInvalidReferenceOffset indicates // a non-reference type) if they are in registers and corresponding `dests` shall be // filled with `jobject` replacements. If the first argument is a reference, it is // assumed to be `this` and cannot be null, all other reference arguments can be null. virtualvoid MoveArguments(ArrayRef<ArgumentLocation> dests,
ArrayRef<ArgumentLocation> srcs,
ArrayRef<FrameOffset> refs) = 0;
// Zero extension virtualvoid ZeroExtend(ManagedRegister mreg, size_t size) = 0;
// Exploit fast access in managed code to Thread::Current() virtualvoid GetCurrentThread(ManagedRegister dest) = 0; virtualvoid GetCurrentThread(FrameOffset dest_offset) = 0;
// Manipulating local reference table states. // // These have a default implementation but they can be overridden to use register pair // load/store instructions on architectures that support them (arm, arm64). virtualvoid LoadLocalReferenceTableStates(ManagedRegister jni_env_reg,
ManagedRegister previous_state_reg,
ManagedRegister current_state_reg); virtualvoid StoreLocalReferenceTableStates(ManagedRegister jni_env_reg,
ManagedRegister previous_state_reg,
ManagedRegister current_state_reg);
// Decode JNI transition or local `jobject`. For (weak) global `jobject`, jump to slow path. virtualvoid DecodeJNITransitionOrLocalJObject(ManagedRegister reg,
JNIMacroLabel* slow_path,
JNIMacroLabel* resume) = 0;
// Heap::VerifyObject on src. In some cases (such as a reference to this) we // know that src may not be null. virtualvoid VerifyObject(ManagedRegister src, bool could_be_null) = 0; virtualvoid VerifyObject(FrameOffset src, bool could_be_null) = 0;
// Jump to address held at [base+offset] (used for tail calls). virtualvoid Jump(ManagedRegister base, Offset offset) = 0;
// Call to address held at [base+offset] virtualvoid Call(ManagedRegister base, Offset offset) = 0; virtualvoid CallFromThread(ThreadOffset<kPointerSize> offset) = 0;
// Generate fast-path for transition to Native. Go to `label` if any thread flag is set. // The implementation can use `scratch_regs` which should be callee save core registers // (already saved before this call) and must preserve all argument registers. virtualvoid TryToTransitionFromRunnableToNative(
JNIMacroLabel* label, ArrayRef<const ManagedRegister> scratch_regs) = 0;
// Generate fast-path for transition to Runnable. Go to `label` if any thread flag is set. // The implementation can use `scratch_regs` which should be core argument registers // not used as return registers and it must preserve the `return_reg` if any. virtualvoid TryToTransitionFromNativeToRunnable(JNIMacroLabel* label,
ArrayRef<const ManagedRegister> scratch_regs,
ManagedRegister return_reg) = 0;
// Generate suspend check and branch to `label` if there is a pending suspend request. virtualvoid SuspendCheck(JNIMacroLabel* label) = 0;
// Generate code to check if Thread::Current()->exception_ is non-null // and branch to the `label` if it is. virtualvoid ExceptionPoll(JNIMacroLabel* label) = 0; // Deliver pending exception. virtualvoid DeliverPendingException() = 0;
// Create a new label that can be used with Jump/Bind calls. virtual std::unique_ptr<JNIMacroLabel> CreateLabel() = 0; // Emit an unconditional jump to the label. virtualvoid Jump(JNIMacroLabel* label) = 0; // Emit a conditional jump to the label by applying a unary condition test to the GC marking flag. virtualvoid TestGcMarking(JNIMacroLabel* label, JNIMacroUnaryCondition cond) = 0; // Emit a conditional jump to the label by applying a unary condition test to object's mark bit. virtualvoid TestMarkBit(ManagedRegister ref,
JNIMacroLabel* label,
JNIMacroUnaryCondition cond) = 0; // Emit a conditional jump to label if the loaded value from specified locations is not zero. virtualvoid TestByteAndJumpIfNotZero(uintptr_t address, JNIMacroLabel* label) = 0; // Code at this offset will serve as the target for the Jump call. virtualvoid Bind(JNIMacroLabel* label) = 0;
// Should run-time checks be emitted in debug mode? bool emit_run_time_checks_in_debug_mode_ = false;
};
// A "Label" class used with the JNIMacroAssembler // allowing one to use branches (jumping from one place to another). // // This is just an interface, so every platform must provide // its own implementation of it. // // It is only safe to use a label created // via JNIMacroAssembler::CreateLabel with that same macro assembler. class JNIMacroLabel : public DeletableArenaObject<kArenaAllocAssembler> { public: virtual ~JNIMacroLabel() = 0;
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.