From c6f60dbd6c56dd2b082ef84aa8dce59dd287b010 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 5 Oct 2006 01:03:54 +0000 Subject: [PATCH] added op.call --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40105 --- sourcepawn/vm/jit/x86/jit_x86.cpp | 8 ++++++++ sourcepawn/vm/jit/x86/opcode_helpers.h | 2 +- sourcepawn/vm/jit/x86/opcode_switch.inc | 5 +++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/sourcepawn/vm/jit/x86/jit_x86.cpp b/sourcepawn/vm/jit/x86/jit_x86.cpp index b4b39f59..e4b77213 100644 --- a/sourcepawn/vm/jit/x86/jit_x86.cpp +++ b/sourcepawn/vm/jit/x86/jit_x86.cpp @@ -1068,6 +1068,14 @@ inline void WriteOp_Retn(JitWriter *jit) IA32_Jump_Reg(jit, AMX_REG_TMP); } +inline void WriteOp_Call(JitWriter *jit) +{ + cell_t offs = jit->read_cell(); + + jitoffs_t jmp = IA32_Call_Imm32(jit, 0); + IA32_Write_Jump32(jit, jmp, RelocLookup(jit, offs, false)); +} + inline void WriteOp_Bounds(JitWriter *jit) { Write_BoundsCheck(jit); diff --git a/sourcepawn/vm/jit/x86/opcode_helpers.h b/sourcepawn/vm/jit/x86/opcode_helpers.h index 7df128bc..c0b502e8 100644 --- a/sourcepawn/vm/jit/x86/opcode_helpers.h +++ b/sourcepawn/vm/jit/x86/opcode_helpers.h @@ -107,7 +107,7 @@ typedef enum OP_PROC, //DONE OP_RET, // !GEN OP_RETN, //DONE - OP_CALL, + OP_CALL, //DONE OP_CALL_PRI, // !GEN OP_JUMP, //DONE OP_JREL, // !GEN diff --git a/sourcepawn/vm/jit/x86/opcode_switch.inc b/sourcepawn/vm/jit/x86/opcode_switch.inc index e3551f5c..f4b49b5a 100644 --- a/sourcepawn/vm/jit/x86/opcode_switch.inc +++ b/sourcepawn/vm/jit/x86/opcode_switch.inc @@ -628,6 +628,11 @@ WriteOp_Casetbl(jit); break; } + case OP_CALL: + { + WriteOp_Call(jit); + break; + } #if defined USE_UNGEN_OPCODES #include "ungen_opcode_switch.inc" #endif