From 73819d45b762b51725270d01131e03f5d4c2c11b Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Tue, 27 Nov 2018 17:00:29 +0100 Subject: [PATCH] - annotate which function we are calling for better dumpjit info --- src/scripting/vm/jit_call.cpp | 6 ++++-- src/scripting/vm/jitintern.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/scripting/vm/jit_call.cpp b/src/scripting/vm/jit_call.cpp index c86176c34..c3c1802ed 100644 --- a/src/scripting/vm/jit_call.cpp +++ b/src/scripting/vm/jit_call.cpp @@ -62,13 +62,13 @@ void JitCompiler::EmitCALL_K() { auto ptr = newTempIntPtr(); cc.mov(ptr, asmjit::imm_ptr(target)); - EmitVMCall(ptr); + EmitVMCall(ptr, target); } pc += C; // Skip RESULTs } -void JitCompiler::EmitVMCall(asmjit::X86Gp vmfunc) +void JitCompiler::EmitVMCall(asmjit::X86Gp vmfunc, VMFunction *target) { using namespace asmjit; @@ -97,6 +97,7 @@ void JitCompiler::EmitVMCall(asmjit::X86Gp vmfunc) call->setArg(2, Imm(B)); call->setArg(3, GetCallReturns()); call->setArg(4, Imm(C)); + call->setInlineComment(target ? target->PrintableName.GetChars() : "VMCall"); LoadInOuts(); LoadReturns(pc + 1, C); @@ -324,6 +325,7 @@ void JitCompiler::EmitNativeCall(VMNativeFunction *target) asmjit::CBNode *cursorBefore = cc.getCursor(); auto call = cc.call(imm_ptr(target->DirectNativeCall), CreateFuncSignature(target)); + call->setInlineComment(target->PrintableName.GetChars()); asmjit::CBNode *cursorAfter = cc.getCursor(); cc.setCursor(cursorBefore); diff --git a/src/scripting/vm/jitintern.h b/src/scripting/vm/jitintern.h index 7c6a3386b..a88eb61eb 100644 --- a/src/scripting/vm/jitintern.h +++ b/src/scripting/vm/jitintern.h @@ -51,7 +51,7 @@ private: void EmitPopFrame(); void EmitNativeCall(VMNativeFunction *target); - void EmitVMCall(asmjit::X86Gp ptr); + void EmitVMCall(asmjit::X86Gp ptr, VMFunction *target); void EmitVtbl(const VMOP *op); int StoreCallParams();