1 /* jit/i386/asmpart.S - Java-C interface functions for i386
3 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
4 Institut f. Computersprachen, TU Wien
5 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, M. Probst,
6 S. Ring, E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich,
9 This file is part of CACAO.
11 This program is free software; you can redistribute it and/or
12 modify it under the terms of the GNU General Public License as
13 published by the Free Software Foundation; either version 2, or (at
14 your option) any later version.
16 This program is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
26 Contact: cacao@complang.tuwien.ac.at
28 Authors: Andreas Krall
32 $Id: asmpart.S 930 2004-03-02 21:18:23Z jowenn $
39 /* data segment offsets */
41 #define MethodPointer -4
47 #define ExTableSize -28
48 #define ExTableStart -28
50 #define ExEntrySize -16
53 #define ExHandlerPC -12
54 #define ExCatchType -16
60 /********************* exported functions and variables ***********************/
62 .globl has_no_x_instr_set
63 .globl asm_calljavafunction
64 .globl asm_calljavafunction2
65 .globl asm_calljavafunction2long
66 .globl asm_calljavafunction2double
68 .globl asm_call_jit_compiler
69 .globl asm_dumpregistersandcall
70 .globl asm_handle_builtin_exception
71 .globl asm_handle_nat_exception
72 .globl asm_handle_exception
73 .globl asm_check_clinit
74 .globl asm_builtin_checkcast
75 .globl asm_builtin_checkarraycast
76 .globl asm_builtin_newarray
77 .globl asm_builtin_anewarray
78 .globl asm_builtin_newarray_array
79 .globl asm_builtin_aastore
80 .globl asm_builtin_monitorenter
81 .globl asm_builtin_monitorexit
82 .globl asm_builtin_ldiv
83 .globl asm_builtin_lrem
84 .globl asm_builtin_f2i
85 .globl asm_builtin_f2l
86 .globl asm_builtin_d2i
87 .globl asm_builtin_d2l
88 .globl asm_builtin_arrayinstanceof
89 .globl asm_perform_threadswitch
90 .globl asm_initialize_thread_stack
91 .globl asm_switchstackandcall
92 .globl asm_getcallingmethod
93 .globl Java_java_lang_VMSecurityManager_getClassContext
94 .globl Java_java_lang_VMSecurityManager_currentClassLoader
95 /*************************** imported functions *******************************/
98 .globl builtin_monitorexit
99 .globl builtin_throw_exception
100 .globl builtin_trace_exception
101 .globl class_java_lang_Object
103 .globl builtin_asm_createclasscontextarray
104 .globl builtin_asm_getclassloader
105 #if defined(USE_THREADS) && defined(NATIVE_THREADS)
111 /*********************** function has_no_x_instr_set ***************************
113 * determines if the byte support instruction set (21164a and higher) *
116 * Use it on i386 architecture to init the fpu. *
118 *******************************************************************************/
121 finit /* intitialize the fpu */
123 pushl $0x027f /* Round to nearest, 53-bit mode, exceptions masked */
127 xor %eax,%eax /* result code 0 (not used for i386) */
131 /********************* function asm_calljavafunction ***************************
133 * This function calls a Java-method (which possibly needs compilation) *
134 * with up to 4 address parameters. *
136 * This functions calls the JIT-compiler which eventually translates the *
137 * method into machine code. *
140 * javaobject_header *asm_calljavamethod (methodinfo *m, *
141 * void *arg1, void *arg2, void *arg3, void *arg4); *
143 *******************************************************************************/
146 .ascii "calljavafunction\0\0"
149 .long 0 /* catch type all */
150 .long calljava_xhandler /* handler pc */
151 .long calljava_xhandler /* end pc */
152 .long asm_calljavafunction /* start pc */
153 .long 1 /* extable size */
154 .long 0 /* fltsave */
155 .long 0 /* intsave */
158 .long 32 /* frame size */
159 .long 0 /* method pointer (pointer to name) */
161 asm_calljavafunction:
162 push %ebp /* allocate stack space */
165 push %ebx /* save registers */
169 sub $32,%esp /* pass the remaining parameters */
172 mov %edx,28(%esp) /* convert parms to 8 byte */
188 mov 8(%ebp),%eax /* move function pointer to %eax */
190 lea asm_call_jit_compiler,%edx
191 call *%edx /* call JIT compiler */
195 pop %edi /* restore registers */
202 push %eax /* pass exception pointer */
203 call builtin_throw_exception
207 pop %edi /* restore registers */
215 /********************* function asm_calljavafunction ***************************
217 * This function calls a Java-method (which possibly needs compilation) *
218 * with up to 4 address parameters. *
220 * This functions calls the JIT-compiler which eventually translates the *
221 * method into machine code. *
224 * javaobject_header *asm_calljavamethod (methodinfo *m, *
225 * void *arg1, void *arg2, void *arg3, void *arg4); *
227 *******************************************************************************/
230 .ascii "calljavafunction2\0\0"
233 .long 0 /* catch type all */
234 .long calljava_xhandler2 /* handler pc */
235 .long calljava_xhandler2 /* end pc */
236 .long asm_calljavafunction2 /* start pc */
237 .long 1 /* extable size */
238 .long 0 /* fltsave */
239 .long 0 /* intsave */
242 .long 32 /* frame size */
243 .long 0 /* method pointer (pointer to name) */
245 asm_calljavafunction2:
246 asm_calljavafunction2double:
247 asm_calljavafunction2long:
248 push %ebp /* save ebp */
250 mov %esp,%eax /* save stackptr */
253 push %ebx /* save registers */
259 mov sizejniblock*3+offjniitem+4(%ebp),%ebx
261 mov sizejniblock*3+offjniitem(%ebp),%ebx
264 mov sizejniblock*2+offjniitem+4(%ebp),%ebx
266 mov sizejniblock*2+offjniitem(%ebp),%ebx
270 mov sizejniblock+offjniitem+4(%ebp),%ebx
272 mov sizejniblock+offjniitem(%ebp),%ebx
275 mov offjniitem+4(%ebp),%ebx
277 mov offjniitem(%ebp),%ebx
281 mov 8(%ebp),%eax /* move function pointer to %eax */
283 lea asm_call_jit_compiler,%edx
284 call *%edx /* call JIT compiler */
288 pop %edi /* restore registers */
295 push %eax /* pass exception pointer */
296 call builtin_throw_exception
300 pop %edi /* restore registers */
307 /****************** function asm_call_jit_compiler *****************************
309 * invokes the compiler for untranslated JavaVM methods. *
311 * Register R0 contains a pointer to the method info structure (prepared *
312 * by createcompilerstub). Using the return address in R26 and the *
313 * offset in the LDA instruction or using the value in methodptr R28 the *
314 * patching address for storing the method address can be computed: *
316 * method address was either loaded using *
318 * i386_mov_imm_reg(a, REG_ITMP2) ; invokestatic/special *
319 * i386_call_reg(REG_ITMP2) *
323 * i386_mov_membase_reg(REG_SP, 0, REG_ITMP1) ; invokevirtual/interface *
324 * i386_mov_membase_reg(REG_ITMP1, OFFSET(, vftbl), REG_ITMP2) *
325 * i386_mov_membase_reg(REG_ITMP2, OFFSET(vftbl, table[0]) + \ *
326 * sizeof(methodptr) * m->vftblindex, REG_ITMP1) *
327 * i386_call_reg(REG_ITMP1) *
329 * in the static case the method pointer can be computed using the *
330 * return address and the lda function following the jmp instruction *
332 *******************************************************************************/
335 asm_call_jit_compiler:
336 push %ebx /* save register */
339 mov 8(%esp),%ebp /* get return address (2 push) */
340 mov -1(%ebp),%bl /* get function code */
341 cmp $0xd1,%bl /* called with `call *REG_ITMP2' (%ecx)? */
342 jne L_not_static_special
344 sub $6,%ebp /* calculate address of immediate */
345 jmp L_call_jit_compile
347 L_not_static_special:
348 cmp $0xd0,%bl /* called with `call *REG_ITMP1' (%eax) */
349 jne L_not_virtual_interface
351 sub $6,%ebp /* calculate address of offset */
352 mov (%ebp),%ebp /* get offset */
353 add %ecx,%ebp /* add base address to get method address */
354 jmp L_call_jit_compile
356 L_not_virtual_interface: /* a call from asm_calljavafunction */
360 push %ebp /* save address for method pointer */
362 push %eax /* push methodpointer on stack */
366 pop %ebp /* restore address for method pointer */
367 test %ebp,%ebp /* is address == 0 (asm_calljavafunction) */
370 mov %eax,(%ebp) /* and now save the new pointer */
373 pop %ebp /* restore registers */
376 jmp *%eax /* ...and now call the new method */
380 /****************** function asm_dumpregistersandcall **************************
382 * This funtion saves all callee saved registers and calls the function *
383 * which is passed as parameter. *
385 * This function is needed by the garbage collector, which needs to access *
386 * all registers which are stored on the stack. Unused registers are *
387 * cleared to avoid interferances with the GC. *
389 * void asm_dumpregistersandcall (functionptr f); *
391 *******************************************************************************/
393 asm_dumpregistersandcall:
404 mov 4(%ebp),%eax /* load function pointer */
405 call *%eax /* call function */
417 /********************* function asm_handle_exception ***************************
419 * This function handles an exception. It does not use the usual calling *
420 * conventions. The exception pointer is passed in REG_ITMP1 and the *
421 * pc from the exception raising position is passed in REG_ITMP2. It searches *
422 * the local exception table for a handler. If no one is found, it unwinds *
423 * stacks and continues searching the callers. *
425 * void asm_handle_exception (exceptionptr, exceptionpc); *
427 *******************************************************************************/
429 asm_handle_builtin_exception:
430 add $4,%esp /* clear return address of this call */
431 mov (%esp),%eax /* get exceptionptr */
432 leave /* leave builtin function */
433 mov (%esp),%edx /* get exceptionpc */
434 sub $2,%edx /* size of builtin call */
435 jmp asm_handle_exception
437 asm_handle_nat_exception:
438 add $4,%esp /* clear return address of native stub */
440 asm_handle_exception:
444 push %eax /* save exception pointer */
445 push %ecx /* save exception pc */
447 #if defined(USE_THREADS) && defined(NATIVE_THREADS)
451 call findmethod /* get the data segment ptr */
455 mov -8(%ebp),%ecx /* could be changed in findmethod */
457 push %edx /* save data segment pointer */
464 mov %eax,(%esp) /* exception pointer */
465 mov MethodPointer(%edx),%eax /* method pointer */
467 mov %ecx,8(%esp) /* exception pc */
468 movl $1,12(%esp) /* set no unwind flag */
469 call builtin_trace_exception
472 mov -12(%ebp),%esi /* %esi = data segment pointer */
473 mov ExTableSize(%esi),%ecx /* %ecx = exception table size */
474 test %ecx,%ecx /* if empty table skip */
477 lea ExTableStart(%esi),%edi /* %edi = start of exception table*/
478 mov -4(%ebp),%eax /* get xptr */
481 mov -8(%ebp),%edx /* get xpc */
483 mov ExStartPC(%edi),%ebx /* %ebx = exception start pc */
484 cmp %edx,%ebx /* %ebx = (startpc <= xpc) */
485 jg ex_table_cont /* if (false) continue */
486 mov ExEndPC(%edi),%ebx /* %ebx = exception end pc */
487 cmp %ebx,%edx /* %ebx = (xpc < endpc) */
488 jge ex_table_cont /* if (false) continue */
489 mov ExCatchType(%edi),%ebx /* arg1 = exception catch type */
490 test %ebx,%ebx /* NULL catches everything */
493 mov offobjvftbl(%eax),%esi /* %esi = vftblptr(xptr) */
494 mov offclassvftbl(%ebx),%ebx /* %ebx = vftblptr(catchtype) class (not obj) */
495 mov offbaseval(%esi),%esi /* %esi = baseval(xptr) */
496 mov offbaseval(%ebx),%edx /* %edx = baseval(catchtype) */
497 mov offdiffval(%ebx),%ebx /* %ebx = diffval(catchtype) */
498 sub %edx,%esi /* %esi = baseval(xptr) - baseval(catchtype) */
499 cmp %ebx,%esi /* xptr is instanceof catchtype */
503 mov ExHandlerPC(%edi),%edx
505 pop %edi /* restore registers */
508 add $8,%esp /* suck %ecx, %edx */
509 pop %eax /* restore xptr */
511 #if defined(USE_THREADS) && defined(NATIVE_THREADS)
516 jmp *%edx /* jump to exception handler */
519 lea ExEntrySize(%edi),%edi
528 pop %edx /* restore data segment pointer */
533 push %eax /* save exception pointer */
536 mov IsSync(%edx),%eax /* %eax = SyncOffset */
537 test %eax,%eax /* if zero no monitorexit */
541 mov -4(%eax),%eax /* we have the xptr on the stack */
542 push %edx /* save regs */
544 call builtin_monitorexit
546 pop %edx /* restore regs */
550 add FrameSize(%edx),%eax /* %eax = frame size */
551 add $4,%eax /* we have the xptr on the stack */
553 mov IntSave(%edx),%ecx /* %ecx = saved int register count*/
575 shl $3,%ecx /* multiply by 8 bytes */
579 mov FltSave(%edx),%ecx /* %ecx = saved flt register count */
606 pop %eax /* restore exception pointer */
608 mov FrameSize(%edx),%ecx /* %ecx = frame size */
609 add %ecx,%esp /* unwind stack */
611 pop %ecx /* the new xpc is return address */
614 jmp asm_handle_exception
617 /********************* function asm_check_clinit *******************************
619 * Does null check and calls monitorenter or throws an exception *
621 *******************************************************************************/
624 mov offclassinit(%eax),%ecx /* get initialized flag */
628 push %eax /* pass classinfo pointer */
629 call class_init /* call class_init function */
633 mov (%esp),%eax /* get return address */
634 sub $12,%eax /* asm_putstatic call code size */
635 movb $0xeb,(%eax) /* jmp rel8 */
636 movl $10,1(%eax) /* 32-bit offset */
640 /********************* function asm_builtin_monitorenter ***********************
642 * Does null check and calls monitorenter or throws an exception *
644 *******************************************************************************/
646 asm_builtin_monitorenter:
648 je nb_monitorenter /* if (null) throw exception */
649 jmp builtin_monitorenter /* else call builtin_monitorenter */
652 popl %ecx /* delete return address */
653 subl $2,%ecx /* faulting address is return adress - 2 */
654 movl proto_java_lang_NullPointerException,%eax
655 jmp asm_handle_exception
658 /********************* function asm_builtin_monitorexit ************************
660 * Does null check and calls monitorexit or throws an exception *
662 *******************************************************************************/
664 asm_builtin_monitorexit:
667 je nb_monitorexit /* if (null) throw exception */
668 push %ecx /* save registers which could be used */
671 call builtin_monitorexit /* else call builtin_monitorenter */
673 pop %edx /* restore registers which could be used */
678 popl %ecx /* delete return address */
679 subl $2,%ecx /* faulting address is return adress - 2 */
680 movl proto_java_lang_NullPointerException,%eax
681 jmp asm_handle_exception
684 /************************ function asm_builtin_ldiv ****************************
686 * Does null check and calls ldiv or throws an exception *
688 *******************************************************************************/
693 test %eax,%eax /* if (null) throw exception */
699 pop %ecx /* delete return address */
700 sub $2,%ecx /* faulting address is return adress - 2 */
701 mov proto_java_lang_ArithmeticException,%eax
702 jmp asm_handle_exception
705 /************************ function asm_builtin_lrem ****************************
707 * Does null check and calls lrem or throws an exception *
709 *******************************************************************************/
714 test %eax,%eax /* if (null) throw exception */
720 pop %ecx /* delete return address */
721 sub $2,%ecx /* faulting address is return adress - 2 */
722 mov proto_java_lang_ArithmeticException,%eax
723 jmp asm_handle_exception
726 /************************ function asm_builtin_x2x *****************************
728 * Wrapper functions for corner cases *
730 *******************************************************************************/
761 /*********************** function new_builtin_checkcast ************************
763 * Does the cast check and eventually throws an exception *
765 *******************************************************************************/
767 asm_builtin_checkcast:
773 /******************* function asm_builtin_checkarraycast ***********************
775 * Does the cast check and eventually throws an exception *
777 *******************************************************************************/
779 asm_builtin_checkarraycast:
780 sub $8,%esp /* build stack frame (2 * 4 bytes) */
782 mov 12(%esp),%eax /* 8 (frame) + 4 (return) */
783 mov %eax,(%esp) /* save object pointer */
788 call builtin_checkarraycast /* builtin_checkarraycast */
790 test %eax,%eax /* if (false) throw exception */
793 mov 12(%esp),%eax /* return object pointer */
800 pop %ecx /* delete return address */
801 sub $2,%ecx /* faulting address is return adress - 2 */
802 mov proto_java_lang_ClassCastException,%eax
803 jmp asm_handle_exception
806 /******************* function asm_builtin_newarray *****************************
808 * Does the cast check and eventually throws an exception *
810 *******************************************************************************/
812 asm_builtin_newarray:
813 sub $8,%esp /* build stack frame (2 * 4 bytes) */
821 call builtin_newarray
827 /******************* function asm_builtin_aastore ******************************
829 * Does the cast check and eventually throws an exception *
831 *******************************************************************************/
834 subl $12,%esp /* build stack frame (3 * 4 bytes) */
836 movl 16(%esp),%eax /* 12 (frame) + 4 (return) */
837 test %eax,%eax /* if null pointer throw exception */
840 movl offarraysize(%eax),%edx /* load size */
841 movl 24(%esp),%ecx /* index */
842 cmpl %edx,%ecx /* do bound check */
843 ja nb_aastore_bound /* if out of bounds throw exception */
845 shll $2,%ecx /* index * 4 */
846 addl %eax,%ecx /* add index * 4 to arrayref */
848 movl %ecx,8(%esp) /* save store position */
850 movl 16(%esp),%eax /* 12 (frame) + 4 (return) */
853 movl 32(%esp),%eax /* object is second argument */
856 call builtin_canstore /* builtin_canstore(arrayref,object) */
858 test %eax,%eax /* if (false) throw exception */
863 movl %eax,offobjarrdata(%ecx)/* store objectptr in array */
870 popl %ecx /* delete return address */
871 subl $2,%ecx /* faulting address is return adress - 2 */
872 movl proto_java_lang_NullPointerException,%eax
873 jmp asm_handle_exception
877 popl %ecx /* delete return address */
878 subl $2,%ecx /* faulting address is return adress - 2 */
879 movl proto_java_lang_ArrayIndexOutOfBoundsException,%eax
880 jmp asm_handle_exception
884 popl %ecx /* delete return address */
885 subl $2,%ecx /* faulting address is return adress - 2 */
886 movl proto_java_lang_ArrayStoreException,%eax
887 jmp asm_handle_exception
890 /******************* function asm_builtin_arrayinstanceof **********************
892 * Does the instanceof check of arrays *
894 *******************************************************************************/
896 asm_builtin_arrayinstanceof:
897 subl $8,%esp /* build stack frame (2 * 4 bytes) */
905 call builtin_arrayinstanceof
911 /******************* function asm_initialize_thread_stack **********************
913 * initialized a thread stack *
914 * (to)->restorePoint = asm_initialize_thread_stack((u1*)(func), (to)->stackEnd)*
916 *******************************************************************************/
918 asm_initialize_thread_stack:
919 movl 8(%esp),%eax /* (to)->stackEnd */
920 subl $36,%eax /* 4 bytes * 8 regs + 4 bytes func */
932 movl 4(%esp),%edx /* save (u1*) (func) */
935 ret /* return restorepoint in %eax */
938 /******************* function asm_perform_threadswitch *************************
940 * void asm_perform_threadswitch (u1 **from, u1 **to, u1 **stackTop); *
942 * performs a threadswitch *
944 *******************************************************************************/
946 asm_perform_threadswitch:
958 movl 36(%esp),%eax /* save current return address */
961 movl 40(%esp),%eax /* first argument **from */
964 movl 48(%esp),%eax /* third argument **stackTop */
967 movl 44(%esp),%eax /* second argument **to */
968 movl 0(%eax),%esp /* load new stack pointer */
974 /* skip stack pointer */
979 addl $32,%esp /* leave return address on stack */
983 /********************* function asm_switchstackandcall *************************
985 * int asm_switchstackandcall (void *stack, void *func, void **stacktopsave, *
988 * Switches to a new stack, calls a function and switches back. *
989 * a0 new stack pointer *
990 * a1 function pointer *
991 * a2 pointer to variable where stack top should be stored *
992 * a3 pointer to user data, is passed to the function *
994 *******************************************************************************/
996 asm_switchstackandcall:
997 movl 4(%esp),%edx /* first argument *stack */
998 subl $8,%edx /* allocate new stack */
1000 movl (%esp),%eax /* save return address on new stack */
1003 movl %esp,4(%edx) /* save old stack pointer on new stack*/
1005 movl 12(%esp),%eax /* third argument **stacktopsave */
1006 movl %esp,(%eax) /* save old stack pointer to variable */
1008 movl 8(%esp),%eax /* load function pointer */
1009 movl 16(%esp),%ecx /* fourth argument *p */
1011 movl %edx,%esp /* switch to new stack */
1014 movl %ecx,0(%esp) /* pass pointer */
1015 call *%eax /* and call function */
1018 movl (%esp),%edx /* load return address */
1019 movl 4(%esp),%esp /* switch to old stack */
1024 /********************* function asm_getcallingmethod ***************************
1026 * classinfo *asm_getcallingmethod (); *
1028 * goes back stack frames to get the calling method *
1034 *******************************************************************************/
1036 asm_getcallingmethod:
1038 /* movl $0,(%eax) */
1041 Java_java_lang_VMSecurityManager_currentClassLoader:
1042 lea builtin_asm_getclassloader,%eax
1043 push %eax /*store collector function pointer*/
1044 jmp getClassContext_begin
1045 Java_java_lang_VMSecurityManager_getClassContext:
1046 lea builtin_asm_createclasscontextarray,%eax
1047 push %eax /*store collector function pointer*/
1048 getClassContext_begin: /*start the real work*/
1049 /* find the method calling this */
1052 sub $68,%esp /*64 memory location without overwriting return adress and collector function adress*/
1053 mov %esp,%ebx /*end of allocated memory block for classpointers is the adress of the working data block +4 */
1054 push $0 /*%esp+32 was native*/
1055 push %eax /*%esp+24 blkbegin*/
1056 push %eax /*%esp+20 currentpos*/
1057 push %ebx /*%esp+16 blkend*/
1059 call builtin_asm_get_threadrootmethod
1060 push %eax /*%esp+12*/
1061 movl 104(%esp),%eax /*(stack contains: threadRootMethod,blkend,blkpos,blkbegin,was native, data(64kB),collector,ret,env,class,frame stack info of stub, we want the frame stack info of thestub*/
1064 push %edx /*esp+8*/ /*position of return address of native stub*/
1065 call builtin_asm_get_framestackinfo
1066 push %eax /*esp+4*/ /*address of frame info block*/
1067 movl offreturnfromnative(%eax),%edx
1068 movl offprevnative(%eax),%ebx
1070 push %edx /*esp+0*/ /*return adress out of native stub*/
1071 call findmethod /*find calling java method, this one is still to be skipped (==SecurityManager.getClassContext (or .currentClassLoader)*/
1074 mov 8(%esp),%ebx /*pos of return adress */
1075 add FrameSize(%eax),%ebx
1076 add $4,%ebx /*adress of new return adress (out of Securitymanager.*/
1080 /* by now we have skipped this method call and the one before (SecurityManager)*/
1082 getClassContext_next:
1085 movl %eax,(%esp) /*return adress*/
1090 je getClassContext_storeNextRetPrevWasNat
1092 add FrameSize(%eax),%ebx
1094 mov %ebx,8(%esp) /*store adress of next return adress*/
1095 getClassContext_nextRetStored:
1097 mov MethodPointer(%eax),%ecx /*get struct methodinfo*/
1100 je getClassContext_nativeCall
1101 /*save class pointer*/
1103 getClassContext_saveClassPointer:
1104 movl 20(%esp),%ebx /*get temporary memory adress in stack*/
1105 movl offclassmethodinfo(%ecx),%edx /* get class pointer of method*/
1106 movl %edx,(%ebx) /*save */
1107 sub $4,%ebx /*calculate next position */
1108 movl %ebx,20(%esp) /* check if the new adress would overwrite our working data */
1110 je getClassContext_incStack
1111 getClassContext_checkLeave:
1113 cmp 12(%esp),%ecx /*check if we reached the toplevel method of our thread*/
1114 je getClassContext_leave /*yes ->leave*/
1117 call temporaryGetClassContextHelper
1120 jmp getClassContext_next /*continue*/
1122 getClassContext_storeNextRetPrevWasNat:
1124 add $(offaddrreturnfromnative-offreturnfromnative),%ebx
1126 add FrameSize(%eax),%ebx
1128 movl %ebx,8(%esp) /*store adress of next return adress*/
1129 jmp getClassContext_nextRetStored
1131 getClassContext_nativeCall:
1135 addl $offreturnfromnative,%ebx
1136 /*offreturnfromnative(%eax)+returnFromNativeoffset,%ebx*/
1138 movl offmethodnative(%eax),%ecx
1139 movl offprevnative(%eax),%edx
1141 jmp getClassContext_saveClassPointer
1143 getClassContext_incStack:
1144 /*make another 64 kb in our temporary storage free and store the workingdata */
1146 subl $40,%esp /*should be 32*/
1158 jmp getClassContext_checkLeave /* continue */
1160 getClassContext_leave:
1162 call temporaryGetClassContextHelper
1164 /*call collector function with begin/end of temporary classarray*/
1173 /* free stack memory of this function*/
1179 * These are local overrides for various environment variables in Emacs.
1180 * Please do not remove this and leave it at the end of the file, where
1181 * Emacs will automagically detect them.
1182 * ---------------------------------------------------------------------
1185 * indent-tabs-mode: t