improves dump-ir comments

This commit is contained in:
Eyck-Alexander Jentzsch 2024-05-09 13:47:36 +02:00
parent f0a004be9d
commit 2e27b025cc
2 changed files with 7 additions and 15 deletions

View File

@ -266,10 +266,9 @@ template <typename ARCH>
void vm_impl<ARCH>::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 <typename ARCH>
void vm_impl<ARCH>::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<ARCH>::gen_block_prologue(jit_holder& jh){
template <typename ARCH>
void vm_impl<ARCH>::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<ARCH>::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<uint64_t, void*, uint64_t, uint64_t, uint64_t>());
@ -322,9 +320,7 @@ void vm_impl<ARCH>::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<uint32_t>::max();");
cc.mov(get_ptr_for(jh, traits::LAST_BRANCH), std::numeric_limits<uint32_t>::max());
cc.comment("//return *next_pc;");
cc.ret(jh.next_pc);
}
template <typename ARCH>

View File

@ -4699,10 +4699,9 @@ template <typename ARCH>
void vm_impl<ARCH>::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 <typename ARCH>
void vm_impl<ARCH>::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<ARCH>::gen_block_prologue(jit_holder& jh){
template <typename ARCH>
void vm_impl<ARCH>::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<ARCH>::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<uint32_t>::max();");
cc.mov(get_ptr_for(jh, traits::LAST_BRANCH), std::numeric_limits<uint32_t>::max());
cc.comment("//return *next_pc;");
cc.ret(jh.next_pc);
}
template <typename ARCH>