1 /* vm/global.h - global definitions
3 Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
4 R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
5 C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
6 Institut f. Computersprachen - TU Wien
8 This file is part of CACAO.
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.
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.
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
25 Contact: cacao@complang.tuwien.ac.at
27 Authors: Reinhard Grafl
35 $Id: global.h 2018 2005-03-09 11:53:25Z twisti $
46 /* additional data types ******************************************************/
48 typedef void *voidptr; /* generic pointer */
49 typedef void (*functionptr) (void); /* generic function pointer */
51 typedef int bool; /* boolean data type */
57 /* include some data structures ***********************************************/
62 /* resolve typedef cycles *****************************************************/
64 typedef struct java_objectheader java_objectheader;
65 typedef struct classinfo classinfo;
66 typedef struct _vftbl vftbl_t;
67 typedef u1* methodptr;
68 typedef struct fieldinfo fieldinfo;
69 typedef struct exceptiontable exceptiontable;
70 typedef struct methodinfo methodinfo;
71 typedef struct lineinfo lineinfo;
72 typedef struct arraydescriptor arraydescriptor;
75 /* additional includes ********************************************************/
77 #include "toolbox/list.h"
78 #include "vm/jit/inline/sets.h"
81 /* define some cacao paths ****************************************************/
83 #define CACAO_JRE_DIR "/jre"
84 #define CACAO_LIBRARY_PATH "/jre/lib/"ARCH_DIR"/"
85 #define CACAO_RT_JAR_PATH "/jre/lib/rt.jar"
86 #define CACAO_EXT_DIR "/jre/lib/ext"
90 * SIZE_FROM_CLASSINFO toggles between the bitmap_based and the new method
91 * of determining the sizes of objects on the heap.
93 #define SIZE_FROM_CLASSINFO
96 * CACAO_TYPECHECK activates typechecking (part of bytecode verification)
98 #define CACAO_TYPECHECK
101 * TYPECHECK_STACK_COMPCAT activates full checking of computational
102 * categories for stack manipulations (POP,POP2,SWAP,DUP,DUP2,DUP_X1,
103 * DUP2_X1,DUP_X2,DUP2_X2).
105 #define TYPECHECK_STACK_COMPCAT
108 * Macros for configuration of the typechecking code
110 * TYPECHECK_STATISTICS activates gathering statistical information.
111 * TYPEINFO_DEBUG activates debug checks and debug helpers in typeinfo.c
112 * TYPECHECK_DEBUG activates debug checks in typecheck.c
113 * TYPEINFO_DEBUG_TEST activates the typeinfo test at startup.
114 * TYPECHECK_VERBOSE_IMPORTANT activates important debug messages
115 * TYPECHECK_VERBOSE activates all debug messages
117 #ifdef CACAO_TYPECHECK
118 /*#define TYPECHECK_STATISTICS
119 #define TYPEINFO_DEBUG
120 #define TYPECHECK_DEBUG
121 #define TYPEINFO_DEBUG_TEST
122 #define TYPECHECK_VERBOSE
123 #define TYPECHECK_VERBOSE_IMPORTANT*/
124 #if defined(TYPECHECK_VERBOSE) || defined(TYPECHECK_VERBOSE_IMPORTANT)
125 #define TYPECHECK_VERBOSE_OPT
130 /* if we have threads disabled this one is not defined ************************/
132 #if !defined(USE_THREADS)
133 #define THREADSPECIFIC
137 /* immediate data union */
150 #define PRIMITIVETYPE_COUNT 9 /* number of primitive types */
152 /* CAUTION: Don't change the numerical values! These constants are
153 * used as indices into the primitive type table.
155 #define PRIMITIVETYPE_INT 0
156 #define PRIMITIVETYPE_LONG 1
157 #define PRIMITIVETYPE_FLOAT 2
158 #define PRIMITIVETYPE_DOUBLE 3
159 #define PRIMITIVETYPE_BYTE 4
160 #define PRIMITIVETYPE_CHAR 5
161 #define PRIMITIVETYPE_SHORT 6
162 #define PRIMITIVETYPE_BOOLEAN 7
163 #define PRIMITIVETYPE_VOID 8
166 #define MAX_ALIGN 8 /* most generic alignment for JavaVM values */
169 /* basic data types ***********************************************************/
171 /* CAUTION: jit/jit.h relies on these numerical values! */
172 #define TYPE_INT 0 /* the JavaVM types must numbered in the */
173 #define TYPE_LONG 1 /* same order as the ICMD_Ixxx to ICMD_Axxx */
174 #define TYPE_FLOAT 2 /* instructions (LOAD and STORE) */
175 #define TYPE_DOUBLE 3 /* integer, long, float, double, address */
176 #define TYPE_ADDRESS 4 /* all other types can be numbered arbitrarly */
181 /* Java class file constants **************************************************/
183 #define MAGIC 0xCAFEBABE
184 #define MAJOR_VERSION 48
185 #define MINOR_VERSION 0
187 #define CONSTANT_Class 7
188 #define CONSTANT_Fieldref 9
189 #define CONSTANT_Methodref 10
190 #define CONSTANT_InterfaceMethodref 11
191 #define CONSTANT_String 8
192 #define CONSTANT_Integer 3
193 #define CONSTANT_Float 4
194 #define CONSTANT_Long 5
195 #define CONSTANT_Double 6
196 #define CONSTANT_NameAndType 12
197 #define CONSTANT_Utf8 1
199 #define CONSTANT_UNUSED 0
201 #define ACC_PUBLIC 0x0001
202 #define ACC_PRIVATE 0x0002
203 #define ACC_PROTECTED 0x0004
204 #define ACC_STATIC 0x0008
205 #define ACC_FINAL 0x0010
206 #define ACC_SUPER 0x0020
207 #define ACC_SYNCHRONIZED 0x0020
208 #define ACC_VOLATILE 0x0040
209 #define ACC_TRANSIENT 0x0080
210 #define ACC_NATIVE 0x0100
211 #define ACC_INTERFACE 0x0200
212 #define ACC_ABSTRACT 0x0400
213 #define ACC_STRICT 0x0800
216 /* constant pool entries *******************************************************
218 All constant pool entries need a data structure which contain the entrys
219 value. In some cases this structure exist already, in the remaining cases
220 this structure must be generated:
222 kind structure generated?
223 ----------------------------------------------------------------------
224 CONSTANT_Class classinfo no
225 CONSTANT_Fieldref constant_FMIref yes
226 CONSTANT_Methodref constant_FMIref yes
227 CONSTANT_InterfaceMethodref constant_FMIref yes
228 CONSTANT_String unicode no
229 CONSTANT_Integer constant_integer yes
230 CONSTANT_Float constant_float yes
231 CONSTANT_Long constant_long yes
232 CONSTANT_Double constant_double yes
233 CONSTANT_NameAndType constant_nameandtype yes
234 CONSTANT_Utf8 unicode no
237 *******************************************************************************/
239 /* data structure for storing information needed for a stacktrace across native functions*/
241 typedef struct native_stackframeinfo native_stackframeinfo;
243 struct native_stackframeinfo {
244 void *oldThreadspecificHeadValue;
245 void **addressOfThreadspecificHead;
250 void *beginOfJavaStackframe; /*only used if != 0*/
251 void *returnToFromNative;
254 void *returnFromNative;
255 void *addrReturnFromNative;
257 struct native_stackframeinfo *next;
258 struct native_stackframeinfo *prev;
263 typedef struct stacktraceelement stacktraceelement;
265 struct stacktraceelement {
275 typedef struct stackTraceBuffer stackTraceBuffer;
277 struct stackTraceBuffer {
279 stacktraceelement *start;
286 /* data structure for calls from c code to java methods */
288 struct jni_callblock {
293 typedef struct jni_callblock jni_callblock;
296 /* data structures of remaining constant pool entries *************************/
298 typedef struct { /* Fieldref, Methodref and InterfaceMethodref */
299 classinfo *class; /* class containing this field/method/interface */
300 utf *name; /* field/method/interface name */
301 utf *descriptor; /* field/method/interface type descriptor string */
305 typedef struct { /* Integer */
310 typedef struct { /* Float */
315 typedef struct { /* Long */
320 typedef struct { /* Double */
325 typedef struct { /* NameAndType (Field or Method) */
326 utf *name; /* field/method name */
327 utf *descriptor; /* field/method type descriptor string */
328 } constant_nameandtype;
331 /* data structures of the runtime system **************************************/
333 /* objects *********************************************************************
335 All objects (and arrays) which resides on the heap need the following
336 header at the beginning of the data structure.
339 struct java_objectheader { /* header for all objects */
340 vftbl_t *vftbl; /* pointer to virtual function table */
341 #if defined(USE_THREADS) && defined(NATIVE_THREADS)
348 /* arrays **********************************************************************
350 All arrays are objects (they need the object header with a pointer
351 to a vftbl (array class table). There is one class for each array
352 type. The array type is described by an arraydescriptor struct
353 which is referenced by the vftbl.
356 /* CAUTION: Don't change the numerical values! These constants (with
357 * the exception of ARRAYTYPE_OBJECT) are used as indices in the
358 * primitive type table.
360 #define ARRAYTYPE_INT PRIMITIVETYPE_INT
361 #define ARRAYTYPE_LONG PRIMITIVETYPE_LONG
362 #define ARRAYTYPE_FLOAT PRIMITIVETYPE_FLOAT
363 #define ARRAYTYPE_DOUBLE PRIMITIVETYPE_DOUBLE
364 #define ARRAYTYPE_BYTE PRIMITIVETYPE_BYTE
365 #define ARRAYTYPE_CHAR PRIMITIVETYPE_CHAR
366 #define ARRAYTYPE_SHORT PRIMITIVETYPE_SHORT
367 #define ARRAYTYPE_BOOLEAN PRIMITIVETYPE_BOOLEAN
368 #define ARRAYTYPE_OBJECT PRIMITIVETYPE_VOID /* don't use as index! */
370 typedef struct java_arrayheader { /* header for all arrays */
371 java_objectheader objheader; /* object header */
372 s4 size; /* array size */
373 #ifdef SIZE_FROM_CLASSINFO
374 s4 alignedsize; /* phil */
380 /* structs for all kinds of arrays ********************************************/
382 typedef struct java_chararray {
383 java_arrayheader header;
387 typedef struct java_floatheader {
388 java_arrayheader header;
392 typedef struct java_doublearray {
393 java_arrayheader header;
397 /* booleanarray and bytearray need identical memory layout (access methods
398 use the same machine code */
400 typedef struct java_booleanarray {
401 java_arrayheader header;
405 typedef struct java_bytearray {
406 java_arrayheader header;
410 typedef struct java_shortarray {
411 java_arrayheader header;
415 typedef struct java_intarray {
416 java_arrayheader header;
420 typedef struct java_longarray {
421 java_arrayheader header;
425 /* objectarray and arrayarray need identical memory layout (access methods
426 use the same machine code */
428 typedef struct java_objectarray {
429 java_arrayheader header;
430 java_objectheader *data[1];
434 /* structure for primitive classes ********************************************/
436 typedef struct primitivetypeinfo {
437 classinfo *class_wrap; /* class for wrapping primitive type */
438 classinfo *class_primitive; /* primitive class */
439 char *wrapname; /* name of class for wrapping */
440 char typesig; /* one character type signature */
441 char *name; /* name of primitive class */
442 char *arrayname; /* name of primitive array class */
443 classinfo *arrayclass; /* primitive array class */
444 vftbl_t *arrayvftbl; /* vftbl of primitive array class */
448 /* field, method and class structures *****************************************/
450 typedef struct xtafldinfo {
452 classinfo *fldClassType;
453 classSet *XTAclassSet; /* field class type set */
457 /* fieldinfo ******************************************************************/
459 struct fieldinfo { /* field of a class */
460 s4 flags; /* ACC flags */
461 s4 type; /* basic data type */
462 utf *name; /* name of field */
463 utf *descriptor; /* JavaVM descriptor string of field */
465 s4 offset; /* offset from start of object (instance variables) */
467 imm_union value; /* storage for static values (class variables) */
469 classinfo *class; /* needed by typechecker. Could be optimized */
470 /* away by using constant_FMIref instead of */
471 /* fieldinfo throughout the compiler. */
477 /* exceptiontable *************************************************************/
479 struct exceptiontable { /* exceptiontable entry in a method */
480 s4 startpc; /* start pc of guarded area (inclusive) */
481 struct basicblock *start;
483 s4 endpc; /* end pc of guarded area (exklusive) */
484 struct basicblock *end;
486 s4 handlerpc; /* pc of exception handler */
487 struct basicblock *handler;
489 classinfo *catchtype; /* catchtype of exception (NULL == catchall) */
490 exceptiontable *next; /* used to build a list of exception when */
491 /* loops are copied */
492 exceptiontable *down; /* instead of the old array, a list is used */
496 /* methodinfo static info ****************************************************/
498 typedef struct xtainfo {
499 s4 XTAmethodUsed; /* XTA if used in callgraph - not used /used */
500 classSet *XTAclassSet; /* method class type set */
501 /*classSet *PartClassSet */ /* method class type set */
503 classSetNode *paramClassSet; /* cone set of methods parameters */
505 /* Needed for interative checking */
506 methSet *calls; /* Edges - methods this method calls */
507 methSet *calledBy; /* Edges - methods that call this method */
509 fldSet *fldsUsed; /* fields used by this method */
510 /*methSetNode *interfaceCalls*/ /* methods this method calls as interface */
511 bool chgdSinceLastParse; /* Changed since last parse ? */
515 /* lineinfo *****************************************************************/
523 /* methodinfo *****************************************************************/
525 struct methodinfo { /* method structure */
526 java_objectheader header; /* we need this in jit's monitorenter */
527 s4 flags; /* ACC flags */
528 utf *name; /* name of method */
529 utf *descriptor; /* JavaVM descriptor string of method */
530 s4 returntype; /* only temporary valid, return type */
531 classinfo *returnclass; /* pointer to classinfo for the rtn type */ /*XTA*/
532 s4 paramcount; /* only temporary valid, parameter count */
533 u1 *paramtypes; /* only temporary valid, parameter types */
534 classinfo **paramclass; /* pointer to classinfo for a parameter */ /*XTA*/
536 bool isleafmethod; /* does method call subroutines */
538 classinfo *class; /* class, the method belongs to */
539 s4 vftblindex; /* index of method in virtual function */
540 /* table (if it is a virtual method) */
541 s4 maxstack; /* maximum stack depth of method */
542 s4 maxlocals; /* maximum number of local variables */
543 s4 jcodelength; /* length of JavaVM code */
544 u1 *jcode; /* pointer to JavaVM code */
546 s4 basicblockcount; /* number of basic blocks */
547 struct basicblock *basicblocks; /* points to basic block array */
548 s4 *basicblockindex; /* a table which contains for every byte */
549 /* of JavaVM code a basic block index if */
550 /* at this byte is the start of a basic */
553 s4 instructioncount; /* number of JavaVM instructions */
554 struct instruction *instructions; /* points to intermediate code instructions */
556 s4 stackcount; /* number of stack elements */
557 struct stackelement *stack; /* points to intermediate code instructions */
559 s4 exceptiontablelength;/* exceptiontable length */
560 exceptiontable *exceptiontable; /* the exceptiontable */
562 u2 thrownexceptionscount;/* number of exceptions attribute */
563 classinfo **thrownexceptions; /* checked exceptions a method may throw */
565 u2 linenumbercount; /* number of linenumber attributes */
566 lineinfo *linenumbers; /* array of lineinfo items */
568 int c_debug_nr; /* a counter to number all BB with an */
571 u1 *stubroutine; /* stub for compiling or calling natives */
572 s4 mcodelength; /* legth of generated machine code */
573 functionptr mcode; /* pointer to machine code */
574 functionptr entrypoint; /* entry point in machine code */
579 bool methodXTAparsed; /* true if xta parsed */
580 s4 methodUsed; /* marked (might be used later) /not used /used */
581 s4 monoPoly; /* call is mono or poly or unknown */ /*RT stats */
582 /* should # method def'd and used be kept after static parse (will it be used?) */
585 s4 nativelyoverloaded; /* used in header.c and only valid there */
586 /* helper for lsra */
591 /* innerclassinfo *************************************************************/
593 typedef struct innerclassinfo {
594 classinfo *inner_class; /* inner class pointer */
595 classinfo *outer_class; /* outer class pointer */
596 utf *name; /* innerclass name */
597 s4 flags; /* ACC flags */
601 /* classinfo ******************************************************************/
603 struct classinfo { /* class structure */
604 java_objectheader header; /* classes are also objects */
605 java_objectarray* signers;
606 struct java_security_ProtectionDomain* pd;
607 struct java_lang_VMClass* vmClass;
608 struct java_lang_reflect_Constructor* constructor;
610 s4 initializing_thread; /* gnu classpath */
611 s4 erroneous_state; /* gnu classpath */
612 struct gnu_classpath_RawData* vmData; /* gnu classpath */
614 s4 flags; /* ACC flags */
615 utf *name; /* class name */
617 s4 cpcount; /* number of entries in constant pool */
618 u1 *cptags; /* constant pool tags */
619 voidptr *cpinfos; /* pointer to constant pool info structures */
621 classinfo *super; /* super class pointer */
622 classinfo *sub; /* sub class pointer */
623 classinfo *nextsub; /* pointer to next class in sub class list */
625 s4 interfacescount; /* number of interfaces */
626 classinfo **interfaces; /* pointer to interfaces */
628 s4 fieldscount; /* number of fields */
629 fieldinfo *fields; /* field table */
631 s4 methodscount; /* number of methods */
632 methodinfo *methods; /* method table */
634 listnode listnode; /* linkage */
636 bool initialized; /* true, if class already initialized */
637 bool initializing; /* flag for the compiler */
638 bool loaded; /* true, if class already loaded */
639 bool linked; /* true, if class already linked */
640 s4 index; /* hierarchy depth (classes) or index */
642 s4 instancesize; /* size of an instance of this class */
643 #ifdef SIZE_FROM_CLASSINFO
644 s4 alignedsize; /* size of an instance, aligned to the */
645 /* allocation size on the heap */
648 vftbl_t *vftbl; /* pointer to virtual function table */
650 methodinfo *finalizer; /* finalizer method */
652 u2 innerclasscount; /* number of inner classes */
653 innerclassinfo *innerclass;
655 classinfo *hashlink; /* link for external hash chain */
656 bool classvftbl; /* has its own copy of the Class vtbl */
658 s4 classUsed; /* 0= not used 1 = used CO-RT */
660 classSetNode *impldBy; /* interface class implemented by class set */
661 /* Object class 's impldBy is list of all */
662 /* interface classes used (RT & XTA only */
663 /* normally no list of interfaces used) */
664 utf *packagename; /* full name of the package */
665 utf *sourcefile; /* classfile name containing this class */
666 java_objectheader *classloader; /* NULL for bootstrap classloader */
669 /* check if class is an array class. Only use for linked classes! */
670 #define CLASS_IS_ARRAY(clsinfo) ((clsinfo)->vftbl->arraydesc != NULL)
673 /* virtual function table ******************************************************
675 The vtbl has a bidirectional layout with open ends at both sides.
676 interfacetablelength gives the number of entries of the interface table at
677 the start of the vftbl. The vftbl pointer points to &interfacetable[0].
678 vftbllength gives the number of entries of table at the end of the vftbl.
680 runtime type check (checkcast):
682 Different methods are used for runtime type check depending on the
683 argument of checkcast/instanceof.
685 A check against a class is implemented via relative numbering on the class
686 hierachy tree. The tree is numbered in a depth first traversal setting
687 the base field and the diff field. The diff field gets the result of
688 (high - base) so that a range check can be implemented by an unsigned
689 compare. A sub type test is done by checking the inclusion of base of
690 the sub class in the range of the superclass.
692 A check against an interface is implemented via the interfacevftbl. If the
693 interfacevftbl contains a nonnull value a class is a subclass of this
698 Like standard virtual methods interface methods are called using
699 virtual function tables. All interfaces are numbered sequentially
700 (starting with zero). For each class there exist an interface table
701 of virtual function tables for each implemented interface. The length
702 of the interface table is determined by the highest number of an
703 implemented interface.
705 The following example assumes a class which implements interface 0 and 3:
707 interfacetablelength = 4
710 +-----------+ | method 2 |---> method z
711 | class | | method 1 |---> method y
712 +-----------+ | method 0 |---> method x
713 | ivftbl 0 |----------> +----------+
714 vftblptr ---> +-----------+
715 | ivftbl -1 |--> NULL +----------+
716 | ivftbl -2 |--> NULL | method 1 |---> method x
717 | ivftbl -3 |-----+ | method 0 |---> method a
718 +-----------+ +----> +----------+
725 interfacevftbllength ---> +---------------+
727 *******************************************************************************/
730 methodptr *interfacetable[1]; /* interface table (access via macro) */
732 classinfo *class; /* class, the vtbl belongs to */
734 arraydescriptor *arraydesc; /* for array classes, otherwise NULL */
736 s4 vftbllength; /* virtual function table length */
737 s4 interfacetablelength; /* interface table length */
739 s4 baseval; /* base for runtime type check */
740 /* (-index for interfaces) */
741 s4 diffval; /* high - base for runtime type check */
743 s4 *interfacevftbllength; /* length of interface vftbls */
745 methodptr table[1]; /* class vftbl */
748 #define VFTBLINTERFACETABLE(v,i) (v)->interfacetable[-i]
751 /* arraydescriptor ************************************************************
753 For every array class an arraydescriptor is allocated which
754 describes the array class.
755 The arraydescriptor is referenced from the vftbl of the array
758 *******************************************************************************/
760 struct arraydescriptor {
761 vftbl_t *componentvftbl; /* vftbl of the component type, NULL for primit. */
762 vftbl_t *elementvftbl; /* vftbl of the element type, NULL for primitive */
763 s2 arraytype; /* ARRAYTYPE_* constant */
764 s2 dimension; /* dimension of the array (always >= 1) */
765 s4 dataoffset; /* offset of the array data from object pointer */
766 s4 componentsize; /* size of a component in bytes */
767 s2 elementtype; /* ARRAYTYPE_* constant */
771 /* flag variables *************************************************************/
773 extern bool cacao_initializing;
775 #ifdef TYPECHECK_VERBOSE_OPT
776 extern bool typecheckverbose;
779 /*extern int pClassHeir;*/
780 /*extern int pCallgraph;*/
781 /*extern int pOpcodes;*/
782 /*extern int pStats;*/
784 /*extern void RT_jit_parse(methodinfo *m);*/
787 /* table of primitive types ***************************************************/
789 /* This array can be indexed by the PRIMITIVETYPE_ and ARRAYTYPE_
790 * constants (except ARRAYTYPE_OBJECT).
792 extern primitivetypeinfo primitivetype_table[PRIMITIVETYPE_COUNT];
795 /* macros for descriptor parsing **********************************************/
797 /* SKIP_FIELDDESCRIPTOR:
798 * utf_ptr must point to the first character of a field descriptor.
799 * After the macro call utf_ptr points to the first character after
800 * the field descriptor.
802 * CAUTION: This macro does not check for an unexpected end of the
803 * descriptor. Better use SKIP_FIELDDESCRIPTOR_SAFE.
805 #define SKIP_FIELDDESCRIPTOR(utf_ptr) \
806 do { while (*(utf_ptr)=='[') (utf_ptr)++; \
807 if (*(utf_ptr)++=='L') \
808 while(*(utf_ptr)++ != ';') /* skip */; } while(0)
810 /* SKIP_FIELDDESCRIPTOR_SAFE:
811 * utf_ptr must point to the first character of a field descriptor.
812 * After the macro call utf_ptr points to the first character after
813 * the field descriptor.
816 * utf_ptr....points to first char of descriptor
817 * end_ptr....points to first char after the end of the string
818 * errorflag..must be initialized (to false) by the caller!
820 * utf_ptr....points to first char after the descriptor
821 * errorflag..set to true if the string ended unexpectedly
823 #define SKIP_FIELDDESCRIPTOR_SAFE(utf_ptr,end_ptr,errorflag) \
824 do { while ((utf_ptr) != (end_ptr) && *(utf_ptr)=='[') (utf_ptr)++; \
825 if ((utf_ptr) == (end_ptr)) \
826 (errorflag) = true; \
828 if (*(utf_ptr)++=='L') { \
829 while((utf_ptr) != (end_ptr) && *(utf_ptr)++ != ';') \
831 if ((utf_ptr)[-1] != ';') \
832 (errorflag) = true; }} while(0)
835 /* Synchronization ************************************************************/
837 #if defined(USE_THREADS) && defined(NATIVE_THREADS)
840 void compiler_lock();
841 void compiler_unlock();
845 /**** Methods: called directly by cacao, which defines the callpath ***/
846 #define MAINCLASS mainstring
847 #define MAINMETH "main"
848 #define MAINDESC "([Ljava/lang/String;)V"
850 #define EXITCLASS "java/lang/System"
851 #define EXITMETH "exit"
852 #define EXITDESC "(I)V"
854 #if defined(USE_THREADS)
855 #define THREADCLASS "java/lang/Thread"
856 #define THREADMETH "<init>"
857 #define THREADDESC "(Ljava/lang/VMThread;Ljava/lang/String;IZ)V"
859 #define THREADGROUPCLASS "java/lang/ThreadGroup"
860 #define THREADGROUPMETH "addThread"
861 #define THREADGROUPDESC "(Ljava/lang/Thread;)V"
864 #endif /* _GLOBAL_H */
868 * These are local overrides for various environment variables in Emacs.
869 * Please do not remove this and leave it at the end of the file, where
870 * Emacs will automagically detect them.
871 * ---------------------------------------------------------------------
874 * indent-tabs-mode: t