From 2e27b025cc1a75a4a0ed5a0d911a65c422ecfe23 Mon Sep 17 00:00:00 2001 From: Eyck-Alexander Jentzsch Date: Thu, 9 May 2024 13:47:36 +0200 Subject: [PATCH] improves dump-ir comments --- gen_input/templates/asmjit/CORENAME.cpp.gtl | 12 ++++-------- src/vm/asmjit/vm_tgc5c.cpp | 10 +++------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/gen_input/templates/asmjit/CORENAME.cpp.gtl b/gen_input/templates/asmjit/CORENAME.cpp.gtl index 981950c..47167ed 100644 --- a/gen_input/templates/asmjit/CORENAME.cpp.gtl +++ b/gen_input/templates/asmjit/CORENAME.cpp.gtl @@ -266,10 +266,9 @@ template void vm_impl::gen_instr_prologue(jit_holder& jh) { auto& cc = jh.cc; - cc.comment("//(*icount)++;"); + cc.comment("//gen_instr_prologue"); cc.inc(get_ptr_for(jh, traits::ICOUNT)); - cc.comment("//*trap_state=*pending_trap;"); x86::Gp current_trap_state = get_reg_for(jh, traits::TRAP_STATE); cc.mov(current_trap_state, get_ptr_for(jh, traits::TRAP_STATE)); cc.mov(get_ptr_for(jh, traits::PENDING_TRAP), current_trap_state); @@ -279,7 +278,7 @@ template void vm_impl::gen_instr_epilogue(jit_holder& jh) { auto& cc = jh.cc; - cc.comment("//if(*trap_state!=0) goto trap_entry;"); + cc.comment("//gen_instr_epilogue"); x86::Gp current_trap_state = get_reg_for(jh, traits::TRAP_STATE); cc.mov(current_trap_state, get_ptr_for(jh, traits::TRAP_STATE)); cc.cmp(current_trap_state, 0); @@ -294,11 +293,10 @@ void vm_impl::gen_block_prologue(jit_holder& jh){ template void vm_impl::gen_block_epilogue(jit_holder& jh){ x86::Compiler& cc = jh.cc; - cc.comment("//return *next_pc;"); + cc.comment("//gen_block_epilogue"); cc.ret(jh.next_pc); cc.bind(jh.trap_entry); - cc.comment("//Prepare for enter_trap;"); this->write_back(jh); this->gen_sync(jh, POST_SYNC, -1); @@ -309,7 +307,7 @@ void vm_impl::gen_block_epilogue(jit_holder& jh){ cc.mov(current_pc, get_ptr_for(jh, traits::PC)); x86::Gp instr = cc.newInt32("instr"); - cc.mov(instr, 0); // this is not correct + cc.mov(instr, 0); // FIXME:this is not correct cc.comment("//enter trap call;"); InvokeNode* call_enter_trap; cc.invoke(&call_enter_trap, &enter_trap, FuncSignatureT()); @@ -322,9 +320,7 @@ void vm_impl::gen_block_epilogue(jit_holder& jh){ cc.mov(current_next_pc, get_ptr_for(jh, traits::NEXT_PC)); cc.mov(jh.next_pc, current_next_pc); - cc.comment("//*last_branch = std::numeric_limits::max();"); cc.mov(get_ptr_for(jh, traits::LAST_BRANCH), std::numeric_limits::max()); - cc.comment("//return *next_pc;"); cc.ret(jh.next_pc); } template diff --git a/src/vm/asmjit/vm_tgc5c.cpp b/src/vm/asmjit/vm_tgc5c.cpp index 5073c53..5b35db0 100644 --- a/src/vm/asmjit/vm_tgc5c.cpp +++ b/src/vm/asmjit/vm_tgc5c.cpp @@ -4699,10 +4699,9 @@ template void vm_impl::gen_instr_prologue(jit_holder& jh) { auto& cc = jh.cc; - cc.comment("//(*icount)++;"); + cc.comment("//gen_instr_prologue"); cc.inc(get_ptr_for(jh, traits::ICOUNT)); - cc.comment("//*trap_state=*pending_trap;"); x86::Gp current_trap_state = get_reg_for(jh, traits::TRAP_STATE); cc.mov(current_trap_state, get_ptr_for(jh, traits::TRAP_STATE)); cc.mov(get_ptr_for(jh, traits::PENDING_TRAP), current_trap_state); @@ -4712,7 +4711,7 @@ template void vm_impl::gen_instr_epilogue(jit_holder& jh) { auto& cc = jh.cc; - cc.comment("//if(*trap_state!=0) goto trap_entry;"); + cc.comment("//gen_instr_epilogue"); x86::Gp current_trap_state = get_reg_for(jh, traits::TRAP_STATE); cc.mov(current_trap_state, get_ptr_for(jh, traits::TRAP_STATE)); cc.cmp(current_trap_state, 0); @@ -4727,11 +4726,10 @@ void vm_impl::gen_block_prologue(jit_holder& jh){ template void vm_impl::gen_block_epilogue(jit_holder& jh){ x86::Compiler& cc = jh.cc; - cc.comment("//return *next_pc;"); + cc.comment("//gen_block_epilogue"); cc.ret(jh.next_pc); cc.bind(jh.trap_entry); - cc.comment("//Prepare for enter_trap;"); this->write_back(jh); this->gen_sync(jh, POST_SYNC, -1); @@ -4755,9 +4753,7 @@ void vm_impl::gen_block_epilogue(jit_holder& jh){ cc.mov(current_next_pc, get_ptr_for(jh, traits::NEXT_PC)); cc.mov(jh.next_pc, current_next_pc); - cc.comment("//*last_branch = std::numeric_limits::max();"); cc.mov(get_ptr_for(jh, traits::LAST_BRANCH), std::numeric_limits::max()); - cc.comment("//return *next_pc;"); cc.ret(jh.next_pc); } template