Global compiler variables changes.
[cacao.git] / src / vm / jit / alpha / asmpart.S
1 /* jit/alpha/asmpart.S - Java-C interface functions for alpha
2
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,
7    J. Wenninger
8
9    This file is part of CACAO.
10
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.
15
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.
20
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
24    02111-1307, USA.
25
26    Contact: cacao@complang.tuwien.ac.at
27
28    Authors: Andreas Krall
29             Reinhard Grafl
30
31    $Id: asmpart.S 1218 2004-06-29 14:11:16Z twisti $
32
33 */
34
35
36 #include "config.h"        
37 #include "offsets.h"
38
39
40 #define         MethodPointer   -8
41 #define         FrameSize       -12
42 #define     IsSync          -16
43 #define     IsLeaf          -20
44 #define     IntSave         -24
45 #define     FltSave         -28
46 /* DEFINE LINE NUMBER STUFF HERE */
47 #define     ExTableSize     -56
48 #define     ExTableStart    -56
49
50 #define     ExEntrySize     -32
51 #define     ExStartPC       -8
52 #define     ExEndPC         -16
53 #define     ExHandlerPC     -24
54 #define     ExCatchType     -32
55
56
57 #define v0      $0
58
59 #define t0      $1
60 #define t1      $2
61 #define t2      $3
62 #define t3      $4
63 #define t4      $5
64 #define t5      $6
65 #define t6      $7
66 #define t7      $8
67
68 #define s0      $9
69 #define s1      $10
70 #define s2      $11
71 #define s3      $12
72 #define s4      $13
73 #define s5      $14
74 #define s6      $15
75
76 #define a0      $16
77 #define a1      $17
78 #define a2      $18
79 #define a3      $19
80 #define a4      $20
81 #define a5      $21
82
83 #define t8      $22
84 #define t9      $23
85 #define t10     $24
86 #define t11     $25
87 #define ra      $26
88 #define t12     $27
89
90 #define pv      t12
91 #define AT      $at
92 #define gp      $29
93 #define sp      $30
94 #define zero    $31
95
96 #define itmp1   $25
97 #define itmp2   $28
98 #define itmp3   $29
99
100 #define xptr    itmp1
101 #define xpc     itmp2
102
103 #define sf0     $f2
104 #define sf1     $f3
105 #define sf2     $f4
106 #define sf3     $f5
107 #define sf4     $f6
108 #define sf5     $f7
109 #define sf6     $f8
110 #define sf7     $f9
111
112 #define fzero   $f31
113
114
115 #define PAL_imb 134
116
117         .text
118         .set    noat
119         .set    noreorder
120
121
122 /********************* exported functions and variables ***********************/
123
124         .globl has_no_x_instr_set
125         .globl synchronize_caches
126         .globl asm_calljavafunction
127         .globl asm_calljavafunction2
128         .globl asm_calljavafunction2double
129         .globl asm_calljavafunction2long
130         .globl asm_call_jit_compiler
131         .globl asm_handle_exception
132         .globl asm_handle_nat_exception
133         .globl asm_check_clinit
134         .globl asm_builtin_checkcast    
135         .globl asm_builtin_checkarraycast
136         .globl asm_builtin_aastore
137         .globl asm_builtin_monitorenter
138         .globl asm_builtin_monitorexit
139         .globl asm_builtin_idiv
140         .globl asm_builtin_irem
141         .globl asm_builtin_ldiv
142         .globl asm_builtin_lrem
143         .globl asm_perform_threadswitch
144         .globl asm_initialize_thread_stack
145         .globl asm_switchstackandcall
146         .globl asm_getcallingmethod
147         .globl asm_builtin_trace
148         .globl asm_builtin_exittrace
149         .globl asm_criticalsections
150         .globl asm_getclassvalues_atomic
151
152 /*************************** imported functions *******************************/
153
154         .globl jit_compile
155         .globl builtin_monitorexit
156         .globl builtin_throw_exception
157         .globl builtin_trace_exception
158         .globl class_java_lang_Object
159
160
161 /*********************** function has_no_x_instr_set ***************************
162 *                                                                              *
163 *   determines if the byte support instruction set (21164a and higher)         *
164 *   is available.                                                              *
165 *                                                                              *
166 *******************************************************************************/
167
168         .ent    has_no_x_instr_set
169 has_no_x_instr_set:
170
171         .long   0x47e03c20                /* amask   1,v0                         */
172         jmp     zero,(ra)                 /* return                               */
173
174         .end    has_no_x_instr_set
175
176
177 /********************* function asm_calljavafunction ***************************
178 *                                                                              *
179 *   This function calls a Java-method (which possibly needs compilation)       *
180 *   with up to 4 address parameters.                                           *
181 *                                                                              *
182 *   This functions calls the JIT-compiler which eventually translates the      *
183 *   method into machine code.                                                  *
184 *                                                                              *
185 *   C-prototype:                                                               *
186 *    javaobject_header *asm_calljavafunction (methodinfo *m,                   *
187 *         void *arg1, void *arg2, void *arg3, void *arg4);                     *
188 *                                                                              *
189 *******************************************************************************/
190
191         .ent    asm_calljavafunction
192
193 call_name:
194         .ascii  "calljavafunction\0\0"
195
196         .align  2 /*3*/
197         .quad   0                         /* catch type all                       */
198         .quad   calljava_xhandler         /* handler pc                           */
199         .quad   calljava_xhandler         /* end pc                               */
200         .quad   asm_calljavafunction      /* start pc                             */
201         .long   1                         /* extable size                         */
202         .long   0                         /* PADDING */
203         .quad   0                         /* line number table start             */
204         .quad   0                         /* line number table size             */
205         .long   0                         /* PADDING */
206         .long   0                         /* fltsave */
207         .long   0                         /* intsave                              */
208         .long   0                         /* isleaf                               */
209         .long   0                         /* IsSync                               */
210         .long   32                        /* frame size                           */
211         .quad   0                         /* method pointer (pointer to name)     */
212
213 asm_calljavafunction:
214         ldgp    gp,0(pv)
215         lda     sp,-32(sp)                /* allocate stack space                 */
216         stq     gp,24(sp)                 /* save global pointer                  */
217         stq     ra,0(sp)                  /* save return address                  */
218
219         stq     a0,16(sp)                 /* save method pointer for compiler     */
220         lda     v0,16(sp)                 /* pass pointer to method pointer via v0*/
221
222         mov     a1,a0                     /* pass the remaining parameters        */
223         mov     a2,a1
224         mov     a3,a2
225         mov     a4,a3
226
227         lda     $28,asm_call_jit_compiler /* fake virtual function call (2 instr) */
228         stq     $28,8(sp)                 /* store function address               */
229         mov     sp,$28                    /* set method pointer                   */
230
231         ldq     pv,8($28)                 /* method call as in Java               */
232         jmp     ra,(pv)                   /* call JIT compiler                    */
233 calljava_jit:
234         lda     pv,-64(ra)                /* asm_calljavafunction-calljava_jit !!!!!*/
235
236 calljava_return:
237         ldq     ra,0(sp)                  /* restore return address               */
238         ldq     gp,24(sp)                 /* restore global pointer               */
239         lda     sp,32(sp)                 /* free stack space                     */
240
241 calljava_ret:
242         jmp     zero,(ra)
243
244 calljava_xhandler:
245         ldq     gp,24(sp)                 /* restore global pointer               */
246         mov     itmp1,a0
247         jsr     ra,builtin_throw_exception
248         ldq     ra,0(sp)                  /* restore return address               */
249         lda     sp,32(sp)                 /* free stack space                     */
250         jmp     zero,(ra)
251         .end    asm_calljavafunction
252
253
254
255
256         .ent    asm_calljavafunction2
257
258 call_name2:
259         .ascii  "calljavafunction2\0\0"
260
261         .align  3
262         .quad   0                         /* catch type all                       */
263         .quad   calljava_xhandler2        /* handler pc                           */
264         .quad   calljava_xhandler2        /* end pc                               */
265         .quad   asm_calljavafunction2     /* start pc                             */
266         .long   1                         /* extable size                         */
267         .long   0                         /* PADDING */
268         .quad   0                         /* line number table start             */
269         .quad   0                         /* line number table size             */
270         .long   0                         /* PADDING */
271         .long   0                         /* fltsave                              */
272         .long   1                         /* intsave                              */
273         .long   0                         /* isleaf                               */
274         .long   0                         /* IsSync                               */
275         .long   40                        /* frame size                           */
276         .quad   0                         /* method pointer (pointer to name)     */
277
278 asm_calljavafunction2:
279 asm_calljavafunction2double:
280 asm_calljavafunction2long:
281         ldgp    gp,0(pv)
282         lda     sp,-40(sp)                /* allocate stack space                 */
283         stq     ra,0(sp)                  /* save return address                  */
284         stq     s6,24(sp)
285         stq     gp,8(sp)                  /* save global pointer                  */
286
287         stq     a0,32(sp)                 /* save method pointer for compiler     */
288         mov     a3,t0                     /* pointer to arg block                 */
289         mov     a1,s6                     /* arg count                            */
290
291         ble     s6,calljava_argsloaded
292         lda     s6,-1(s6)
293         ldq     a0,offjniitem(t0)
294         ldt     $f16,offjniitem(t0)
295         ble     s6,calljava_argsloaded
296         lda     s6,-1(s6)
297         ldq     a1,offjniitem+sizejniblock*1(t0)
298         ldt     $f17,offjniitem+sizejniblock*1(t0)
299         ble     s6,calljava_argsloaded
300         lda     s6,-1(s6)
301         ldq     a2,offjniitem+sizejniblock*2(t0)
302         ldt     $f18,offjniitem+sizejniblock*2(t0)
303         ble     s6,calljava_argsloaded
304         lda     s6,-1(s6)
305         ldq     a3,offjniitem+sizejniblock*3(t0)
306         ldt     $f19,offjniitem+sizejniblock*3(t0)
307         ble     s6,calljava_argsloaded
308         lda     s6,-1(s6)
309         ldq     a4,offjniitem+sizejniblock*4(t0)
310         ldt     $f20,offjniitem+sizejniblock*4(t0)
311         ble     s6,calljava_argsloaded
312         lda     s6,-1(s6)
313         ldq     a5,offjniitem+sizejniblock*5(t0)
314         ldt     $f21,offjniitem+sizejniblock*5(t0)
315 calljava_argsloaded:
316         mov     sp,t4
317         ble     s6,calljava_nocopy
318         negq    s6,t1
319         s8addq  t1,sp,sp
320         s8addq  t1,t4,t2
321
322 calljava_copyloop:
323         ldq     t3,offjniitem+sizejniblock*6(t0)
324         stq     t3,0(t2)
325         lda     t1,1(t1)
326         lda     t0,sizejniblock(t0)
327         lda     t2,8(t2)
328         bne     t1,calljava_copyloop
329
330 calljava_nocopy:
331         lda     v0,32(t4)                 /* pass pointer to method pointer via v0*/
332
333         lda     $28,asm_call_jit_compiler /* fake virtual function call (2 instr) */
334         stq     $28,16(t4)                /* store function address               */
335         lda     $28,8(t4)                 /* set method pointer                   */
336
337         ldq     pv,8($28)                 /* method call as in Java               */
338         jmp     ra,(pv)                   /* call JIT compiler                    */
339 calljava_jit2:
340         lda     pv,-200(ra)               /* asm_calljavafunction-calljava_jit !!!*/
341
342         s8addq  s6,sp,sp
343 calljava_return2:
344         ldq     ra,0(sp)                  /* restore return address               */
345         ldq     gp,8(sp)                  /* restore global pointer               */
346         ldq     s6,24(sp)
347         lda     sp,40(sp)                 /* free stack space                     */
348
349 calljava_ret2:
350         jmp     zero,(ra)
351
352 calljava_xhandler2:
353         s8addq  s6,sp,sp
354         ldq     gp,8(sp)                  /* restore global pointer               */
355         mov     itmp1,a0
356         jsr     ra,builtin_throw_exception
357         ldq     ra,0(sp)                  /* restore return address               */
358         ldq     s6,24(sp)
359         lda     sp,40(sp)                 /* free stack space                     */
360         jmp     zero,(ra)
361         .end    asm_calljavafunction2
362                                                 
363
364 /****************** function asm_call_jit_compiler *****************************
365 *                                                                              *
366 *   invokes the compiler for untranslated JavaVM methods.                      *
367 *                                                                              *
368 *   Register R0 contains a pointer to the method info structure (prepared      *
369 *   by createcompilerstub). Using the return address in R26 and the            *
370 *   offset in the LDA instruction or using the value in methodptr R28 the      *
371 *   patching address for storing the method address can be computed:           *
372 *                                                                              *
373 *   method address was either loaded using                                     *
374 *   M_LDQ (REG_PV, REG_PV, a)        ; invokestatic/special    ($27)           *
375 *   M_LDA (REG_PV, REG_RA, low)                                                *
376 *   M_LDAH(REG_PV, REG_RA, high)     ; optional                                *
377 *   or                                                                         *
378 *   M_LDQ (REG_PV, REG_METHODPTR, m) ; invokevirtual/interface ($28)           *
379 *   in the static case the method pointer can be computed using the            *
380 *   return address and the lda function following the jmp instruction          *
381 *                                                                              *
382 *******************************************************************************/
383
384
385         .ent    asm_call_jit_compiler
386 asm_call_jit_compiler:
387
388         ldgp    gp,0(pv)
389         ldl     t8,-8(ra)             /* load instruction LDQ PV,xxx($yy)         */
390         srl     t8,16,t8              /* shift right register number $yy          */
391         and     t8,31,t8              /* isolate register number                  */
392         subl    t8,28,t8              /* test for REG_METHODPTR                   */
393         beq     t8,noregchange       
394         ldl     t8,0(ra)              /* load instruction LDA PV,xxx(RA)          */
395         sll     t8,48,t8
396         sra     t8,48,t8              /* isolate offset                           */
397         addq    t8,ra,$28             /* compute update address                   */
398         ldl     t8,4(ra)              /* load instruction LDAH PV,xxx(PV)         */
399         srl     t8,16,t8              /* isolate instruction code                 */
400         lda     t8,-0x177b(t8)        /* test for LDAH                            */
401         bne     t8,noregchange       
402         ldl     t8,4(ra)              /* load instruction LDAH PV,xxx(PV)         */
403         sll     t8,16,t8              /* compute high offset                      */
404         addl    t8,0,t8               /* sign extend high offset                  */
405         addq    t8,$28,$28            /* compute update address                   */
406 noregchange:
407         lda     sp,-14*8(sp)          /* reserve stack space                      */
408         stq     a0,0*8(sp)            /* save all argument registers              */
409         stq     a1,1*8(sp)            /* they could be used by method             */
410         stq     a2,2*8(sp)
411         stq     a3,3*8(sp)
412         stq     a4,4*8(sp)
413         stq     a5,5*8(sp)
414         stt     $f16,6*8(sp)
415         stt     $f17,7*8(sp)
416         stt     $f18,8*8(sp)
417         stt     $f19,9*8(sp)
418         stt     $f20,10*8(sp)
419         stt     $f21,11*8(sp)
420         stq     $28,12*8(sp)          /* save method pointer                      */
421         stq     ra,13*8(sp)           /* save return address                      */
422
423         ldq     a0,0(v0)              /* pass 'methodinfo' pointer to             */
424         jsr     ra,jit_compile        /* jit compiler                             */
425         ldgp    gp,0(ra)
426
427         call_pal PAL_imb              /* synchronise instruction cache            */
428
429         ldq     a0,0*8(sp)            /* load argument registers                  */
430         ldq     a1,1*8(sp)
431         ldq     a2,2*8(sp)
432         ldq     a3,3*8(sp)
433         ldq     a4,4*8(sp)
434         ldq     a5,5*8(sp)
435         ldt     $f16,6*8(sp)
436         ldt     $f17,7*8(sp)
437         ldt     $f18,8*8(sp)
438         ldt     $f19,9*8(sp)
439         ldt     $f20,10*8(sp)
440         ldt     $f21,11*8(sp)
441         ldq     $28,12*8(sp)          /* load method pointer                      */
442         ldq     ra,13*8(sp)           /* load return address                      */
443         lda     sp,14*8(sp)           /* deallocate stack area                    */
444
445         ldl     t8,-8(ra)             /* load instruction LDQ PV,xxx($yy)         */
446         sll     t8,48,t8
447         sra     t8,48,t8              /* isolate offset                           */
448
449         addq    t8,$28,t8             /* compute update address via method pointer*/
450         stq     v0,0(t8)              /* save new method address there            */
451
452         mov     v0,pv                 /* load method address into pv              */
453
454         jmp     zero,(pv)             /* and call method. The method returns      */
455                                       /* directly to the caller (ra).             */
456
457         .end    asm_call_jit_compiler
458
459
460 /********************* function asm_handle_exception ***************************
461 *                                                                              *
462 *   This function handles an exception. It does not use the usual calling      *
463 *   conventions. The exception pointer is passed in REG_ITMP1 and the          *
464 *   pc from the exception raising position is passed in REG_ITMP2. It searches *
465 *   the local exception table for a handler. If no one is found, it unwinds    *
466 *   stacks and continues searching the callers.                                *
467 *                                                                              *
468 *   void asm_handle_exception (exceptionptr, exceptionpc);                     *
469 *                                                                              *
470 *******************************************************************************/
471
472         .ent    asm_handle_nat_exception
473 asm_handle_nat_exception:
474         ldl     t0,0(ra)              /* load instruction LDA PV,xxx(RA)          */
475         sll     t0,48,t0
476         sra     t0,48,t0              /* isolate offset                           */
477         addq    t0,ra,pv              /* compute update address                   */
478         ldl     t0,4(ra)              /* load instruction LDAH PV,xxx(PV)         */
479         srl     t0,16,t0              /* isolate instruction code                 */
480         lda     t0,-0x177b(t0)        /* test for LDAH                            */
481         bne     t0,asm_handle_exception       
482         ldl     t0,4(ra)              /* load instruction LDAH PV,xxx(PV)         */
483         sll     t0,16,t0              /* compute high offset                      */
484         addl    t0,0,t0               /* sign extend high offset                  */
485         addq    t0,pv,pv              /* compute update address                   */
486
487         .aent    asm_handle_exception
488 asm_handle_exception:
489         lda     sp,-18*8(sp)          /* allocate stack                           */
490         stq     t0,0*8(sp)            /* save possible used registers             */
491         stq     t1,1*8(sp)            /* also registers used by trace_exception   */
492         stq     t2,2*8(sp)
493         stq     t3,3*8(sp)
494         stq     t4,4*8(sp)
495         stq     t5,5*8(sp)
496         stq     t6,6*8(sp)
497         stq     t7,7*8(sp)
498         stq     t8,8*8(sp)
499         stq     t9,9*8(sp)
500         stq     t10,10*8(sp)
501         stq     v0,11*8(sp)
502         stq     a0,12*8(sp)
503         stq     a1,13*8(sp)
504         stq     a2,14*8(sp)
505         stq     a3,15*8(sp)
506         stq     a4,16*8(sp)
507         stq     a5,17*8(sp)
508
509         lda     t3,1(zero)            /* set no unwind flag                       */
510 ex_stack_loop:
511         lda     sp,-5*8(sp)           /* allocate stack                           */
512         stq     xptr,0*8(sp)          /* save used register                       */
513         stq     xpc,1*8(sp)
514         stq     pv,2*8(sp)
515         stq     ra,3*8(sp)
516         stq     t3,4*8(sp)
517
518         mov     xptr,a0
519         ldq     a1,MethodPointer(pv)
520         mov     xpc,a2
521 /*      mov     t3,a3 */
522         lda             a3,0(zero)
523         lda             a4,1(zero)
524         br      ra,ex_trace           /* set ra for gp loading                    */
525 ex_trace:
526         ldgp    gp,0(ra)              /* load gp                                  */
527         jsr     ra,builtin_trace_exception /* trace_exception(xptr,methodptr)     */
528         
529         ldq     xptr,0*8(sp)          /* restore used register                    */
530         ldq     xpc,1*8(sp)
531         ldq     pv,2*8(sp)
532         ldq     ra,3*8(sp)
533         ldq     t3,4*8(sp)
534         lda     sp,5*8(sp)            /* deallocate stack                         */
535         
536         ldl     t0,ExTableSize(pv)    /* t0 = exception table size                */
537         beq     t0,empty_table        /* if empty table skip                      */
538
539         lda     t1,ExTableStart(pv)   /* t1 = start of exception table            */
540
541 ex_table_loop:
542         ldq     t2,ExStartPC(t1)      /* t2 = exception start pc                  */
543         cmple   t2,xpc,t2             /* t2 = (startpc <= xpc)                    */
544         beq     t2,ex_table_cont      /* if (false) continue                      */
545         ldq     t2,ExEndPC(t1)        /* t2 = exception end pc                    */
546         cmplt   xpc,t2,t2             /* t2 = (xpc < endpc)                       */
547         beq     t2,ex_table_cont      /* if (false) continue                      */
548         ldq     a1,ExCatchType(t1)    /* arg1 = exception catch type              */
549         beq     a1,ex_handle_it       /* NULL catches everything                  */
550
551         ldl     itmp3,offclassloaded(a1)
552         bne     itmp3,L_class_loaded
553
554         subq    sp,8*8,sp             /* allocate stack                           */
555         stq     t0,0*8(sp)            /* save used register                       */
556         stq     t1,1*8(sp)
557         stq     t3,2*8(sp)
558         stq     xptr,3*8(sp)
559         stq     xpc,4*8(sp)
560         stq     pv,5*8(sp)
561         stq     ra,6*8(sp)
562         stq     a1,7*8(sp)
563
564         mov     a1,a0
565
566         br      ra,L_class_load_ra    /* set ra for gp loading                    */
567 L_class_load_ra:
568         ldgp    gp,0(ra)              /* load gp                                  */
569         jsr     ra,class_load         /* class_load(exceptionclass)               */
570
571         ldq     t0,0*8(sp)            /* restore used register                    */
572         ldq     t1,1*8(sp)
573         ldq     t3,2*8(sp)
574         ldq     xptr,3*8(sp)
575         ldq     xpc,4*8(sp)
576         ldq     pv,5*8(sp)
577         ldq     ra,6*8(sp)
578         ldq     a1,7*8(sp)
579         addq    sp,8*8,sp             /* deallocate stack                         */
580
581 L_class_loaded:
582         ldl     itmp3,offclasslinked(a1)
583         subq    sp,8*8,sp             /* allocate stack                           */
584         stq     a1,7*8(sp)
585         bne     itmp3,L_class_linked
586
587         stq     t0,0*8(sp)            /* save used register                       */
588         stq     t1,1*8(sp)
589         stq     t3,2*8(sp)
590         stq     xptr,3*8(sp)
591         stq     xpc,4*8(sp)
592         stq     pv,5*8(sp)
593         stq     ra,6*8(sp)
594
595         mov     a1,a0
596
597         br      ra,L_class_link_ra    /* set ra for gp loading                    */
598 L_class_link_ra:
599         ldgp    gp,0(ra)              /* load gp                                  */
600         jsr     ra,class_link         /* class_load(exceptionclass)               */
601
602         ldq     t0,0*8(sp)            /* restore used register                    */
603         ldq     t1,1*8(sp)
604         ldq     t3,2*8(sp)
605         ldq     xptr,3*8(sp)
606         ldq     xpc,4*8(sp)
607         ldq     pv,5*8(sp)
608         ldq     ra,6*8(sp)
609
610 L_class_linked:
611 _crit_restart1:
612         ldq     a1,7*8(sp)
613 _crit_begin1:
614         ldq     a0,offobjvftbl(xptr)  /* a0 = vftblptr(xptr)                      */
615         ldq     a1,offclassvftbl(a1)  /* a1 = vftblptr(catchtype) class (not obj) */
616         ldl     a0,offbaseval(a0)     /* a0 = baseval(xptr)                       */
617         ldl     v0,offbaseval(a1)     /* a2 = baseval(catchtype)                  */
618         ldl     a1,offdiffval(a1)     /* a1 = diffval(catchtype)                  */
619 _crit_end1:
620         subl    a0,v0,a0              /* a0 = baseval(xptr) - baseval(catchtype)  */
621         cmpule  a0,a1,v0              /* v0 = xptr is instanceof catchtype        */
622         addq    sp,8*8,sp             /* deallocate stack                         */
623         beq     v0,ex_table_cont      /* if (false) continue                      */
624
625 ex_handle_it:
626         ldq     xpc,ExHandlerPC(t1)   /* xpc = exception handler pc               */
627
628         beq     t3,ex_jump            /* if (!(no stack unwinding) skip           */
629
630         ldq     t0,0*8(sp)            /* restore possible used registers          */
631         ldq     t1,1*8(sp)            /* also registers used by trace_exception   */
632         ldq     t2,2*8(sp)
633         ldq     t3,3*8(sp)
634         ldq     t4,4*8(sp)
635         ldq     t5,5*8(sp)
636         ldq     t6,6*8(sp)
637         ldq     t7,7*8(sp)
638         ldq     t8,8*8(sp)
639         ldq     t9,9*8(sp)
640         ldq     t10,10*8(sp)
641         ldq     v0,11*8(sp)
642         ldq     a0,12*8(sp)
643         ldq     a1,13*8(sp)
644         ldq     a2,14*8(sp)
645         ldq     a3,15*8(sp)
646         ldq     a4,16*8(sp)
647         ldq     a5,17*8(sp)
648         lda     sp,18*8(sp)           /* deallocate stack                         */
649
650 ex_jump:
651         jmp     zero,(xpc)            /* jump to the handler                      */
652
653 ex_table_cont:
654         lda     t1,ExEntrySize(t1)    /* next exception table entry               */
655         subl    t0,1,t0               /* decrement entry counter                  */
656         bgt     t0,ex_table_loop      /* if (t0 > 0) next entry                   */
657
658 empty_table:
659         beq     t3,ex_already_cleared /* if here the first time, then             */
660         lda     sp,18*8(sp)           /* deallocate stack and                     */
661         clr     t3                    /* clear the no unwind flag                 */
662 ex_already_cleared:
663         ldl     t0,IsSync(pv)         /* t0 = SyncOffset                          */
664         beq     t0,no_monitor_exit    /* if zero no monitorexit                   */
665         addq    sp,t0,t0              /* add stackptr to Offset                   */
666         ldq     a0,-8(t0)             /* load monitorexit pointer                 */
667
668         lda     sp,-7*8(sp)           /* allocate stack                           */
669         stq     t0,0*8(sp)            /* save used register                       */
670         stq     t1,1*8(sp)
671         stq     t3,2*8(sp)
672         stq     xptr,3*8(sp)
673         stq     xpc,4*8(sp)
674         stq     pv,5*8(sp)
675         stq     ra,6*8(sp)
676
677         br      ra,ex_mon_load        /* set ra for gp loading                    */
678 ex_mon_load:
679         ldgp    gp,0(ra)              /* load gp                                  */
680         jsr     ra,builtin_monitorexit/* builtin_monitorexit(objectptr)           */
681         
682         ldq     t0,0*8(sp)            /* restore used register                    */
683         ldq     t1,1*8(sp)
684         ldq     t3,2*8(sp)
685         ldq     xptr,3*8(sp)
686         ldq     xpc,4*8(sp)
687         ldq     pv,5*8(sp)
688         ldq     ra,6*8(sp)
689         lda     sp,7*8(sp)            /* deallocate stack                         */
690
691 no_monitor_exit:
692         ldl     t0,FrameSize(pv)      /* t0 = frame size                          */
693         addq    sp,t0,sp              /* unwind stack                             */
694         mov     sp,t0                 /* t0 = pointer to save area                */
695         ldl     t1,IsLeaf(pv)         /* t1 = is leaf procedure                   */
696         bne     t1,ex_no_restore      /* if (leaf) skip                           */
697         ldq     ra,-8(t0)             /* restore ra                               */
698         lda     t0,-8(t0)             /* t0--                                     */
699 ex_no_restore:
700         mov     ra,xpc                /* the new xpc is ra                        */
701         ldl     t1,IntSave(pv)        /* t1 = saved int register count            */
702         br      t2,ex_int1            /* t2 = current pc                          */
703 ex_int1:
704         lda     t2,44(t2)             /* lda t2,ex_int2-ex_int1(t2) !!!!!!!!!!!!! */
705         negl    t1,t1                 /* negate register count                    */
706         s4addq  t1,t2,t2              /* t2 = ex_int_sav - 4 * register count     */
707         jmp     zero,(t2)             /* jump to save position                    */
708         ldq     s0,-56(t0)
709         ldq     s1,-48(t0)
710         ldq     s2,-40(t0)
711         ldq     s3,-32(t0)
712         ldq     s4,-24(t0)
713         ldq     s5,-16(t0)
714         ldq     s6,-8(t0)
715 ex_int2:
716         s8addq  t1,t0,t0              /* t0 = t0 - 8 * register count             */
717
718         ldl     t1,FltSave(pv)        /* t1 = saved flt register count            */
719         br      t2,ex_flt1            /* t2 = current pc                          */
720 ex_flt1:
721         lda     t2,48(t2)             /* lda t2,ex_flt2-ex_flt1(t2) !!!!!!!!!!!!! */
722         negl    t1,t1                 /* negate register count                    */
723         s4addq  t1,t2,t2              /* t2 = ex_flt_sav - 4 * register count     */
724         jmp     zero,(t2)             /* jump to save position                    */
725         ldt     $f2,-64(t0)
726         ldt     $f3,-56(t0)
727         ldt     $f4,-48(t0)
728         ldt     $f5,-40(t0)
729         ldt     $f6,-32(t0)
730         ldt     $f7,-24(t0)
731         ldt     $f8,-16(t0)
732         ldt     $f9,-8(t0)
733 ex_flt2:
734         ldl     t0,0(ra)              /* load instruction LDA PV,xxx(RA)          */
735         sll     t0,48,t0
736         sra     t0,48,t0              /* isolate offset                           */
737         addq    t0,ra,pv              /* compute update address                   */
738         ldl     t0,4(ra)              /* load instruction LDAH PV,xxx(PV)         */
739         srl     t0,16,t0              /* isolate instruction code                 */
740         lda     t0,-0x177b(t0)        /* test for LDAH                            */
741         bne     t0,ex_stack_loop       
742         ldl     t0,4(ra)              /* load instruction LDAH PV,xxx(RA)         */
743         sll     t0,16,t0              /* compute high offset                      */
744         addl    t0,0,t0               /* sign extend high offset                  */
745         addq    t0,pv,pv              /* compute update address                   */
746         br      ex_stack_loop
747
748         .end    asm_handle_nat_exception
749
750
751 /********************* asm_check_clinit ****************************************
752 *                                                                              *
753 *   Does null check and calls monitorenter or throws an exception              *
754 *                                                                              *
755 *******************************************************************************/
756                 
757     .ent    asm_check_clinit
758
759 asm_check_clinit:
760         ldgp    gp,0(pv)
761
762         ldl             itmp2,offclassinit(itmp1)
763         bne             itmp2,L_is_initialized
764         
765         subq    sp,7*8,sp
766         stq             ra,0*8(sp)
767         stq             a0,1*8(sp)            /* save argument registers for leaf         */
768         stq             a1,2*8(sp)            /* functions and native stub                */
769         stq             a2,3*8(sp)
770         stq             a3,4*8(sp)
771         stq             a4,5*8(sp)
772         stq             a5,6*8(sp)
773                 
774         mov             itmp1,a0
775         jsr             ra,class_init
776                 
777         ldgp    gp,0(ra)
778         ldq             ra,0*8(sp)
779         ldq             a0,1*8(sp)            /* restore argument registers               */
780         ldq             a1,2*8(sp)
781         ldq             a2,3*8(sp)
782         ldq             a3,4*8(sp)
783         ldq             a4,5*8(sp)
784         ldq             a5,6*8(sp)
785         addq    sp,7*8,sp
786
787         beq     v0,L_initializererror
788
789 L_is_initialized:
790         mov     ra,itmp1              /* now patch the calling code               */
791         subq    itmp1,(3*4),itmp1     /* go back 3 instructions                   */
792         ldah    itmp2,-15392(zero)    /* br -- 0xc3e0 == -15392                   */
793         lda     itmp2,4(itmp2)        /* jump over 4 instructions                 */
794         stl     itmp2,0(itmp1)        /* store the new branch: br +4              */
795
796         jmp             zero,(ra)
797
798 L_initializererror:
799 #if defined(USE_THREADS) && defined(NATIVE_THREADS)
800         subq    sp,1*8,sp
801         stq     ra,0*8(sp)
802         jsr     ra,builtin_asm_get_exceptionptrptr
803         ldq     ra,0*8(sp)
804         addq    sp,1*8,sp
805         ldq     xptr,0(v0)            /* get the exception pointer                */
806         stq     zero,0(v0)            /* clear the exception pointer              */
807 #else
808         lda     itmp3,_exceptionptr
809         ldq     xptr,0(itmp3)
810         stq     zero,0(itmp3)
811 #endif
812
813         subq    ra,4,xpc
814         br      asm_handle_nat_exception
815
816         .end    asm_check_clinit
817
818                 
819 /********************* function asm_builtin_monitorenter ***********************
820 *                                                                              *
821 *   Does null check and calls monitorenter or throws an exception              *
822 *                                                                              *
823 *******************************************************************************/
824
825         .ent    asm_builtin_monitorenter
826
827 asm_builtin_monitorenter:
828         ldgp    gp,0(pv)
829         lda     pv,builtin_monitorenter
830         beq     a0,nb_monitorenter        /* if (null) throw exception            */
831         jmp     zero,(pv)                 /* else call builtin_monitorenter       */
832
833 nb_monitorenter:
834         subq    sp,8,sp
835     stq     ra,0(sp)
836         ldq     a0,string_java_lang_NullPointerException
837     jsr     ra,new_exception
838     ldgp    gp,0(ra)
839         mov     v0,xptr
840     ldq     ra,0(sp)
841         addq    sp,8,sp
842         
843         lda     xpc,-4(ra)                /* faulting address is return adress - 4*/
844         br      asm_handle_nat_exception
845
846         .end    asm_builtin_monitorenter
847
848
849 /********************* function asm_builtin_monitorexit ************************
850 *                                                                              *
851 *   Does null check and calls monitorexit or throws an exception               *
852 *                                                                              *
853 *******************************************************************************/
854
855         .ent    asm_builtin_monitorexit
856
857 asm_builtin_monitorexit:
858         ldgp    gp,0(pv)
859         lda     pv,builtin_monitorexit
860         beq     a0,nb_monitorexit         /* if (null) throw exception            */
861         jmp     zero,(pv)                 /* else call builtin_monitorexit        */
862
863 nb_monitorexit:
864         subq    sp,8,sp
865     stq     ra,0(sp)
866         ldq     a0,string_java_lang_NullPointerException
867     jsr     ra,new_exception
868     ldgp    gp,0(ra)
869         mov     v0,xptr
870     ldq     ra,0(sp)
871         addq    sp,8,sp
872         
873         lda     xpc,-4(ra)                /* faulting address is return adress - 4*/
874         br      asm_handle_nat_exception
875
876         .end    asm_builtin_monitorexit
877
878
879 /************************ function asm_builtin_idiv ****************************
880 *                                                                              *
881 *   Does null check and calls idiv or throws an exception                      *
882 *                                                                              *
883 *******************************************************************************/
884
885         .ent    asm_builtin_idiv
886
887 asm_builtin_idiv:
888         ldgp    gp,0(pv)
889         lda     pv,builtin_idiv
890         beq     a1,nb_idiv                /* if (null) throw exception            */
891         jmp     zero,(pv)                 /* else call builtin_idiv               */
892
893 nb_idiv:
894         subq    sp,8,sp
895         stq     ra,0(sp)
896         ldq     a0,string_java_lang_ArithmeticException
897         ldq     a1,string_java_lang_ArithmeticException_message
898         jsr     ra,new_exception_message
899         ldgp    gp,0(ra)
900         mov     v0,xptr
901         ldq     ra,0(sp)
902         addq    sp,8,sp
903         
904         lda     xpc,-4(ra)                /* faulting address is return adress - 4*/
905         br      asm_handle_nat_exception
906
907         .end    asm_builtin_idiv
908
909
910 /************************ function asm_builtin_ldiv ****************************
911 *                                                                              *
912 *   Does null check and calls ldiv or throws an exception                      *
913 *                                                                              *
914 *******************************************************************************/
915
916         .ent    asm_builtin_ldiv
917
918 asm_builtin_ldiv:
919         ldgp    gp,0(pv)
920         lda     pv,builtin_ldiv
921         beq     a1,nb_ldiv                /* if (null) throw exception            */
922         jmp     zero,(pv)                 /* else call builtin_ldiv               */
923
924 nb_ldiv:
925         subq    sp,8,sp
926         stq     ra,0(sp)
927         ldq     a0,string_java_lang_ArithmeticException
928         ldq     a1,string_java_lang_ArithmeticException_message
929         jsr     ra,new_exception_message
930         ldgp    gp,0(ra)
931         mov     v0,xptr
932         ldq     ra,0(sp)
933         addq    sp,8,sp
934
935         lda     xpc,-4(ra)                /* faulting address is return adress - 4*/
936         br      asm_handle_nat_exception
937
938         .end    asm_builtin_ldiv
939
940
941 /************************ function asm_builtin_irem ****************************
942 *                                                                              *
943 *   Does null check and calls irem or throws an exception                      *
944 *                                                                              *
945 *******************************************************************************/
946
947         .ent    asm_builtin_irem
948
949 asm_builtin_irem:
950         ldgp    gp,0(pv)
951         lda     pv,builtin_irem
952         beq     a1,nb_irem                /* if (null) throw exception            */
953         jmp     zero,(pv)                 /* else call builtin_irem               */
954
955 nb_irem:
956         subq    sp,8,sp
957         stq     ra,0(sp)
958         ldq     a0,string_java_lang_ArithmeticException
959         ldq     a1,string_java_lang_ArithmeticException_message
960         jsr     ra,new_exception_message
961         ldgp    gp,0(ra)
962         mov     v0,xptr
963         ldq     ra,0(sp)
964         addq    sp,8,sp
965
966         lda     xpc,-4(ra)                /* faulting address is return adress - 4*/
967         br      asm_handle_nat_exception
968
969         .end    asm_builtin_irem
970
971
972 /************************ function asm_builtin_lrem ****************************
973 *                                                                              *
974 *   Does null check and calls lrem or throws an exception                      *
975 *                                                                              *
976 *******************************************************************************/
977
978         .ent    asm_builtin_lrem
979
980 asm_builtin_lrem:
981         ldgp    gp,0(pv)
982         lda     pv,builtin_lrem
983         beq     a1,nb_lrem                /* if (null) throw exception            */
984         jmp     zero,(pv)                 /* else call builtin_lrem               */
985
986 nb_lrem:
987         subq    sp,8,sp
988         stq     ra,0(sp)
989         ldq     a0,string_java_lang_ArithmeticException
990         ldq     a1,string_java_lang_ArithmeticException_message
991         jsr     ra,new_exception_message
992         ldgp    gp,0(ra)
993         mov     v0,xptr
994         ldq     ra,0(sp)
995         addq    sp,8,sp
996
997         lda     xpc,-4(ra)                /* faulting address is return adress - 4*/
998         br      asm_handle_nat_exception
999
1000         .end    asm_builtin_lrem
1001
1002
1003 /******************* function asm_builtin_checkarraycast ***********************
1004 *                                                                              *
1005 *   Does the cast check and eventually throws an exception                     *
1006 *                                                                              *
1007 *******************************************************************************/
1008
1009         .ent    asm_builtin_checkarraycast
1010
1011 asm_builtin_checkarraycast:
1012         ldgp    gp,0(pv)
1013         lda     sp,-16(sp)                /* allocate stack space                 */
1014         stq     ra,0(sp)                  /* save return address                  */
1015         stq     a0,8(sp)                  /* save object pointer                  */
1016         jsr     ra,builtin_checkarraycast /* builtin_checkarraycast               */
1017         ldgp    gp,0(ra)
1018         beq     v0,nb_carray_throw        /* if (false) throw exception           */
1019         ldq     ra,0(sp)                  /* restore return address               */
1020         ldq     v0,8(sp)                  /* return object pointer                */
1021         lda     sp,16(sp)                 /* free stack space                     */
1022         jmp     zero,(ra)
1023
1024 nb_carray_throw:
1025         ldq     a0,string_java_lang_ClassCastException
1026     jsr     ra,new_exception
1027     ldgp    gp,0(ra)
1028         mov     v0,xptr
1029
1030         ldq     ra,0(sp)                  /* restore return address               */
1031         lda     sp,16(sp)                 /* free stack space                     */
1032         lda     xpc,-4(ra)                /* faulting address is return adress - 4*/
1033         br      asm_handle_nat_exception
1034
1035         .end    asm_builtin_checkarraycast
1036
1037
1038 /******************* function asm_builtin_aastore ******************************
1039 *                                                                              *
1040 *   Does the cast check and eventually throws an exception                     *
1041 *                                                                              *
1042 *******************************************************************************/
1043
1044         .ent    asm_builtin_aastore
1045
1046 asm_builtin_aastore:
1047         ldgp    gp,0(pv)
1048         beq     a0,nb_aastore_null        /* if null pointer throw exception      */
1049         ldl     t0,offarraysize(a0)       /* load size                            */
1050         lda     sp,-24(sp)                /* allocate stack space                 */
1051         stq     ra,0(sp)                  /* save return address                  */
1052         s8addq  a1,a0,t1                  /* add index*8 to arrayref              */
1053         cmpult  a1,t0,t0                  /* do bound check                       */
1054         beq     t0,nb_aastore_bound       /* if out of bounds throw exception     */
1055         mov     a2,a1                     /* object is second argument            */
1056         stq     t1,8(sp)                  /* save store position                  */
1057         stq     a1,16(sp)                 /* save object                          */
1058         jsr     ra,builtin_canstore       /* builtin_canstore(arrayref,object)    */
1059         ldgp    gp,0(ra)
1060         ldq     ra,0(sp)                  /* restore return address               */
1061         ldq     a0,8(sp)                  /* restore store position               */
1062         ldq     a1,16(sp)                 /* restore object                       */
1063         lda     sp,24(sp)                 /* free stack space                     */
1064         beq     v0,nb_aastore_throw       /* if (false) throw exception           */
1065         stq     a1,offobjarrdata(a0)      /* store objectptr in array             */
1066         jmp     zero,(ra)
1067
1068 nb_aastore_null:        
1069         subq    sp,8,sp                   /* allocate stack space                 */
1070         stq     ra,0(sp)                  /* save return address                  */
1071         ldq     a0,string_java_lang_NullPointerException
1072     jsr     ra,new_exception
1073     ldgp    gp,0(ra)
1074         mov     v0,xptr
1075         ldq     ra,0(sp)
1076         addq    sp,8,sp
1077
1078         mov     ra,xpc                    /* faulting address is return adress    */
1079         br      asm_handle_nat_exception
1080
1081 nb_aastore_bound:
1082         ldq     a0,string_java_lang_ArrayIndexOutOfBoundsException
1083     jsr     ra,new_exception_int      /* a1 already contains the index        */
1084     ldgp    gp,0(ra)
1085         mov     v0,xptr
1086
1087         ldq     ra,0(sp)                  /* restore return address               */
1088         lda     sp,24(sp)                 /* free stack space                     */
1089         mov     ra,xpc                    /* faulting address is return adress    */
1090         br      asm_handle_nat_exception
1091
1092 nb_aastore_throw:
1093         subq    sp,8,sp                   /* allocate stack space                 */
1094         stq     ra,0(sp)                  /* save return address                  */
1095         ldq     a0,string_java_lang_ArrayStoreException
1096     jsr     ra,new_exception
1097     ldgp    gp,0(ra)
1098         mov     v0,xptr
1099         ldq     ra,0(sp)
1100         addq    sp,8,sp
1101
1102         mov     ra,xpc                    /* faulting address is return adress    */
1103         br      asm_handle_nat_exception
1104
1105         .end    asm_builtin_aastore
1106
1107
1108 /******************* function asm_initialize_thread_stack **********************
1109 *                                                                              *
1110 *   initialized a thread stack                                                 *
1111 *                                                                              *
1112 *******************************************************************************/
1113
1114         .ent    asm_initialize_thread_stack
1115
1116 asm_initialize_thread_stack:
1117         lda     a1,-128(a1)
1118         stq     zero, 0(a1)
1119         stq     zero, 8(a1)
1120         stq     zero, 16(a1)
1121         stq     zero, 24(a1)
1122         stq     zero, 32(a1)
1123         stq     zero, 40(a1)
1124         stq     zero, 48(a1)
1125         stt     fzero, 56(a1)
1126         stt     fzero, 64(a1)
1127         stt     fzero, 72(a1)
1128         stt     fzero, 80(a1)
1129         stt     fzero, 88(a1)
1130         stt     fzero, 96(a1)
1131         stt     fzero, 104(a1)
1132         stt     fzero, 112(a1)
1133         stq     a0, 120(a1)
1134         mov     a1, v0
1135         jmp     zero,(ra)
1136
1137         .end    asm_initialize_thread_stack
1138
1139
1140 /******************* function asm_perform_threadswitch *************************
1141 *                                                                              *
1142 *   void asm_perform_threadswitch (u1 **from, u1 **to, u1 **stackTop);         *
1143 *                                                                              *
1144 *   performs a threadswitch                                                    *
1145 *                                                                              *
1146 *******************************************************************************/
1147
1148         .ent    asm_perform_threadswitch
1149
1150 asm_perform_threadswitch:
1151         subq    sp,128,sp
1152         stq     s0, 0(sp)
1153         stq     s1, 8(sp)
1154         stq     s2, 16(sp)
1155         stq     s3, 24(sp)
1156         stq     s4, 32(sp)
1157         stq     s5, 40(sp)
1158         stq     s6, 48(sp)
1159         stt     sf0, 56(sp)
1160         stt     sf1, 64(sp)
1161         stt     sf2, 72(sp)
1162         stt     sf3, 80(sp)
1163         stt     sf4, 88(sp)
1164         stt     sf5, 96(sp)
1165         stt     sf6, 104(sp)
1166         stt     sf7, 112(sp)
1167         stq     ra, 120(sp)
1168         stq     sp, 0(a0)
1169         stq     sp, 0(a2)
1170         ldq     sp, 0(a1)
1171         ldq     s0, 0(sp)
1172         ldq     s1, 8(sp)
1173         ldq     s2, 16(sp)
1174         ldq     s3, 24(sp)
1175         ldq     s4, 32(sp)
1176         ldq     s5, 40(sp)
1177         ldq     s6, 48(sp)
1178         ldt     sf0, 56(sp)
1179         ldt     sf1, 64(sp)
1180         ldt     sf2, 72(sp)
1181         ldt     sf3, 80(sp)
1182         ldt     sf4, 88(sp)
1183         ldt     sf5, 96(sp)
1184         ldt     sf6, 104(sp)
1185         ldt     sf7, 112(sp)
1186         ldq     ra, 120(sp)
1187         mov     ra, pv
1188         addq    sp, 128, sp
1189         jmp     zero,(ra)
1190
1191         .end    asm_perform_threadswitch
1192
1193
1194 /********************* function asm_switchstackandcall *************************
1195 *                                                                              *
1196 *  void *asm_switchstackandcall (void *stack, void *func, void **stacktopsave, *
1197 *                               void *p);                                      *
1198 *                                                                              *
1199 *   Switches to a new stack, calls a function and switches back.               *
1200 *       a0      new stack pointer                                              *
1201 *       a1      function pointer                                               *
1202 *               a2              pointer to variable where stack top should be stored           *
1203 *               a3      pointer to user data, is passed to the function                *
1204 *                                                                              *
1205 *******************************************************************************/
1206
1207
1208         .ent    asm_switchstackandcall
1209
1210 asm_switchstackandcall:
1211         lda     a0,-2*8(a0)     /* allocate new stack                                 */
1212         stq     ra,0(a0)        /* save return address on new stack                   */
1213         stq     sp,1*8(a0)      /* save old stack pointer on new stack                */
1214         stq sp,0(a2)        /* save old stack pointer to variable                 */
1215         mov     a0,sp           /* switch to new stack                                */
1216         
1217         mov     a1,pv           /* load function pointer                              */
1218         mov a3,a0           /* pass pointer */
1219         jmp     ra,(pv)         /* and call function                                  */
1220
1221         ldq     ra,0(sp)        /* load return address                                */
1222         ldq     sp,1*8(sp)      /* switch to old stack                                */
1223
1224         jmp     zero,(ra)       /* return                                             */
1225
1226         .end    asm_switchstackandcall
1227
1228         .ent    asm_getclassvalues_atomic
1229
1230 asm_getclassvalues_atomic:
1231 _crit_restart2:
1232 _crit_begin2:
1233         ldl     t0,offbaseval(a0)
1234         ldl     t1,offdiffval(a0)
1235         ldl     t2,offbaseval(a1)
1236 _crit_end2:
1237         stl     t0,offcast_super_baseval(a2)
1238         stl     t1,offcast_super_diffval(a2)
1239         stl     t2,offcast_sub_baseval(a2)
1240         jmp      zero,(ra)
1241
1242         .end    asm_getclassvalues_atomic
1243
1244     .data
1245
1246 asm_criticalsections:
1247 #if defined(USE_THREADS) && defined(NATIVE_THREADS)
1248     .quad   _crit_begin1
1249     .quad   _crit_end1
1250     .quad   _crit_restart1
1251     .quad   _crit_begin2
1252     .quad   _crit_end2
1253     .quad   _crit_restart2
1254 #endif
1255     .quad   0
1256
1257
1258 /*
1259  * These are local overrides for various environment variables in Emacs.
1260  * Please do not remove this and leave it at the end of the file, where
1261  * Emacs will automagically detect them.
1262  * ---------------------------------------------------------------------
1263  * Local variables:
1264  * mode: asm
1265  * indent-tabs-mode: t
1266  * c-basic-offset: 4
1267  * tab-width: 4
1268  * End:
1269  */