rta 10-2003
[cacao.git] / src / vm / global.h
1 /* global.h ********************************************************************
2
3         Copyright (c) 1997 A. Krall, R. Grafl, M. Gschwind, M. Probst
4
5         See file COPYRIGHT for information on usage and disclaimer of warranties
6
7         Contains global definitions which are used in the whole program, includes
8         some files and contains global used macros.
9
10         Authors: Reinhard Grafl              EMAIL: cacao@complang.tuwien.ac.at
11                  Andreas  Krall   (andi)     EMAIL: cacao@complang.tuwien.ac.at
12         Changes: Mark     Probst  (schani)   EMAIL: cacao@complang.tuwien.ac.at
13                          Philipp  Tomsich (phil)     EMAIL: cacao@complang.tuwien.ac.at
14
15         Last Change: $Id: global.h 468 2003-10-04 17:15:31Z carolyn $
16
17 *******************************************************************************/
18
19 #ifndef __global_h_
20 #define __global_h_
21
22 #include "config.h"
23
24 #define NEW_GC              /* if enabled, includes the new gc. -- phil.      */
25
26 #define STATISTICS          /* if enabled collects program statistics         */
27
28 /* 
29  * JIT_MARKER_SUPPORT is the define used to toggle Just-in-time generated
30  * marker functions on and off.
31  *
32  * SIZE_FROM_CLASSINFO toggles between the bitmap_based and the new method 
33  * of determining the sizes of objects on the heap.
34  */
35 #undef JIT_MARKER_SUPPORT        /* phil */
36 #define SIZE_FROM_CLASSINFO
37
38 /* standard includes **********************************************************/
39
40 #include <stdio.h>
41 #include <stdlib.h>
42 #include <string.h>
43 #include <time.h>
44
45 #include "toolbox/memory.h"
46 #include "toolbox/chain.h"
47 #include "toolbox/list.h"
48 #include "toolbox/loging.h"
49
50 /* system dependent types *****************************************************/
51
52 #include "types.h"
53
54
55 /* additional data types ******************************************************/
56
57 typedef void *voidptr;          /* generic pointer */
58
59 typedef int   bool;             /* boolean data type */
60
61 #define true  1
62 #define false 0
63
64 #define PRIMITIVETYPE_COUNT  9  /* number of primitive types */
65
66 typedef void (*functionptr) (); /* generic function pointer */
67
68
69 #define MAX_ALIGN 8             /* most generic alignment for JavaVM values   */
70
71 /* shutdown function **********************************************************/
72
73 void cacao_shutdown(s4 status);
74
75
76 /* basic data types ***********************************************************/
77
78 #define TYPE_INT      0         /* the JavaVM types must numbered in the      */
79 #define TYPE_LONG     1         /* same order as the ICMD_Ixxx to ICMD_Axxx   */
80 #define TYPE_FLOAT    2         /* instructions (LOAD and STORE)              */
81 #define TYPE_DOUBLE   3         /* integer, long, float, double, address      */
82 #define TYPE_ADDRESS  4         /* all other types can be numbered arbitrarly */
83
84 #define TYPE_VOID    10
85
86
87 /* Java class file constants **************************************************/
88
89 #define MAGIC         0xcafebabe
90 #define MINOR_VERSION 3
91 #define MAJOR_VERSION 45
92
93 #define CONSTANT_Class                 7
94 #define CONSTANT_Fieldref              9
95 #define CONSTANT_Methodref            10
96 #define CONSTANT_InterfaceMethodref   11
97 #define CONSTANT_String                8
98 #define CONSTANT_Integer               3
99 #define CONSTANT_Float                 4
100 #define CONSTANT_Long                  5
101 #define CONSTANT_Double                6
102 #define CONSTANT_NameAndType          12
103 #define CONSTANT_Utf8                  1
104
105 #define CONSTANT_Arraydescriptor      13
106 #define CONSTANT_UNUSED                0
107
108 #define ACC_PUBLIC                0x0001
109 #define ACC_PRIVATE               0x0002
110 #define ACC_PROTECTED             0x0004
111 #define ACC_STATIC                0x0008
112 #define ACC_FINAL                 0x0010
113 #define ACC_SYNCHRONIZED          0x0020
114 #define ACC_VOLATILE              0x0040
115 #define ACC_TRANSIENT             0x0080
116 #define ACC_NATIVE                0x0100
117 #define ACC_INTERFACE             0x0200
118 #define ACC_ABSTRACT              0x0400
119
120
121 /* resolve typedef cycles *****************************************************/
122
123 typedef struct utf utf;
124 typedef struct literalstring literalstring;
125 typedef struct java_objectheader java_objectheader; 
126 typedef struct classinfo classinfo; 
127 typedef struct vftbl vftbl;
128 typedef u1* methodptr;
129 typedef struct fieldinfo  fieldinfo; 
130 typedef struct methodinfo methodinfo; 
131
132
133 /* constant pool entries *******************************************************
134
135         All constant pool entries need a data structure which contain the entrys
136         value. In some cases this structure exist already, in the remaining cases
137         this structure must be generated:
138
139                 kind                      structure                     generated?
140         ----------------------------------------------------------------------
141     CONSTANT_Class               classinfo                           no
142     CONSTANT_Fieldref            constant_FMIref                    yes
143     CONSTANT_Methodref           constant_FMIref                    yes
144     CONSTANT_InterfaceMethodref  constant_FMIref                    yes
145     CONSTANT_String              unicode                             no
146     CONSTANT_Integer             constant_integer                   yes
147     CONSTANT_Float               constant_float                     yes
148     CONSTANT_Long                constant_long                      yes
149     CONSTANT_Double              constant_double                    yes
150     CONSTANT_NameAndType         constant_nameandtype               yes
151     CONSTANT_Utf8                unicode                             no
152     CONSTANT_Arraydescriptor     constant_arraydescriptor           yes
153     CONSTANT_UNUSED              -
154
155 *******************************************************************************/
156
157 /* data structures for hashtables ********************************************
158
159
160         All utf-symbols, javastrings and classes are stored in global hashtables,
161         so every symbol exists only once. Equal symbols have identical pointers.
162         The functions for adding hashtable elements search the table for the 
163         element with the specified name/text and return it on success. Otherwise a 
164         new hashtable element is created.
165
166     The hashtables use external linking for handling collisions. The hashtable 
167         structure contains a pointer <ptr> to the array of hashtable slots. The 
168         number of hashtable slots and therefore the size of this array is specified 
169         by the element <size> of hashtable structure. <entries> contains the number
170         of all hashtable elements stored in the table, including those in the 
171         external chains.
172         The hashtable element structures (utf, literalstring, classinfo) contain
173         both a pointer to the next hashtable element as a link for the external hash 
174         chain and the key of the element. The key is computed from the text of
175         the string or the classname by using up to 8 characters.
176         
177         If the number of entries in the hashtable exceeds twice the size of the 
178         hashtableslot-array it is supposed that the average length of the 
179         external chains has reached a value beyond 2. Therefore the functions for
180         adding hashtable elements (utf_new, class_new, literalstring_new) double
181         the hashtableslot-array. In this restructuring process all elements have
182         to be inserted into the new hashtable and new external chains must be built.
183
184
185 example for the layout of a hashtable:
186
187 hashtable.ptr-->  +-------------------+
188                   |                   |
189                            ...
190                   |                   |
191                   +-------------------+   +-------------------+   +-------------------+
192                   | hashtable element |-->| hashtable element |-->| hashtable element |-->NULL
193                   +-------------------+   +-------------------+   +-------------------+
194                   | hashtable element |
195                   +-------------------+   +-------------------+   
196                   | hashtable element |-->| hashtable element |-->NULL
197                   +-------------------+   +-------------------+   
198                   | hashtable element |-->NULL
199                   +-------------------+
200                   |                   |
201                            ...
202                   |                   |
203                   +-------------------+
204
205 */
206
207
208 /* data structure for utf8 symbols ********************************************/
209
210 struct utf {
211         utf        *hashlink;       /* link for external hash chain               */
212         int         blength;        /* text length in bytes                       */           
213         char       *text;           /* pointer to text                            */
214 };
215
216 /* data structure of internal javastrings stored in global hashtable **********/
217
218 struct literalstring {
219         literalstring     *hashlink;     /* link for external hash chain          */
220         java_objectheader *string;  
221 };
222
223 /* data structure for accessing hashtables ************************************/
224
225 typedef struct {            
226   u4 size;
227   u4 entries;        /* number of entries in the table */
228   void **ptr;        /* pointer to hashtable */
229 } hashtable;
230
231 /* data structures of remaining constant pool entries *************************/
232
233 typedef struct {                /* Fieldref, Methodref and InterfaceMethodref     */
234         classinfo *class;       /* class containing this field/method/interface   */
235         utf       *name;        /* field/method/interface name                    */
236         utf       *descriptor;  /* field/method/interface type descriptor string  */
237 } constant_FMIref;
238
239 typedef struct {            /* Integer                                        */
240         s4 value;
241 } constant_integer;
242         
243 typedef struct {            /* Float                                          */
244         float value;
245 } constant_float;
246
247 typedef struct {            /* Long                                           */
248         s8 value;
249 } constant_long;
250         
251 typedef struct {            /* Double                                         */
252         double value;
253 } constant_double;
254
255 typedef struct {            /* NameAndType (Field or Method)                  */
256         utf *name;              /* field/method name                              */
257         utf *descriptor;        /* field/method type descriptor string            */
258 } constant_nameandtype;
259
260 /*  arraydescriptor describes array types. Basic array types contain their
261         type in the arraytype field, objectclass contains a class pointer for
262         arrays of objects (arraytype == ARRAYTYPE_OBJECT), elementdescriptor
263         contains a pointer to an arraydescriptor which describes the element
264         types in the case of arrays of arrays (arraytype == ARRAYTYPE_ARRAY).
265 */
266
267 typedef struct constant_arraydescriptor {
268         int arraytype;
269         classinfo *objectclass;
270         struct constant_arraydescriptor *elementdescriptor;
271 } constant_arraydescriptor;
272
273 #include "jit/sets.h"
274
275 /* data structures of the runtime system **************************************/
276
277 /* objects *********************************************************************
278
279         All objects (and arrays) which resides on the heap need the following
280         header at the beginning of the data structure.
281 */
282
283 struct java_objectheader {              /* header for all objects             */
284         vftbl *vftbl;                       /* pointer to virtual function table  */
285 };
286
287
288
289 /* arrays **********************************************************************
290
291         All arrays are objects (they need the object header with a pointer to a
292         vvftbl (array class table). There is only one class for all arrays. The
293         type of an array is stored directly in the array object. Following types
294         are defined:
295 */
296
297 #define ARRAYTYPE_INT      0
298 #define ARRAYTYPE_LONG     1
299 #define ARRAYTYPE_FLOAT    2
300 #define ARRAYTYPE_DOUBLE   3
301 #define ARRAYTYPE_BYTE     4
302 #define ARRAYTYPE_CHAR     5
303 #define ARRAYTYPE_SHORT    6
304 #define ARRAYTYPE_BOOLEAN  7
305 #define ARRAYTYPE_OBJECT   8
306 #define ARRAYTYPE_ARRAY    9
307
308 typedef struct java_arrayheader {       /* header for all arrays              */
309         java_objectheader objheader;        /* object header                      */
310         s4 size;                            /* array size                         */
311 #ifdef SIZE_FROM_CLASSINFO
312         s4 alignedsize; /* phil */
313 #endif
314         s4 arraytype;                       /* array type from previous list      */
315 } java_arrayheader;
316
317
318
319 /* structs for all kinds of arrays ********************************************/
320
321 typedef struct java_chararray {
322         java_arrayheader header;
323         u2 data[1];
324 } java_chararray;
325
326 typedef struct java_floatheader {
327         java_arrayheader header;
328         float data[1];
329 } java_floatarray;
330
331 typedef struct java_doublearray {
332         java_arrayheader header;
333         double data[1];
334 } java_doublearray;
335
336 /*  booleanarray and bytearray need identical memory layout (access methods
337     use the same machine code */
338
339 typedef struct java_booleanarray {
340         java_arrayheader header;
341         u1 data[1];
342 } java_booleanarray;
343
344 typedef struct java_bytearray {
345         java_arrayheader header;
346         s1 data[1];
347 } java_bytearray;
348
349 typedef struct java_shortarray {
350         java_arrayheader header;
351         s2 data[1];
352 } java_shortarray;
353
354 typedef struct java_intarray {
355         java_arrayheader header;
356         s4 data[1];
357 } java_intarray;
358
359 typedef struct java_longarray {
360         java_arrayheader header;
361         s8 data[1];
362 } java_longarray;
363
364 /*  objectarray and arrayarray need identical memory layout (access methods
365     use the same machine code */
366
367 typedef struct java_objectarray {
368         java_arrayheader header;
369         classinfo *elementtype;
370         java_objectheader *data[1];
371 } java_objectarray;
372
373 typedef struct java_arrayarray {
374         java_arrayheader header;
375         constant_arraydescriptor *elementdescriptor;
376         java_arrayheader *data[1];
377 } java_arrayarray;
378
379
380 /* structure for primitive classes ********************************************/
381
382 typedef struct primitivetypeinfo {
383         classinfo *class_wrap;               /* class for wrapping primitive type */
384         classinfo *class_primitive;          /* primitive class                   */
385         char *wrapname;                      /* name of class for wrapping        */
386         char typesig;                        /* one character type signature      */
387         char *name;                          /* name of primitive class           */
388 } primitivetypeinfo;
389
390 /* field, method and class structures *****************************************/
391
392 /* fieldinfo ******************************************************************/
393
394 struct fieldinfo {            /* field of a class                                 */
395         s4       flags;       /* ACC flags                                        */
396         s4       type;        /* basic data type                                  */
397         utf *name;            /* name of field                                    */
398         utf *descriptor;      /* JavaVM descriptor string of field                */
399         
400         s4       offset;      /* offset from start of object (instance variables) */
401
402         union {               /* storage for static values (class variables)      */
403                 s4 i; 
404                 s8 l;
405                 float f;
406                 double d;
407                 void *a; 
408         } value;
409         
410         /*--- XTA ---*/ 
411         s4         fieldUsed;           /* initialized to NOTUSED; set to USED when type checked */ 
412         bool       fieldChecked;                
413         classinfo *fldClassType;
414         classSet  *XTAclassSet;      /* field class type set                  */  
415         s4        lastRoundChgd;
416         /*--- VTA ---*/ 
417         s4            VTAfieldUsed;             /* -1=marked (might be used) 0=not used 1=used */ 
418         classSetNode *VTAclassSet;      /* field class type set                  */  
419
420 } ;
421
422 struct basicblock;
423
424 /* exceptiontable *************************************************************/
425
426 typedef struct xtable { /* exceptiontable entry in a method           */ 
427         s4         startpc;         /* start pc of guarded area (inclusive)       */
428         struct basicblock *start;
429
430         s4         endpc;           /* end pc of guarded area (exklusive)         */
431         struct basicblock *end;
432
433         s4         handlerpc;       /* pc of exception handler                    */
434         struct basicblock *handler;
435
436         classinfo *catchtype;       /* catchtype of exception (NULL == catchall)  */
437         struct xtable *next;        /* used to build a list of exception when     */
438                                     /* loops are copied */
439         struct xtable *down;        /* instead of the old array, a list is used   */
440 } xtable;
441
442
443 typedef struct exceptiontable { /* exceptiontable entry in a method           */ 
444         s4         startpc;         /* start pc of guarded area (inclusive)       */
445         s4         endpc;           /* end pc of guarded area (exklusive)         */
446         s4         handlerpc;       /* pc of exception handler                    */
447         classinfo *catchtype;       /* catchtype of exception (NULL == catchall)  */
448 } exceptiontable;
449
450
451 /* methodinfo  static info ****************************************************/
452 /*typedef struct rtainfo {
453
454 } rtainfo; */
455 /* methodinfo *****************************************************************/
456
457 struct methodinfo {                     /* method structure                       */
458         s4             flags;           /* ACC flags                              */
459         utf       *name;                /* name of method                         */
460         utf       *descriptor;          /* JavaVM descriptor string of method     */
461         s4         returntype;          /* only temporary valid, return type      */
462         classinfo *returnclass;         /* pointer to classinfo for the rtn type  */ /*XTA*/ 
463         s4         paramcount;          /* only temporary valid, parameter count  */
464         u1        *paramtypes;          /* only temporary valid, parameter types  */
465         classinfo **paramclass;         /* pointer to classinfo for a parameter   */ /*XTA*/
466         
467         classinfo *class;               /* class, the method belongs to           */
468         s4         vftblindex;          /* index of method in virtual function table
469                                            (if it is a virtual method)            */
470         s4         maxstack;            /* maximum stack depth of method          */
471         s4         maxlocals;           /* maximum number of local variables      */
472         s4         jcodelength;         /* length of JavaVM code                  */
473         u1        *jcode;               /* pointer to JavaVM code                 */
474
475         s4         exceptiontablelength;/* exceptiontable length                  */
476         exceptiontable *exceptiontable; 
477                                     /* the exceptiontable                     */
478
479         u1        *stubroutine;         /* stub for compiling or calling natives  */    
480         s4         mcodelength;         /* legth of generated machine code        */
481         u1        *mcode;               /* pointer to machine code                */
482         u1        *entrypoint;          /* entry point in machine code            */
483
484         /*rtainfo   rta;*/
485         /*xtainfo   xta;*/
486
487         s4        methodUsed;           /* marked (might be used later) /not used /used */
488         s4        monoPoly;             /* call is mono or poly or unknown        */ /*RT stats */
489         /* should # method def'd and used be kept after static parse (will it be used?) */
490         s4        subRedefs;
491         s4        subRedefsUsed;
492         
493         /* --- XTA --- */
494         s4              XTAmethodUsed;  /* XTA if used in callgraph -    not used /used */
495         classSet        *XTAclassSet;      /* method class type set                 */ 
496         classSet        *PartClassSet;     /* method class type set                 */ 
497
498         classSetNode    *paramClassSet;     /* cone set of methods parameters       */
499
500         methSet         *calls;            /* methods this method calls             */ 
501         methSet         *calledBy;         /* methods that call this method         */ 
502         methSet         *marked;           /* methods that marked by this method    */ 
503         methSet         *markedBy;
504         fldSet          *fldsUsed;         /* fields used by this method             */ 
505         bool             chgdSinceLastParse; /* Changed since last parse ?          */
506
507         s4           lastRoundParsed;   /* Last round parsed                      */ 
508         methSetNode  *interfaceCalls;   /* methods this method calls as interface */ 
509         
510         /* --- VTA --- */
511         classSetNode  *VTAclassSet;      /* method class type set                  */  
512         methSetNode   *VTAcalls;         /* methods this method calls             */ 
513         classSetNode **VTAlocalSets;    /*VTA*/
514         classSetNode **VTAstackType;    /*VTA*/ 
515 };
516
517
518
519 /* innerclassinfo *************************************************************/
520
521 typedef struct innerclassinfo {
522         classinfo *inner_class;       /* inner class pointer                      */
523         classinfo *outer_class;       /* outer class pointer                      */
524         utf *name;                    /* innerclass name                          */ 
525         s4 flags;                     /* ACC flags                                */
526 } innerclassinfo;
527
528 /* classinfo ******************************************************************/
529
530 struct classinfo {                /* class structure                          */
531         java_objectheader header;     /* classes are also objects                 */
532
533         s4          flags;            /* ACC flags                                */
534         utf        *name;             /* class name                               */ 
535
536         s4          cpcount;          /* number of entries in constant pool       */
537         u1         *cptags;           /* constant pool tags                       */
538         voidptr    *cpinfos;          /* pointer to constant pool info structures */
539
540         classinfo  *super;            /* super class pointer                      */
541         classinfo  *sub;              /* sub class pointer                        */
542         classinfo  *nextsub;          /* pointer to next class in sub class list  */
543
544         s4          interfacescount;  /* number of interfaces                     */
545         classinfo **interfaces;       /* pointer to interfaces                    */
546
547         s4          fieldscount;      /* number of fields                         */
548         fieldinfo  *fields;           /* field table                              */
549
550         s4          methodscount;     /* number of methods                        */
551         methodinfo *methods;          /* method table                             */
552
553         listnode    listnode;         /* linkage                                  */
554
555         bool        initialized;      /* true, if class already initialised       */ 
556         bool        linked;           /* true, if class already linked            */
557         s4          index;            /* hierarchy depth (classes) or index
558                                          (interfaces)                             */ 
559         s4          instancesize;     /* size of an instance of this class        */
560 #ifdef SIZE_FROM_CLASSINFO
561         s4          alignedsize;      /* size of an instance, aligned to the 
562                                                       allocation size on the heap */
563 #endif
564
565         vftbl      *vftbl;            /* pointer to virtual function table        */
566
567         methodinfo *finalizer;        /* finalizer method                         */
568 #ifdef JIT_MARKER_SUPPORT
569         methodinfo *marker; 
570 #endif
571
572     u2             innerclasscount;   /* number of inner classes              */
573     innerclassinfo *innerclass;
574
575     classinfo      *hashlink;         /* link for external hash chain         */
576         bool        classvftbl;       /* has its own copy of the Class vtbl       */
577
578         s4          classUsed;        /* 0= not used 1 = used   CO-RT             */
579
580         classSetNode *impldBy;          /* implemented by class set */
581 };
582
583
584 /* virtual function table ******************************************************
585
586         The vtbl has a bidirectional layout with open ends at both sides.
587         interfacetablelength gives the number of entries of the interface table at
588         the start of the vftbl. The vftbl pointer points to &interfacetable[0].
589         vftbllength gives the number of entries of table at the end of the vftbl.
590
591         runtime type check (checkcast):
592
593         Different methods are used for runtime type check depending on the
594         argument of checkcast/instanceof.
595         
596         A check against a class is implemented via relative numbering on the class
597         hierachy tree. The tree is numbered in a depth first traversal setting
598         the base field and the diff field. The diff field gets the result of
599         (high - base) so that a range check can be implemented by an unsigned
600         compare. A sub type test is done by checking the inclusion of base of
601         the sub class in the range of the superclass.
602
603         A check against an interface is implemented via the interfacevftbl. If the
604         interfacevftbl contains a nonnull value a class is a subclass of this
605         interface.
606
607         interfacetable:
608
609         Like standard virtual methods interface methods are called using
610         virtual function tables. All interfaces are numbered sequentially
611         (starting with zero). For each class there exist an interface table
612         of virtual function tables for each implemented interface. The length
613         of the interface table is determined by the highest number of an
614         implemented interface.
615
616         The following example assumes a class which implements interface 0 and 3:
617
618         interfacetablelength = 4
619
620                   | ...       |            +----------+
621                       +-----------+            | method 2 |---> method z
622                       | class     |            | method 1 |---> method y
623                       +-----------+            | method 0 |---> method x
624                       | ivftbl  0 |----------> +----------+
625         vftblptr ---> +-----------+
626                   | ivftbl -1 |--> NULL    +----------+
627                   | ivftbl -2 |--> NULL    | method 1 |---> method x
628                   | ivftbl -3 |-----+      | method 0 |---> method a
629                   +-----------+     +----> +----------+
630      
631                               +---------------+
632                                   | length 3 = 2  |
633                                   | length 2 = 0  |
634                                   | length 1 = 0  |
635                                   | length 0 = 3  |
636         interfacevftbllength ---> +---------------+
637
638 *******************************************************************************/
639
640 struct vftbl {
641         methodptr   *interfacetable[1];    /* interface table (access via macro)  */
642
643         classinfo   *class;                /* class, the vtbl belongs to          */
644
645         s4           vftbllength;          /* virtual function table length       */
646         s4           interfacetablelength; /* interface table length              */
647
648         s4           baseval;              /* base for runtime type check         */
649         s4           diffval;              /* high - base for runtime type check  */
650
651         s4          *interfacevftbllength; /* length of interface vftbls          */
652         
653         methodptr    table[1];             /* class vftbl                         */
654 };
655
656 #define VFTBLINTERFACETABLE(v,i)       (v)->interfacetable[-i]
657
658
659 /* references to some system classes ******************************************/
660
661 extern classinfo *class_java_lang_Object;
662 extern classinfo *class_java_lang_String;
663 extern classinfo *class_java_lang_ClassCastException;
664 extern classinfo *class_java_lang_NullPointerException;
665 extern classinfo *class_java_lang_ArrayIndexOutOfBoundsException;
666 extern classinfo *class_java_lang_NegativeArraySizeException;
667 extern classinfo *class_java_lang_OutOfMemoryError;
668 extern classinfo *class_java_lang_ArithmeticException;
669 extern classinfo *class_java_lang_ArrayStoreException;
670 extern classinfo *class_java_lang_ThreadDeath;
671 extern classinfo *class_array;
672
673 /* instances of some system classes *******************************************/
674
675 extern java_objectheader *proto_java_lang_ClassCastException;
676 extern java_objectheader *proto_java_lang_NullPointerException;
677 extern java_objectheader *proto_java_lang_ArrayIndexOutOfBoundsException;
678 extern java_objectheader *proto_java_lang_NegativeArraySizeException;
679 extern java_objectheader *proto_java_lang_OutOfMemoryError;
680 extern java_objectheader *proto_java_lang_ArithmeticException;
681 extern java_objectheader *proto_java_lang_ArrayStoreException;
682 extern java_objectheader *proto_java_lang_ThreadDeath;
683
684
685 /* flag variables *************************************************************/
686
687 extern bool compileall;
688 extern bool runverbose;         
689 extern bool verbose;         
690 extern bool opt_rt;             /* Rapid Type Analysis for better inlining CO-RT*/
691 extern bool opt_xta;            /* X Type Analysis for better inlining    CO-XTA*/
692 extern bool opt_vta;            /* Variable Type Analysis for better inlining    CO-VTA*/
693
694 extern int pClassHeir;
695 extern int pCallgraph;
696 extern int pOpcodes;
697 extern int pStats;
698
699 extern void RT_jit_parse(methodinfo *m);
700 extern void printCallgraph ();
701 extern void printRThierarchyInfo(methodinfo *m);
702 extern void printObjectClassHeirarchy();
703
704 extern void XTA_jit_parse(methodinfo *m);
705
706 /* statistic variables ********************************************************/
707
708 extern int count_class_infos;
709 extern int count_const_pool_len;
710 extern int count_vftbl_len;
711 extern int count_utf_len;
712 extern int count_all_methods;
713 extern int count_vmcode_len;
714 extern int count_extable_len;
715 extern int count_class_loads;
716 extern int count_class_inits;
717 extern int count_utf_new;
718 extern int count_utf_new_found;
719
720 /* table of primitive types ***************************************************/
721
722 extern primitivetypeinfo primitivetype_table[PRIMITIVETYPE_COUNT];
723
724 #endif
725
726
727 /*
728  * These are local overrides for various environment variables in Emacs.
729  * Please do not remove this and leave it at the end of the file, where
730  * Emacs will automagically detect them.
731  * ---------------------------------------------------------------------
732  * Local variables:
733  * mode: c
734  * indent-tabs-mode: t
735  * c-basic-offset: 4
736  * tab-width: 4
737  * End:
738  */