#include "platform_macro.h" #if defined(TARGET_ARCH_ARM64) #include "MemoryAllocator/CodeBuffer/code-buffer-arm64.h" arm64_inst_t CodeBuffer::LoadInst(int offset) { return *reinterpret_cast(buffer + offset); } void CodeBuffer::FixBindLabel(int offset, arm64_inst_t instr) { *reinterpret_cast(buffer + offset) = instr; return; } void CodeBuffer::EmitInst(arm64_inst_t instr) { DLOG(0, "[code buffer] EmitInst from arm64 with %x, cursor %x", instr, buffer_cursor); ensureCapacity(getSize() + sizeof(arm64_inst_t)); *reinterpret_cast(getCursor()) = instr; buffer_cursor += sizeof(arm64_inst_t); return; } void CodeBuffer::Emit64(int64_t data) { DLOG(0, "[code buffer] Emit64 from arm64 with %x, cursor %x", data, buffer_cursor); ensureCapacity(getSize() + sizeof(int64_t)); *reinterpret_cast(getCursor()) = data; buffer_cursor += sizeof(int64_t); return; } #endif