Browse Source

fix interpreter's struct handling;

fix segmentation fault in interpreter's fixup code;
cache-refactoring
Aleksey Demakov 18 years ago
parent
commit
48f421e169
  1. 15
      ChangeLog
  2. 123
      jit/jit-interp.c
  3. 191
      jit/jit-interp.h
  4. 9
      jit/jit-opcode.c
  5. 243
      jit/jit-rules-interp.c

15
ChangeLog

@ -1,3 +1,16 @@
2006-10-16 Aleksey Demakov <ademakov@gmail.com>
* jit/jit-interp.h, jit/jit-interp.c (_jit_run_function):
* jit/jit-opcode.c, jit/jit-rules-interp.c (_jit_gen_insn): Repair
struct handling broken since the last interpreter reorganization,
remove unused interpreter opcodes.
* jit/jit-rules-interp.c (_jit_gen_start_block): check if the fixup
position is before the cache end. This prevents segmentation fault
when the end of cache block is reached and jit_function_compile()
attempts to generate more code (it checks for the cache end way too
late).
2006-10-14 Aleksey Demakov <ademakov@gmail.com>
* jit/jit-rules-interp.c (_jit_create_call_return_insns): fix return
@ -41,7 +54,7 @@
* configure.in: remove --enable-new-reg-alloc option.
* jit/jit-rules-x86.ins: simplify JIT_OP_RETURN_LONG rule, lift code
* jit/jit-rules-x86.ins: simplify JIT_OP_RETURN_LONG rule, lift code
from load_small_struct() function to JIT_OP_RETURN_SMALL_STRUCT rule.
* jit/jit-rules-x86.c: remove load_small_struct() function.

123
jit/jit-interp.c

@ -3592,12 +3592,21 @@ restart_tail:
{
/* Push a structure value onto the stack, given a pointer to it */
temparg = VM_NINT_ARG;
stacktop -= (JIT_NUM_ITEMS_IN_STRUCT(temparg) - 1);
stacktop -= JIT_NUM_ITEMS_IN_STRUCT(temparg);
jit_memcpy(stacktop, VM_R1_PTR, (unsigned int)temparg);
VM_MODIFY_PC(2);
}
VMBREAK;
VMCASE(JIT_OP_FLUSH_SMALL_STRUCT):
{
#if JIT_APPLY_MAX_STRUCT_IN_REG != 0
jit_memcpy(VM_R0_PTR, return_area->struct_value, VM_NINT_ARG);
#endif
VM_MODIFY_PC(2);
}
VMBREAK;
/******************************************************************
* Exception handling.
******************************************************************/
@ -3697,6 +3706,18 @@ restart_tail:
}
VMBREAK;
/******************************************************************
* Data manipulation.
******************************************************************/
VMCASE(JIT_OP_COPY_STRUCT):
{
/* Copy a structure from one address to another */
jit_memcpy(VM_R0_PTR, VM_R1_PTR, VM_NINT_ARG);
VM_MODIFY_PC(2);
}
VMBREAK;
/******************************************************************
* Pointer-relative loads and stores.
******************************************************************/
@ -3776,7 +3797,7 @@ restart_tail:
VMCASE(JIT_OP_LOAD_RELATIVE_STRUCT):
{
/* Load a structure from a relative pointer */
jit_memcpy(&r0, VM_REL(void, VM_R1_PTR), VM_NINT_ARG2);
jit_memcpy(VM_R0_PTR, VM_REL(void, VM_R1_PTR), VM_NINT_ARG2);
VM_MODIFY_PC(3);
}
VMBREAK;
@ -3840,7 +3861,7 @@ restart_tail:
VMCASE(JIT_OP_STORE_RELATIVE_STRUCT):
{
/* Store a structure value to a relative pointer */
jit_memcpy(VM_REL(void, VM_R0_PTR), &r1, VM_NINT_ARG2);
jit_memcpy(VM_REL(void, VM_R0_PTR), VM_R1_PTR, VM_NINT_ARG2);
VM_MODIFY_PC(3);
}
VMBREAK;
@ -4114,15 +4135,6 @@ restart_tail:
}
VMBREAK;
VMCASE(JIT_OP_LDA_0_STRUCT):
{
/* Load a structure argument into the register 0 */
temparg = VM_NINT_ARG2;
jit_memcpy(&r0, VM_ARG(void), temparg);
VM_MODIFY_PC(3);
}
VMBREAK;
VMCASE(JIT_OP_LDAA_0):
{
/* Load the address of an argument into the register 0 */
@ -4203,15 +4215,6 @@ restart_tail:
}
VMBREAK;
VMCASE(JIT_OP_LDA_1_STRUCT):
{
/* Load a structure argument into the register 1 */
temparg = VM_NINT_ARG2;
jit_memcpy(&r1, VM_ARG(void), temparg);
VM_MODIFY_PC(3);
}
VMBREAK;
VMCASE(JIT_OP_LDAA_1):
{
/* Load the address of an argument into the register 1 */
@ -4292,15 +4295,6 @@ restart_tail:
}
VMBREAK;
VMCASE(JIT_OP_LDA_2_STRUCT):
{
/* Load a structure argument into the register 2 */
temparg = VM_NINT_ARG2;
jit_memcpy(&r2, VM_ARG(void), temparg);
VM_MODIFY_PC(3);
}
VMBREAK;
VMCASE(JIT_OP_LDAA_2):
{
/* Load the address of an argument into the register 2 */
@ -4365,15 +4359,6 @@ restart_tail:
}
VMBREAK;
VMCASE(JIT_OP_STA_0_STRUCT):
{
/* Store a structure value into an argument */
temparg = VM_NINT_ARG2;
jit_memcpy(VM_ARG(void), &r0, temparg);
VM_MODIFY_PC(3);
}
VMBREAK;
/******************************************************************
* Local variable frame access opcodes.
******************************************************************/
@ -4450,18 +4435,9 @@ restart_tail:
}
VMBREAK;
VMCASE(JIT_OP_LDL_0_STRUCT):
{
/* Load a structure local onto the register 0 */
temparg = VM_NINT_ARG2;
jit_memcpy(&r0, VM_LOC(void), temparg);
VM_MODIFY_PC(3);
}
VMBREAK;
VMCASE(JIT_OP_LDLA_0):
{
/* Load the address of an local into the register 0 */
/* Load the address of a local into the register 0 */
VM_R0_PTR = VM_LOC(void);
VM_MODIFY_PC(2);
}
@ -4539,19 +4515,10 @@ restart_tail:
}
VMBREAK;
VMCASE(JIT_OP_LDL_1_STRUCT):
{
/* Load a structure local onto the register 1 */
temparg = VM_NINT_ARG2;
jit_memcpy(&r1, VM_LOC(void), temparg);
VM_MODIFY_PC(3);
}
VMBREAK;
VMCASE(JIT_OP_LDLA_1):
{
/* Load a native float local into the register 1 */
VM_R1_NFLOAT = *VM_LOC(jit_nfloat);
/* Load the address of a local into the register 1 */
VM_R1_PTR = VM_LOC(void);
VM_MODIFY_PC(2);
}
VMBREAK;
@ -4628,19 +4595,10 @@ restart_tail:
}
VMBREAK;
VMCASE(JIT_OP_LDL_2_STRUCT):
{
/* Load a structure local onto the register 2 */
temparg = VM_NINT_ARG2;
jit_memcpy(&r2, VM_LOC(void), temparg);
VM_MODIFY_PC(3);
}
VMBREAK;
VMCASE(JIT_OP_LDLA_2):
{
/* Load a native float local into the register 2 */
VM_R2_NFLOAT = *VM_LOC(jit_nfloat);
/* Load the address of a local into the register 2 */
VM_R2_PTR = VM_LOC(void);
VM_MODIFY_PC(2);
}
VMBREAK;
@ -4701,15 +4659,6 @@ restart_tail:
}
VMBREAK;
VMCASE(JIT_OP_STL_0_STRUCT):
{
/* Store a structure value into a local */
temparg = VM_NINT_ARG2;
jit_memcpy(VM_LOC(void), &r0, temparg);
VM_MODIFY_PC(3);
}
VMBREAK;
/******************************************************************
* Load constant values.
******************************************************************/
@ -4896,18 +4845,6 @@ restart_tail:
}
VMBREAK;
VMCASE(JIT_OP_LDR_0_SMALL_STRUCT):
{
/* Load a small structure return value into the register 0 */
temparg = VM_NINT_ARG;
stacktop -= JIT_NUM_ITEMS_IN_STRUCT(temparg);
#if JIT_APPLY_MAX_STRUCT_IN_REG != 0
jit_memcpy(&r0, return_area->struct_value, temparg);
#endif
VM_MODIFY_PC(2);
}
VMBREAK;
/******************************************************************
* Stack management.
******************************************************************/
@ -4981,7 +4918,6 @@ restart_tail:
VMCASE(JIT_OP_COPY_FLOAT32):
VMCASE(JIT_OP_COPY_FLOAT64):
VMCASE(JIT_OP_COPY_NFLOAT):
VMCASE(JIT_OP_COPY_STRUCT):
VMCASE(JIT_OP_COPY_STORE_BYTE):
VMCASE(JIT_OP_COPY_STORE_SHORT):
VMCASE(JIT_OP_ADDRESS_OF):
@ -4990,7 +4926,6 @@ restart_tail:
VMCASE(JIT_OP_OUTGOING_REG):
VMCASE(JIT_OP_OUTGOING_FRAME_POSN):
VMCASE(JIT_OP_RETURN_REG):
VMCASE(JIT_OP_FLUSH_SMALL_STRUCT):
VMCASE(JIT_OP_SET_PARAM_INT):
VMCASE(JIT_OP_SET_PARAM_LONG):
VMCASE(JIT_OP_SET_PARAM_FLOAT32):

191
jit/jit-interp.h

@ -99,130 +99,121 @@ struct jit_function_interp
#define JIT_OP_LDA_0_FLOAT32 (JIT_OP_NUM_OPCODES + 0x0006)
#define JIT_OP_LDA_0_FLOAT64 (JIT_OP_NUM_OPCODES + 0x0007)
#define JIT_OP_LDA_0_NFLOAT (JIT_OP_NUM_OPCODES + 0x0008)
#define JIT_OP_LDA_0_STRUCT (JIT_OP_NUM_OPCODES + 0x0009)
#define JIT_OP_LDAA_0 (JIT_OP_NUM_OPCODES + 0x000a)
#define JIT_OP_LDA_1_SBYTE (JIT_OP_NUM_OPCODES + 0x000b)
#define JIT_OP_LDA_1_UBYTE (JIT_OP_NUM_OPCODES + 0x000c)
#define JIT_OP_LDA_1_SHORT (JIT_OP_NUM_OPCODES + 0x000d)
#define JIT_OP_LDA_1_USHORT (JIT_OP_NUM_OPCODES + 0x000e)
#define JIT_OP_LDA_1_INT (JIT_OP_NUM_OPCODES + 0x000f)
#define JIT_OP_LDA_1_LONG (JIT_OP_NUM_OPCODES + 0x0010)
#define JIT_OP_LDA_1_FLOAT32 (JIT_OP_NUM_OPCODES + 0x0011)
#define JIT_OP_LDA_1_FLOAT64 (JIT_OP_NUM_OPCODES + 0x0012)
#define JIT_OP_LDA_1_NFLOAT (JIT_OP_NUM_OPCODES + 0x0013)
#define JIT_OP_LDA_1_STRUCT (JIT_OP_NUM_OPCODES + 0x0014)
#define JIT_OP_LDAA_1 (JIT_OP_NUM_OPCODES + 0x0015)
#define JIT_OP_LDA_2_SBYTE (JIT_OP_NUM_OPCODES + 0x0016)
#define JIT_OP_LDA_2_UBYTE (JIT_OP_NUM_OPCODES + 0x0017)
#define JIT_OP_LDA_2_SHORT (JIT_OP_NUM_OPCODES + 0x0018)
#define JIT_OP_LDA_2_USHORT (JIT_OP_NUM_OPCODES + 0x0019)
#define JIT_OP_LDA_2_INT (JIT_OP_NUM_OPCODES + 0x001a)
#define JIT_OP_LDA_2_LONG (JIT_OP_NUM_OPCODES + 0x001b)
#define JIT_OP_LDA_2_FLOAT32 (JIT_OP_NUM_OPCODES + 0x001c)
#define JIT_OP_LDA_2_FLOAT64 (JIT_OP_NUM_OPCODES + 0x001d)
#define JIT_OP_LDA_2_NFLOAT (JIT_OP_NUM_OPCODES + 0x001e)
#define JIT_OP_LDA_2_STRUCT (JIT_OP_NUM_OPCODES + 0x001f)
#define JIT_OP_LDAA_2 (JIT_OP_NUM_OPCODES + 0x0020)
#define JIT_OP_STA_0_BYTE (JIT_OP_NUM_OPCODES + 0x0021)
#define JIT_OP_STA_0_SHORT (JIT_OP_NUM_OPCODES + 0x0022)
#define JIT_OP_STA_0_INT (JIT_OP_NUM_OPCODES + 0x0023)
#define JIT_OP_STA_0_LONG (JIT_OP_NUM_OPCODES + 0x0024)
#define JIT_OP_STA_0_FLOAT32 (JIT_OP_NUM_OPCODES + 0x0025)
#define JIT_OP_STA_0_FLOAT64 (JIT_OP_NUM_OPCODES + 0x0026)
#define JIT_OP_STA_0_NFLOAT (JIT_OP_NUM_OPCODES + 0x0027)
#define JIT_OP_STA_0_STRUCT (JIT_OP_NUM_OPCODES + 0x0028)
#define JIT_OP_LDAA_0 (JIT_OP_NUM_OPCODES + 0x0009)
#define JIT_OP_LDA_1_SBYTE (JIT_OP_NUM_OPCODES + 0x000a)
#define JIT_OP_LDA_1_UBYTE (JIT_OP_NUM_OPCODES + 0x000b)
#define JIT_OP_LDA_1_SHORT (JIT_OP_NUM_OPCODES + 0x000c)
#define JIT_OP_LDA_1_USHORT (JIT_OP_NUM_OPCODES + 0x000d)
#define JIT_OP_LDA_1_INT (JIT_OP_NUM_OPCODES + 0x000e)
#define JIT_OP_LDA_1_LONG (JIT_OP_NUM_OPCODES + 0x000f)
#define JIT_OP_LDA_1_FLOAT32 (JIT_OP_NUM_OPCODES + 0x0010)
#define JIT_OP_LDA_1_FLOAT64 (JIT_OP_NUM_OPCODES + 0x0011)
#define JIT_OP_LDA_1_NFLOAT (JIT_OP_NUM_OPCODES + 0x0012)
#define JIT_OP_LDAA_1 (JIT_OP_NUM_OPCODES + 0x0013)
#define JIT_OP_LDA_2_SBYTE (JIT_OP_NUM_OPCODES + 0x0014)
#define JIT_OP_LDA_2_UBYTE (JIT_OP_NUM_OPCODES + 0x0015)
#define JIT_OP_LDA_2_SHORT (JIT_OP_NUM_OPCODES + 0x0016)
#define JIT_OP_LDA_2_USHORT (JIT_OP_NUM_OPCODES + 0x0017)
#define JIT_OP_LDA_2_INT (JIT_OP_NUM_OPCODES + 0x0018)
#define JIT_OP_LDA_2_LONG (JIT_OP_NUM_OPCODES + 0x0019)
#define JIT_OP_LDA_2_FLOAT32 (JIT_OP_NUM_OPCODES + 0x001a)
#define JIT_OP_LDA_2_FLOAT64 (JIT_OP_NUM_OPCODES + 0x001b)
#define JIT_OP_LDA_2_NFLOAT (JIT_OP_NUM_OPCODES + 0x001c)
#define JIT_OP_LDAA_2 (JIT_OP_NUM_OPCODES + 0x001d)
#define JIT_OP_STA_0_BYTE (JIT_OP_NUM_OPCODES + 0x001e)
#define JIT_OP_STA_0_SHORT (JIT_OP_NUM_OPCODES + 0x001f)
#define JIT_OP_STA_0_INT (JIT_OP_NUM_OPCODES + 0x0020)
#define JIT_OP_STA_0_LONG (JIT_OP_NUM_OPCODES + 0x0021)
#define JIT_OP_STA_0_FLOAT32 (JIT_OP_NUM_OPCODES + 0x0022)
#define JIT_OP_STA_0_FLOAT64 (JIT_OP_NUM_OPCODES + 0x0023)
#define JIT_OP_STA_0_NFLOAT (JIT_OP_NUM_OPCODES + 0x0024)
/*
* Local variable frame access opcodes.
*/
#define JIT_OP_LDL_0_SBYTE (JIT_OP_NUM_OPCODES + 0x0029)
#define JIT_OP_LDL_0_UBYTE (JIT_OP_NUM_OPCODES + 0x002a)
#define JIT_OP_LDL_0_SHORT (JIT_OP_NUM_OPCODES + 0x002b)
#define JIT_OP_LDL_0_USHORT (JIT_OP_NUM_OPCODES + 0x002c)
#define JIT_OP_LDL_0_INT (JIT_OP_NUM_OPCODES + 0x002d)
#define JIT_OP_LDL_0_LONG (JIT_OP_NUM_OPCODES + 0x002e)
#define JIT_OP_LDL_0_FLOAT32 (JIT_OP_NUM_OPCODES + 0x002f)
#define JIT_OP_LDL_0_FLOAT64 (JIT_OP_NUM_OPCODES + 0x0030)
#define JIT_OP_LDL_0_NFLOAT (JIT_OP_NUM_OPCODES + 0x0031)
#define JIT_OP_LDL_0_STRUCT (JIT_OP_NUM_OPCODES + 0x0032)
#define JIT_OP_LDLA_0 (JIT_OP_NUM_OPCODES + 0x0033)
#define JIT_OP_LDL_1_SBYTE (JIT_OP_NUM_OPCODES + 0x0034)
#define JIT_OP_LDL_1_UBYTE (JIT_OP_NUM_OPCODES + 0x0035)
#define JIT_OP_LDL_1_SHORT (JIT_OP_NUM_OPCODES + 0x0036)
#define JIT_OP_LDL_1_USHORT (JIT_OP_NUM_OPCODES + 0x0037)
#define JIT_OP_LDL_1_INT (JIT_OP_NUM_OPCODES + 0x0038)
#define JIT_OP_LDL_1_LONG (JIT_OP_NUM_OPCODES + 0x0039)
#define JIT_OP_LDL_1_FLOAT32 (JIT_OP_NUM_OPCODES + 0x003a)
#define JIT_OP_LDL_1_FLOAT64 (JIT_OP_NUM_OPCODES + 0x003b)
#define JIT_OP_LDL_1_NFLOAT (JIT_OP_NUM_OPCODES + 0x003c)
#define JIT_OP_LDL_1_STRUCT (JIT_OP_NUM_OPCODES + 0x003d)
#define JIT_OP_LDLA_1 (JIT_OP_NUM_OPCODES + 0x003e)
#define JIT_OP_LDL_2_SBYTE (JIT_OP_NUM_OPCODES + 0x003f)
#define JIT_OP_LDL_2_UBYTE (JIT_OP_NUM_OPCODES + 0x0040)
#define JIT_OP_LDL_2_SHORT (JIT_OP_NUM_OPCODES + 0x0041)
#define JIT_OP_LDL_2_USHORT (JIT_OP_NUM_OPCODES + 0x0042)
#define JIT_OP_LDL_2_INT (JIT_OP_NUM_OPCODES + 0x0043)
#define JIT_OP_LDL_2_LONG (JIT_OP_NUM_OPCODES + 0x0044)
#define JIT_OP_LDL_2_FLOAT32 (JIT_OP_NUM_OPCODES + 0x0045)
#define JIT_OP_LDL_2_FLOAT64 (JIT_OP_NUM_OPCODES + 0x0046)
#define JIT_OP_LDL_2_NFLOAT (JIT_OP_NUM_OPCODES + 0x0047)
#define JIT_OP_LDL_2_STRUCT (JIT_OP_NUM_OPCODES + 0x0048)
#define JIT_OP_LDLA_2 (JIT_OP_NUM_OPCODES + 0x0049)
#define JIT_OP_STL_0_BYTE (JIT_OP_NUM_OPCODES + 0x004a)
#define JIT_OP_STL_0_SHORT (JIT_OP_NUM_OPCODES + 0x004b)
#define JIT_OP_STL_0_INT (JIT_OP_NUM_OPCODES + 0x004c)
#define JIT_OP_STL_0_LONG (JIT_OP_NUM_OPCODES + 0x004d)
#define JIT_OP_STL_0_FLOAT32 (JIT_OP_NUM_OPCODES + 0x004e)
#define JIT_OP_STL_0_FLOAT64 (JIT_OP_NUM_OPCODES + 0x004f)
#define JIT_OP_STL_0_NFLOAT (JIT_OP_NUM_OPCODES + 0x0050)
#define JIT_OP_STL_0_STRUCT (JIT_OP_NUM_OPCODES + 0x0051)
#define JIT_OP_LDL_0_SBYTE (JIT_OP_NUM_OPCODES + 0x0025)
#define JIT_OP_LDL_0_UBYTE (JIT_OP_NUM_OPCODES + 0x0026)
#define JIT_OP_LDL_0_SHORT (JIT_OP_NUM_OPCODES + 0x0027)
#define JIT_OP_LDL_0_USHORT (JIT_OP_NUM_OPCODES + 0x0028)
#define JIT_OP_LDL_0_INT (JIT_OP_NUM_OPCODES + 0x0029)
#define JIT_OP_LDL_0_LONG (JIT_OP_NUM_OPCODES + 0x002a)
#define JIT_OP_LDL_0_FLOAT32 (JIT_OP_NUM_OPCODES + 0x002b)
#define JIT_OP_LDL_0_FLOAT64 (JIT_OP_NUM_OPCODES + 0x002c)
#define JIT_OP_LDL_0_NFLOAT (JIT_OP_NUM_OPCODES + 0x002d)
#define JIT_OP_LDLA_0 (JIT_OP_NUM_OPCODES + 0x002e)
#define JIT_OP_LDL_1_SBYTE (JIT_OP_NUM_OPCODES + 0x002f)
#define JIT_OP_LDL_1_UBYTE (JIT_OP_NUM_OPCODES + 0x0030)
#define JIT_OP_LDL_1_SHORT (JIT_OP_NUM_OPCODES + 0x0031)
#define JIT_OP_LDL_1_USHORT (JIT_OP_NUM_OPCODES + 0x0032)
#define JIT_OP_LDL_1_INT (JIT_OP_NUM_OPCODES + 0x0033)
#define JIT_OP_LDL_1_LONG (JIT_OP_NUM_OPCODES + 0x0034)
#define JIT_OP_LDL_1_FLOAT32 (JIT_OP_NUM_OPCODES + 0x0035)
#define JIT_OP_LDL_1_FLOAT64 (JIT_OP_NUM_OPCODES + 0x0036)
#define JIT_OP_LDL_1_NFLOAT (JIT_OP_NUM_OPCODES + 0x0037)
#define JIT_OP_LDLA_1 (JIT_OP_NUM_OPCODES + 0x0038)
#define JIT_OP_LDL_2_SBYTE (JIT_OP_NUM_OPCODES + 0x0039)
#define JIT_OP_LDL_2_UBYTE (JIT_OP_NUM_OPCODES + 0x003a)
#define JIT_OP_LDL_2_SHORT (JIT_OP_NUM_OPCODES + 0x003b)
#define JIT_OP_LDL_2_USHORT (JIT_OP_NUM_OPCODES + 0x003c)
#define JIT_OP_LDL_2_INT (JIT_OP_NUM_OPCODES + 0x003d)
#define JIT_OP_LDL_2_LONG (JIT_OP_NUM_OPCODES + 0x003e)
#define JIT_OP_LDL_2_FLOAT32 (JIT_OP_NUM_OPCODES + 0x003f)
#define JIT_OP_LDL_2_FLOAT64 (JIT_OP_NUM_OPCODES + 0x0040)
#define JIT_OP_LDL_2_NFLOAT (JIT_OP_NUM_OPCODES + 0x0041)
#define JIT_OP_LDLA_2 (JIT_OP_NUM_OPCODES + 0x0042)
#define JIT_OP_STL_0_BYTE (JIT_OP_NUM_OPCODES + 0x0043)
#define JIT_OP_STL_0_SHORT (JIT_OP_NUM_OPCODES + 0x0044)
#define JIT_OP_STL_0_INT (JIT_OP_NUM_OPCODES + 0x0045)
#define JIT_OP_STL_0_LONG (JIT_OP_NUM_OPCODES + 0x0046)
#define JIT_OP_STL_0_FLOAT32 (JIT_OP_NUM_OPCODES + 0x0047)
#define JIT_OP_STL_0_FLOAT64 (JIT_OP_NUM_OPCODES + 0x0048)
#define JIT_OP_STL_0_NFLOAT (JIT_OP_NUM_OPCODES + 0x0049)
/*
* Load constant values.
*/
#define JIT_OP_LDC_0_INT (JIT_OP_NUM_OPCODES + 0x0052)
#define JIT_OP_LDC_1_INT (JIT_OP_NUM_OPCODES + 0x0053)
#define JIT_OP_LDC_2_INT (JIT_OP_NUM_OPCODES + 0x0054)
#define JIT_OP_LDC_0_LONG (JIT_OP_NUM_OPCODES + 0x0055)
#define JIT_OP_LDC_1_LONG (JIT_OP_NUM_OPCODES + 0x0056)
#define JIT_OP_LDC_2_LONG (JIT_OP_NUM_OPCODES + 0x0057)
#define JIT_OP_LDC_0_FLOAT32 (JIT_OP_NUM_OPCODES + 0x0058)
#define JIT_OP_LDC_1_FLOAT32 (JIT_OP_NUM_OPCODES + 0x0059)
#define JIT_OP_LDC_2_FLOAT32 (JIT_OP_NUM_OPCODES + 0x005a)
#define JIT_OP_LDC_0_FLOAT64 (JIT_OP_NUM_OPCODES + 0x005b)
#define JIT_OP_LDC_1_FLOAT64 (JIT_OP_NUM_OPCODES + 0x005c)
#define JIT_OP_LDC_2_FLOAT64 (JIT_OP_NUM_OPCODES + 0x005d)
#define JIT_OP_LDC_0_NFLOAT (JIT_OP_NUM_OPCODES + 0x005e)
#define JIT_OP_LDC_1_NFLOAT (JIT_OP_NUM_OPCODES + 0x005f)
#define JIT_OP_LDC_2_NFLOAT (JIT_OP_NUM_OPCODES + 0x0060)
#define JIT_OP_LDC_0_INT (JIT_OP_NUM_OPCODES + 0x004a)
#define JIT_OP_LDC_1_INT (JIT_OP_NUM_OPCODES + 0x004b)
#define JIT_OP_LDC_2_INT (JIT_OP_NUM_OPCODES + 0x004c)
#define JIT_OP_LDC_0_LONG (JIT_OP_NUM_OPCODES + 0x004d)
#define JIT_OP_LDC_1_LONG (JIT_OP_NUM_OPCODES + 0x004e)
#define JIT_OP_LDC_2_LONG (JIT_OP_NUM_OPCODES + 0x004f)
#define JIT_OP_LDC_0_FLOAT32 (JIT_OP_NUM_OPCODES + 0x0050)
#define JIT_OP_LDC_1_FLOAT32 (JIT_OP_NUM_OPCODES + 0x0051)
#define JIT_OP_LDC_2_FLOAT32 (JIT_OP_NUM_OPCODES + 0x0052)
#define JIT_OP_LDC_0_FLOAT64 (JIT_OP_NUM_OPCODES + 0x0053)
#define JIT_OP_LDC_1_FLOAT64 (JIT_OP_NUM_OPCODES + 0x0054)
#define JIT_OP_LDC_2_FLOAT64 (JIT_OP_NUM_OPCODES + 0x0055)
#define JIT_OP_LDC_0_NFLOAT (JIT_OP_NUM_OPCODES + 0x0056)
#define JIT_OP_LDC_1_NFLOAT (JIT_OP_NUM_OPCODES + 0x0057)
#define JIT_OP_LDC_2_NFLOAT (JIT_OP_NUM_OPCODES + 0x0058)
/*
* Load return value.
*/
#define JIT_OP_LDR_0_INT (JIT_OP_NUM_OPCODES + 0x0061)
#define JIT_OP_LDR_0_LONG (JIT_OP_NUM_OPCODES + 0x0062)
#define JIT_OP_LDR_0_FLOAT32 (JIT_OP_NUM_OPCODES + 0x0063)
#define JIT_OP_LDR_0_FLOAT64 (JIT_OP_NUM_OPCODES + 0x0064)
#define JIT_OP_LDR_0_NFLOAT (JIT_OP_NUM_OPCODES + 0x0065)
#define JIT_OP_LDR_0_SMALL_STRUCT (JIT_OP_NUM_OPCODES + 0x0066)
#define JIT_OP_LDR_0_INT (JIT_OP_NUM_OPCODES + 0x0059)
#define JIT_OP_LDR_0_LONG (JIT_OP_NUM_OPCODES + 0x005a)
#define JIT_OP_LDR_0_FLOAT32 (JIT_OP_NUM_OPCODES + 0x005b)
#define JIT_OP_LDR_0_FLOAT64 (JIT_OP_NUM_OPCODES + 0x005c)
#define JIT_OP_LDR_0_NFLOAT (JIT_OP_NUM_OPCODES + 0x005d)
/*
* Stack management.
*/
#define JIT_OP_POP (JIT_OP_NUM_OPCODES + 0x0067)
#define JIT_OP_POP_2 (JIT_OP_NUM_OPCODES + 0x0068)
#define JIT_OP_POP_3 (JIT_OP_NUM_OPCODES + 0x0069)
#define JIT_OP_POP (JIT_OP_NUM_OPCODES + 0x005e)
#define JIT_OP_POP_2 (JIT_OP_NUM_OPCODES + 0x005f)
#define JIT_OP_POP_3 (JIT_OP_NUM_OPCODES + 0x0060)
/*
* Nested function call handling.
*/
#define JIT_OP_IMPORT_LOCAL (JIT_OP_NUM_OPCODES + 0x006a)
#define JIT_OP_IMPORT_ARG (JIT_OP_NUM_OPCODES + 0x006b)
#define JIT_OP_IMPORT_LOCAL (JIT_OP_NUM_OPCODES + 0x0061)
#define JIT_OP_IMPORT_ARG (JIT_OP_NUM_OPCODES + 0x0062)
/*
* Marker opcode for the end of the interpreter-specific opcodes.
*/
#define JIT_OP_END_MARKER (JIT_OP_NUM_OPCODES + 0x006c)
#define JIT_OP_END_MARKER (JIT_OP_NUM_OPCODES + 0x0063)
/*
* Number of interpreter-specific opcodes.

9
jit/jit-opcode.c

@ -558,7 +558,6 @@ jit_opcode_info_t const _jit_interp_opcodes[JIT_OP_NUM_INTERP_OPCODES] = {
{"lda_0_float32", JIT_OPCODE_NINT_ARG},
{"lda_0_float64", JIT_OPCODE_NINT_ARG},
{"lda_0_nfloat", JIT_OPCODE_NINT_ARG},
{"lda_0_struct", JIT_OPCODE_NINT_ARG_TWO},
{"ldaa_0", JIT_OPCODE_NINT_ARG},
{"lda_1_sbyte", JIT_OPCODE_NINT_ARG},
{"lda_1_ubyte", JIT_OPCODE_NINT_ARG},
@ -569,7 +568,6 @@ jit_opcode_info_t const _jit_interp_opcodes[JIT_OP_NUM_INTERP_OPCODES] = {
{"lda_1_float32", JIT_OPCODE_NINT_ARG},
{"lda_1_float64", JIT_OPCODE_NINT_ARG},
{"lda_1_nfloat", JIT_OPCODE_NINT_ARG},
{"lda_1_struct", JIT_OPCODE_NINT_ARG_TWO},
{"ldaa_1", JIT_OPCODE_NINT_ARG},
{"lda_2_sbyte", JIT_OPCODE_NINT_ARG},
{"lda_2_ubyte", JIT_OPCODE_NINT_ARG},
@ -580,7 +578,6 @@ jit_opcode_info_t const _jit_interp_opcodes[JIT_OP_NUM_INTERP_OPCODES] = {
{"lda_2_float32", JIT_OPCODE_NINT_ARG},
{"lda_2_float64", JIT_OPCODE_NINT_ARG},
{"lda_2_nfloat", JIT_OPCODE_NINT_ARG},
{"lda_2_struct", JIT_OPCODE_NINT_ARG_TWO},
{"ldaa_2", JIT_OPCODE_NINT_ARG},
{"sta_0_byte", JIT_OPCODE_NINT_ARG},
{"sta_0_short", JIT_OPCODE_NINT_ARG},
@ -589,7 +586,6 @@ jit_opcode_info_t const _jit_interp_opcodes[JIT_OP_NUM_INTERP_OPCODES] = {
{"sta_0_float32", JIT_OPCODE_NINT_ARG},
{"sta_0_float64", JIT_OPCODE_NINT_ARG},
{"sta_0_nfloat", JIT_OPCODE_NINT_ARG},
{"sta_0_struct", JIT_OPCODE_NINT_ARG_TWO},
/*
* Local variable frame access opcodes.
@ -603,7 +599,6 @@ jit_opcode_info_t const _jit_interp_opcodes[JIT_OP_NUM_INTERP_OPCODES] = {
{"ldl_0_float32", JIT_OPCODE_NINT_ARG},
{"ldl_0_float64", JIT_OPCODE_NINT_ARG},
{"ldl_0_nfloat", JIT_OPCODE_NINT_ARG},
{"ldl_0_struct", JIT_OPCODE_NINT_ARG_TWO},
{"ldla_0", JIT_OPCODE_NINT_ARG},
{"ldl_1_sbyte", JIT_OPCODE_NINT_ARG},
{"ldl_1_ubyte", JIT_OPCODE_NINT_ARG},
@ -614,7 +609,6 @@ jit_opcode_info_t const _jit_interp_opcodes[JIT_OP_NUM_INTERP_OPCODES] = {
{"ldl_1_float32", JIT_OPCODE_NINT_ARG},
{"ldl_1_float64", JIT_OPCODE_NINT_ARG},
{"ldl_1_nfloat", JIT_OPCODE_NINT_ARG},
{"ldl_1_struct", JIT_OPCODE_NINT_ARG_TWO},
{"ldla_1", JIT_OPCODE_NINT_ARG},
{"ldl_2_sbyte", JIT_OPCODE_NINT_ARG},
{"ldl_2_ubyte", JIT_OPCODE_NINT_ARG},
@ -625,7 +619,6 @@ jit_opcode_info_t const _jit_interp_opcodes[JIT_OP_NUM_INTERP_OPCODES] = {
{"ldl_2_float32", JIT_OPCODE_NINT_ARG},
{"ldl_2_float64", JIT_OPCODE_NINT_ARG},
{"ldl_2_nfloat", JIT_OPCODE_NINT_ARG},
{"ldl_2_struct", JIT_OPCODE_NINT_ARG_TWO},
{"ldla_2", JIT_OPCODE_NINT_ARG},
{"stl_0_byte", JIT_OPCODE_NINT_ARG},
{"stl_0_short", JIT_OPCODE_NINT_ARG},
@ -634,7 +627,6 @@ jit_opcode_info_t const _jit_interp_opcodes[JIT_OP_NUM_INTERP_OPCODES] = {
{"stl_0_float32", JIT_OPCODE_NINT_ARG},
{"stl_0_float64", JIT_OPCODE_NINT_ARG},
{"stl_0_nfloat", JIT_OPCODE_NINT_ARG},
{"stl_0_struct", JIT_OPCODE_NINT_ARG_TWO},
/*
* Load constant values.
@ -663,7 +655,6 @@ jit_opcode_info_t const _jit_interp_opcodes[JIT_OP_NUM_INTERP_OPCODES] = {
{"ldr_0_float32", 0},
{"ldr_0_float64", 0},
{"ldr_0_nfloat", 0},
{"ldr_0_small_struct", JIT_OPCODE_NINT_ARG},
/*
* Stack management.

243
jit/jit-rules-interp.c

@ -993,7 +993,7 @@ load_value(jit_gencode_t gen, jit_value_t value, int index)
}
static void
store_value(jit_gencode_t gen, jit_value_t value, int size)
store_value(jit_gencode_t gen, jit_value_t value)
{
int opcode;
jit_nint offset;
@ -1014,10 +1014,6 @@ store_value(jit_gencode_t gen, jit_value_t value, int size)
}
jit_cache_opcode(&(gen->posn), opcode);
jit_cache_native(&(gen->posn), offset);
if(size)
{
jit_cache_native(&(gen->posn), size);
}
}
/*@
@ -1031,7 +1027,6 @@ store_value(jit_gencode_t gen, jit_value_t value, int size)
void _jit_gen_insn(jit_gencode_t gen, jit_function_t func,
jit_block_t block, jit_insn_t insn)
{
int reg;
jit_label_t label;
void **pc;
jit_nint offset;
@ -1195,7 +1190,7 @@ void _jit_gen_insn(jit_gencode_t gen, jit_function_t func,
jit_cache_native(&(gen->posn), block->fixup_list);
block->fixup_list = (void *)pc;
}
store_value(gen, insn->dest, 0);
store_value(gen, insn->dest);
break;
case JIT_OP_CALL:
@ -1285,7 +1280,7 @@ void _jit_gen_insn(jit_gencode_t gen, jit_function_t func,
jit_cache_native(&(gen->posn), -(insn->value1->frame_offset + 1));
jit_cache_native(&(gen->posn), jit_value_get_nint_constant(insn->value2));
}
store_value(gen, insn->dest, 0);
store_value(gen, insn->dest);
break;
case JIT_OP_THROW:
@ -1298,12 +1293,12 @@ void _jit_gen_insn(jit_gencode_t gen, jit_function_t func,
case JIT_OP_LOAD_EXCEPTION_PC:
/* Load the current program counter onto the stack */
jit_cache_opcode(&(gen->posn), insn->opcode);
store_value(gen, insn->dest, 0);
store_value(gen, insn->dest);
break;
case JIT_OP_CALL_FILTER_RETURN:
/* The r0 register currently contains "dest" */
store_value(gen, insn->dest, 0);
store_value(gen, insn->dest);
break;
case JIT_OP_ENTER_FINALLY:
@ -1320,7 +1315,7 @@ void _jit_gen_insn(jit_gencode_t gen, jit_function_t func,
/* The top of the stack contains the return address,
the r0 register contains the "dest" (filter parameter). */
++(gen->extra_working_space);
store_value(gen, insn->dest, 0);
store_value(gen, insn->dest);
break;
case JIT_OP_LEAVE_FILTER:
@ -1340,28 +1335,28 @@ void _jit_gen_insn(jit_gencode_t gen, jit_function_t func,
case JIT_TYPE_INT:
case JIT_TYPE_UINT:
jit_cache_opcode(&(gen->posn), JIT_OP_LDR_0_INT);
store_value(gen, insn->value1, 0);
store_value(gen, insn->value1);
break;
case JIT_TYPE_LONG:
case JIT_TYPE_ULONG:
jit_cache_opcode(&(gen->posn), JIT_OP_LDR_0_LONG);
store_value(gen, insn->value1, 0);
store_value(gen, insn->value1);
break;
case JIT_TYPE_FLOAT32:
jit_cache_opcode(&(gen->posn), JIT_OP_LDR_0_FLOAT32);
store_value(gen, insn->value1, 0);
store_value(gen, insn->value1);
break;
case JIT_TYPE_FLOAT64:
jit_cache_opcode(&(gen->posn), JIT_OP_LDR_0_FLOAT64);
store_value(gen, insn->value1, 0);
store_value(gen, insn->value1);
break;
case JIT_TYPE_NFLOAT:
jit_cache_opcode(&(gen->posn), JIT_OP_LDR_0_NFLOAT);
store_value(gen, insn->value1, 0);
store_value(gen, insn->value1);
break;
}
break;
@ -1375,12 +1370,20 @@ void _jit_gen_insn(jit_gencode_t gen, jit_function_t func,
case JIT_OP_COPY_FLOAT32:
case JIT_OP_COPY_FLOAT64:
case JIT_OP_COPY_NFLOAT:
case JIT_OP_COPY_STRUCT:
case JIT_OP_COPY_STORE_BYTE:
case JIT_OP_COPY_STORE_SHORT:
/* Copy a value from one temporary variable to another */
load_value(gen, insn->value1, 0);
store_value(gen, insn->dest, 0);
store_value(gen, insn->dest);
break;
case JIT_OP_COPY_STRUCT:
/* Copy a struct from one address to another */
load_value(gen, insn->dest, 0);
load_value(gen, insn->value1, 1);
size = (jit_nint)jit_type_get_size(jit_value_get_type(insn->dest));
jit_cache_opcode(&(gen->posn), insn->opcode);
jit_cache_native(&(gen->posn), size);
break;
case JIT_OP_ADDRESS_OF:
@ -1396,7 +1399,7 @@ void _jit_gen_insn(jit_gencode_t gen, jit_function_t func,
jit_cache_opcode(&(gen->posn), JIT_OP_LDAA_0);
jit_cache_native(&(gen->posn), -(insn->value1->frame_offset + 1));
}
store_value(gen, insn->dest, 0);
store_value(gen, insn->dest);
break;
case JIT_OP_PUSH_INT:
@ -1448,145 +1451,109 @@ void _jit_gen_insn(jit_gencode_t gen, jit_function_t func,
}
break;
case JIT_OP_FLUSH_SMALL_STRUCT:
{
/* TODO!!! */
#if 0
/* Flush a small structure return value back into the frame */
_jit_gen_fix_value(insn->value1);
if(insn->value1->frame_offset >= 0)
{
jit_cache_opcode(&(gen->posn), JIT_OP_LDLOCA);
jit_cache_native(&(gen->posn), insn->value1->frame_offset);
}
else
{
jit_cache_opcode(&(gen->posn), JIT_OP_LDARGA);
jit_cache_native
(&(gen->posn), -(insn->value1->frame_offset + 1));
}
jit_cache_opcode(&(gen->posn), JIT_OP_PUSH_RETURN_SMALL_STRUCT);
jit_cache_native
(&(gen->posn), jit_type_get_size(insn->value1->type));
adjust_working(gen, 2);
jit_cache_opcode(&(gen->posn), JIT_OP_STORE_RELATIVE_STRUCT);
jit_cache_native(&(gen->posn), 0);
jit_cache_native
(&(gen->posn), jit_type_get_size(insn->value1->type));
adjust_working(gen, -2);
#endif
}
case JIT_OP_FLUSH_SMALL_STRUCT:
/* Flush a small structure return value back into the frame */
load_value(gen, insn->value1, 0);
size = (jit_nint)jit_type_get_size(jit_value_get_type(insn->value1));
jit_cache_opcode(&(gen->posn), insn->opcode);
jit_cache_native(&(gen->posn), size);
break;
case JIT_OP_LOAD_RELATIVE_SBYTE:
case JIT_OP_LOAD_RELATIVE_UBYTE:
case JIT_OP_LOAD_RELATIVE_SHORT:
case JIT_OP_LOAD_RELATIVE_USHORT:
case JIT_OP_LOAD_RELATIVE_INT:
case JIT_OP_LOAD_RELATIVE_LONG:
case JIT_OP_LOAD_RELATIVE_FLOAT32:
case JIT_OP_LOAD_RELATIVE_FLOAT64:
case JIT_OP_LOAD_RELATIVE_NFLOAT:
{
/* Load a value from a relative pointer */
load_value(gen, insn->value1, 1);
offset = jit_value_get_nint_constant(insn->value2);
jit_cache_opcode(&(gen->posn), insn->opcode);
jit_cache_native(&(gen->posn), offset);
store_value(gen, insn->dest, 0);
}
case JIT_OP_LOAD_RELATIVE_SBYTE:
case JIT_OP_LOAD_RELATIVE_UBYTE:
case JIT_OP_LOAD_RELATIVE_SHORT:
case JIT_OP_LOAD_RELATIVE_USHORT:
case JIT_OP_LOAD_RELATIVE_INT:
case JIT_OP_LOAD_RELATIVE_LONG:
case JIT_OP_LOAD_RELATIVE_FLOAT32:
case JIT_OP_LOAD_RELATIVE_FLOAT64:
case JIT_OP_LOAD_RELATIVE_NFLOAT:
/* Load a value from a relative pointer */
load_value(gen, insn->value1, 1);
offset = jit_value_get_nint_constant(insn->value2);
jit_cache_opcode(&(gen->posn), insn->opcode);
jit_cache_native(&(gen->posn), offset);
store_value(gen, insn->dest);
break;
case JIT_OP_LOAD_RELATIVE_STRUCT:
{
/* Load a structured value from a relative pointer */
load_value(gen, insn->value1, 1);
offset = jit_value_get_nint_constant(insn->value2);
size = (jit_nint)jit_type_get_size(jit_value_get_type(insn->dest));
jit_cache_opcode(&(gen->posn), insn->opcode);
jit_cache_native(&(gen->posn), offset);
jit_cache_native(&(gen->posn), size);
store_value(gen, insn->dest, size);
}
case JIT_OP_LOAD_RELATIVE_STRUCT:
/* Load a structured value from a relative pointer */
load_value(gen, insn->dest, 0);
load_value(gen, insn->value1, 1);
offset = jit_value_get_nint_constant(insn->value2);
size = (jit_nint)jit_type_get_size(jit_value_get_type(insn->dest));
jit_cache_opcode(&(gen->posn), insn->opcode);
jit_cache_native(&(gen->posn), offset);
jit_cache_native(&(gen->posn), size);
break;
case JIT_OP_STORE_RELATIVE_BYTE:
case JIT_OP_STORE_RELATIVE_SHORT:
case JIT_OP_STORE_RELATIVE_INT:
case JIT_OP_STORE_RELATIVE_LONG:
case JIT_OP_STORE_RELATIVE_FLOAT32:
case JIT_OP_STORE_RELATIVE_FLOAT64:
case JIT_OP_STORE_RELATIVE_NFLOAT:
case JIT_OP_STORE_RELATIVE_BYTE:
case JIT_OP_STORE_RELATIVE_SHORT:
case JIT_OP_STORE_RELATIVE_INT:
case JIT_OP_STORE_RELATIVE_LONG:
case JIT_OP_STORE_RELATIVE_FLOAT32:
case JIT_OP_STORE_RELATIVE_FLOAT64:
case JIT_OP_STORE_RELATIVE_NFLOAT:
/* Store a value to a relative pointer */
load_value(gen, insn->dest, 0);
load_value(gen, insn->value1, 1);
offset = jit_value_get_nint_constant(insn->value2);
jit_cache_opcode(&(gen->posn), insn->opcode);
jit_cache_native(&(gen->posn), offset);
break;
case JIT_OP_STORE_RELATIVE_STRUCT:
/* Store a structured value to a relative pointer */
load_value(gen, insn->dest, 0);
load_value(gen, insn->value1, 1);
offset = jit_value_get_nint_constant(insn->value2);
size = (jit_nint)jit_type_get_size(jit_value_get_type(insn->value1));
jit_cache_opcode(&(gen->posn), insn->opcode);
jit_cache_native(&(gen->posn), offset);
jit_cache_native(&(gen->posn), size);
break;
case JIT_OP_ADD_RELATIVE:
/* Add a relative offset to a pointer */
offset = jit_value_get_nint_constant(insn->value2);
if(offset != 0)
{
/* Store a value to a relative pointer */
load_value(gen, insn->dest, 0);
load_value(gen, insn->value1, 1);
offset = jit_value_get_nint_constant(insn->value2);
jit_cache_opcode(&(gen->posn), insn->opcode);
jit_cache_native(&(gen->posn), offset);
store_value(gen, insn->dest);
}
else
{
load_value(gen, insn->value1, 0);
store_value(gen, insn->dest);
}
break;
case JIT_OP_STORE_RELATIVE_STRUCT:
case JIT_OP_MARK_BREAKPOINT:
/* Mark the current location as a potential breakpoint */
jit_cache_opcode(&(gen->posn), insn->opcode);
jit_cache_native(&(gen->posn), insn->value1->address);
jit_cache_native(&(gen->posn), insn->value2->address);
break;
default:
if(insn->dest && (insn->flags & JIT_INSN_DEST_IS_VALUE) != 0)
{
/* Store a structured value to a relative pointer */
load_value(gen, insn->dest, 0);
load_value(gen, insn->value1, 1);
offset = jit_value_get_nint_constant(insn->value2);
size = (jit_nint)jit_type_get_size(jit_value_get_type(insn->value1));
jit_cache_opcode(&(gen->posn), insn->opcode);
jit_cache_native(&(gen->posn), offset);
jit_cache_native(&(gen->posn), size);
}
break;
case JIT_OP_ADD_RELATIVE:
if(insn->value1)
{
/* Add a relative offset to a pointer */
offset = jit_value_get_nint_constant(insn->value2);
if(offset != 0)
{
load_value(gen, insn->value1, 1);
jit_cache_opcode(&(gen->posn), insn->opcode);
jit_cache_native(&(gen->posn), offset);
store_value(gen, insn->dest, 0);
}
else
{
load_value(gen, insn->value1, 0);
store_value(gen, insn->dest, 0);
}
load_value(gen, insn->value1, 1);
}
break;
case JIT_OP_MARK_BREAKPOINT:
if(insn->value2)
{
/* Mark the current location as a potential breakpoint */
jit_cache_opcode(&(gen->posn), insn->opcode);
jit_cache_native(&(gen->posn), insn->value1->address);
jit_cache_native(&(gen->posn), insn->value2->address);
load_value(gen, insn->value2, 2);
}
break;
default:
jit_cache_opcode(&(gen->posn), insn->opcode);
if(insn->dest && (insn->flags & JIT_INSN_DEST_IS_VALUE) == 0)
{
if(insn->dest && (insn->flags & JIT_INSN_DEST_IS_VALUE) != 0)
{
load_value(gen, insn->dest, 0);
}
if(insn->value1)
{
load_value(gen, insn->value1, 1);
}
if(insn->value2)
{
load_value(gen, insn->value2, 2);
}
jit_cache_opcode(&(gen->posn), insn->opcode);
if(insn->dest && (insn->flags & JIT_INSN_DEST_IS_VALUE) == 0)
{
store_value(gen, insn->dest, 0);
}
store_value(gen, insn->dest);
}
break;
}
@ -1608,7 +1575,7 @@ void _jit_gen_start_block(jit_gencode_t gen, jit_block_t block)
/* If this block has pending fixups, then apply them now */
fixup = (void **)(block->fixup_list);
while(fixup != 0)
while(fixup != 0 && ((unsigned char *)fixup[2] - 1) < gen->posn.limit)
{
next = (void **)(fixup[1]);
fixup[1] = (void *)(jit_nint)(((void **)(block->address)) - fixup);

Loading…
Cancel
Save