-L_stack_copy_loop:
- add $sizejniblock,%r14 /* goto next argument block */
- dec %r15 /* are there any arguments left? */
- jz L_copy_done /* no test needed after dec */
-
- andb $0x02,offjniitemtype(%r14) /* is this a float/double type? */
- jnz L_stack_handle_float
- dec %r12 /* arguments assigned to registers */
- jge L_stack_copy_loop
- jmp L_stack_copy
-
-L_stack_handle_float:
- dec %r13 /* arguments assigned to registers */
- jge L_stack_copy_loop
-
-L_stack_copy:
- mov offjniitem(%r14),itmp3 /* copy s8 argument onto stack */
- mov itmp3,0(%rbx)
- add $8,%rbx /* increase sp to next argument */
- jmp L_stack_copy_loop
-
-L_copy_done:
- lea asm_call_jit_compiler,%r11/* %rax still contains method pointer */
- call *%r11 /* call JIT compiler */
-
- add %rbp,%rsp /* remove argument stack frame if any */
-
- mov 5*8(%rsp),%r15 /* restore callee saved registers */
- mov 4*8(%rsp),%r14
- mov 3*8(%rsp),%r13
- mov 2*8(%rsp),%r12
- mov 1*8(%rsp),%rbp
- mov 0*8(%rsp),%rbx
- add $(7*8),%rsp /* free stack space */
- ret
-
-calljava_xhandler2:
- mov %rax,%rdi /* pass exception pointer */
- call builtin_throw_exception
-
- mov 5*8(%rsp),%r15 /* restore callee saved registers */
- mov 4*8(%rsp),%r14
- mov 3*8(%rsp),%r13
- mov 2*8(%rsp),%r12
- mov 1*8(%rsp),%rbp
- mov 0*8(%rsp),%rbx
- add $(7*8),%rsp /* free stack space */
- xor %rax,%rax /* return NULL */
- ret
-
-
-jumptable_integer:
- .quad handle_a0
- .quad handle_a1
- .quad handle_a2
- .quad handle_a3
- .quad handle_a4
- .quad handle_a5
-
-handle_a0:
- mov offjniitem(itmp2),a0
- jmp L_register_copy
-handle_a1:
- mov offjniitem(itmp2),a1
- jmp L_register_copy
-handle_a2:
- mov offjniitem(itmp2),a2
- jmp L_register_copy
-handle_a3:
- mov offjniitem(itmp2),a3
- jmp L_register_copy
-handle_a4:
- mov offjniitem(itmp2),a4
- jmp L_register_copy
-handle_a5:
- mov offjniitem(itmp2),a5
- jmp L_register_copy
-
-
-jumptable_float:
- .quad handle_fa0
- .quad handle_fa1
- .quad handle_fa2
- .quad handle_fa3
- .quad handle_fa4
- .quad handle_fa5
- .quad handle_fa6
- .quad handle_fa7
-
-handle_fa0:
- movq offjniitem(itmp2),fa0
- jmp L_register_copy
-handle_fa1:
- movq offjniitem(itmp2),fa1
- jmp L_register_copy
-handle_fa2:
- movq offjniitem(itmp2),fa2
- jmp L_register_copy
-handle_fa3:
- movq offjniitem(itmp2),fa3
- jmp L_register_copy
-handle_fa4:
- movq offjniitem(itmp2),fa4
- jmp L_register_copy
-handle_fa5:
- movq offjniitem(itmp2),fa5
- jmp L_register_copy
-handle_fa6:
- movq offjniitem(itmp2),fa6
- jmp L_register_copy
-handle_fa7:
- movq offjniitem(itmp2),fa7
- jmp L_register_copy
-
-
-/****************** function asm_call_jit_compiler *****************************
-* *
-* invokes the compiler for untranslated JavaVM methods. *
-* *
-* Register R0 contains a pointer to the method info structure (prepared *
-* by createcompilerstub). Using the return address in R26 and the *
-* offset in the LDA instruction or using the value in methodptr R28 the *
-* patching address for storing the method address can be computed: *
-* *
-* method address was either loaded using *
-* *
-* i386_mov_imm_reg(a, REG_ITMP2) ; invokestatic/special *
-* i386_call_reg(REG_ITMP2) *
-* *
-* or *
-* *
-* i386_mov_membase_reg(REG_SP, 0, REG_ITMP2) ; invokevirtual/interface *
-* i386_mov_membase_reg(REG_ITMP2, OFFSET(, vftbl), REG_ITMP3) *
-* i386_mov_membase_reg(REG_ITMP3, OFFSET(vftbl, table[0]) + \ *
-* sizeof(methodptr) * m->vftblindex, REG_ITMP1) *
-* i386_call_reg(REG_ITMP1) *
-* *
-* in the static case the method pointer can be computed using the *
-* return address and the lda function following the jmp instruction *
-* *
-*******************************************************************************/
-
-asm_call_jit_compiler:
- sub $((3+24)*8+sizestackframeinfo),sp /* keep stack 16-byte aligned */
-
- mov %rbx,0*8(%rsp) /* save register */
-
- mov (3+24)*8+sizestackframeinfo(%rsp),itmp3 /* get return address */
- mov -1(itmp3),%bl /* get function code */
- cmp $0xd2,%bl /* called with `call *REG_ITMP2'? */
- jne L_not_static_special
-
- sub $11,itmp3 /* calculate address of immediate */
- jmp L_call_jit_compile
-
-L_not_static_special:
- cmp $0xd0,%bl /* called with `call *REG_ITMP1' (%rax) */
- jne L_not_virtual_interface
-
- sub $7,itmp3 /* calculate address of offset */
- mov (itmp3),itmp3l /* get offset (32-bit) */
- add itmp2,itmp3 /* add base address to get method address */
- jmp L_call_jit_compile
-
-L_not_virtual_interface: /* a call from asm_calljavamethod */
- xor itmp3,itmp3
-
-L_call_jit_compile:
- mov 0*8(sp),%rbx /* restore register */
- mov itmp3,0*8(sp) /* save address for method pointer */
- mov itmp1,1*8(sp) /* save method pointer */
-
- SAVE_ARGUMENT_REGISTERS(2)
-
- mov sp,a0 /* create stackframe info */
- add $((3+24)*8),a0 /* pass sfi */
- xor a1,a1 /* if pv is NULL, use findmethod */
- mov sp,a2 /* pass java sp */
- add $((1+3+24)*8+sizestackframeinfo),a2
- mov ((3+24)*8+sizestackframeinfo)(sp),a3 /* pass ra to java function */
- mov a3,a4 /* xpc is equal to ra */
- call stacktrace_create_extern_stackframeinfo
-
- mov 1*8(sp),a0 /* pass method pointer */
- call jit_compile
- mov v0,1*8(sp) /* save return value */
-
- mov sp,a0 /* remove stackframe info */
- add $((3+24)*8),a0 /* pass sfi */
- call stacktrace_remove_stackframeinfo
-
- mov 0*8(sp),itmp3 /* restore address for method pointer */
- mov 1*8(sp),v0 /* restore return value */
-
- RESTORE_ARGUMENT_REGISTERS(2)
-
- add $((3+24)*8+sizestackframeinfo),sp /* remove stack frame */