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