1 /* global.h - global definitions
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
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
33 $Id: global.h 664 2003-11-21 18:24:01Z jowenn $
43 #include "toolbox/list.h"
48 #define STATISTICS /* if enabled collects program statistics */
51 * SIZE_FROM_CLASSINFO toggles between the bitmap_based and the new method
52 * of determining the sizes of objects on the heap.
54 #define SIZE_FROM_CLASSINFO
56 /* standard includes **********************************************************/
63 #include "toolbox/memory.h"
64 #include "toolbox/chain.h"
65 #include "toolbox/list.h"
66 #include "toolbox/loging.h"
68 /* system dependent types *****************************************************/
73 /* additional data types ******************************************************/
75 typedef void *voidptr; /* generic pointer */
77 typedef int bool; /* boolean data type */
82 #define PRIMITIVETYPE_COUNT 9 /* number of primitive types */
84 /* CAUTION: Don't change the numerical values! These constants are
85 * used as indices into the primitive type table.
87 #define PRIMITIVETYPE_INT 0
88 #define PRIMITIVETYPE_LONG 1
89 #define PRIMITIVETYPE_FLOAT 2
90 #define PRIMITIVETYPE_DOUBLE 3
91 #define PRIMITIVETYPE_BYTE 4
92 #define PRIMITIVETYPE_CHAR 5
93 #define PRIMITIVETYPE_SHORT 6
94 #define PRIMITIVETYPE_BOOLEAN 7
95 #define PRIMITIVETYPE_VOID 8
97 typedef void (*functionptr) (); /* generic function pointer */
100 #define MAX_ALIGN 8 /* most generic alignment for JavaVM values */
102 /* shutdown function **********************************************************/
104 void cacao_shutdown(s4 status);
107 /* basic data types ***********************************************************/
109 #define TYPE_INT 0 /* the JavaVM types must numbered in the */
110 #define TYPE_LONG 1 /* same order as the ICMD_Ixxx to ICMD_Axxx */
111 #define TYPE_FLOAT 2 /* instructions (LOAD and STORE) */
112 #define TYPE_DOUBLE 3 /* integer, long, float, double, address */
113 #define TYPE_ADDRESS 4 /* all other types can be numbered arbitrarly */
118 /* Java class file constants **************************************************/
120 #define MAGIC 0xcafebabe
121 #define MINOR_VERSION 3
122 #define MAJOR_VERSION 45
124 #define CONSTANT_Class 7
125 #define CONSTANT_Fieldref 9
126 #define CONSTANT_Methodref 10
127 #define CONSTANT_InterfaceMethodref 11
128 #define CONSTANT_String 8
129 #define CONSTANT_Integer 3
130 #define CONSTANT_Float 4
131 #define CONSTANT_Long 5
132 #define CONSTANT_Double 6
133 #define CONSTANT_NameAndType 12
134 #define CONSTANT_Utf8 1
136 #define CONSTANT_UNUSED 0
138 #define ACC_PUBLIC 0x0001
139 #define ACC_PRIVATE 0x0002
140 #define ACC_PROTECTED 0x0004
141 #define ACC_STATIC 0x0008
142 #define ACC_FINAL 0x0010
143 #define ACC_SYNCHRONIZED 0x0020
144 #define ACC_VOLATILE 0x0040
145 #define ACC_TRANSIENT 0x0080
146 #define ACC_NATIVE 0x0100
147 #define ACC_INTERFACE 0x0200
148 #define ACC_ABSTRACT 0x0400
149 #define ACC_STRICT 0x0800
151 /* resolve typedef cycles *****************************************************/
153 typedef struct utf utf;
154 typedef struct literalstring literalstring;
155 typedef struct java_objectheader java_objectheader;
156 typedef struct classinfo classinfo;
157 typedef struct vftbl vftbl;
158 typedef u1* methodptr;
159 typedef struct fieldinfo fieldinfo;
160 typedef struct methodinfo methodinfo;
161 typedef struct arraydescriptor arraydescriptor;
164 /* constant pool entries *******************************************************
166 All constant pool entries need a data structure which contain the entrys
167 value. In some cases this structure exist already, in the remaining cases
168 this structure must be generated:
170 kind structure generated?
171 ----------------------------------------------------------------------
172 CONSTANT_Class classinfo no
173 CONSTANT_Fieldref constant_FMIref yes
174 CONSTANT_Methodref constant_FMIref yes
175 CONSTANT_InterfaceMethodref constant_FMIref yes
176 CONSTANT_String unicode no
177 CONSTANT_Integer constant_integer yes
178 CONSTANT_Float constant_float yes
179 CONSTANT_Long constant_long yes
180 CONSTANT_Double constant_double yes
181 CONSTANT_NameAndType constant_nameandtype yes
182 CONSTANT_Utf8 unicode no
185 *******************************************************************************/
187 /* data structures for hashtables ********************************************
190 All utf-symbols, javastrings and classes are stored in global hashtables,
191 so every symbol exists only once. Equal symbols have identical pointers.
192 The functions for adding hashtable elements search the table for the
193 element with the specified name/text and return it on success. Otherwise a
194 new hashtable element is created.
196 The hashtables use external linking for handling collisions. The hashtable
197 structure contains a pointer <ptr> to the array of hashtable slots. The
198 number of hashtable slots and therefore the size of this array is specified
199 by the element <size> of hashtable structure. <entries> contains the number
200 of all hashtable elements stored in the table, including those in the
202 The hashtable element structures (utf, literalstring, classinfo) contain
203 both a pointer to the next hashtable element as a link for the external hash
204 chain and the key of the element. The key is computed from the text of
205 the string or the classname by using up to 8 characters.
207 If the number of entries in the hashtable exceeds twice the size of the
208 hashtableslot-array it is supposed that the average length of the
209 external chains has reached a value beyond 2. Therefore the functions for
210 adding hashtable elements (utf_new, class_new, literalstring_new) double
211 the hashtableslot-array. In this restructuring process all elements have
212 to be inserted into the new hashtable and new external chains must be built.
215 example for the layout of a hashtable:
217 hashtable.ptr--> +-------------------+
221 +-------------------+ +-------------------+ +-------------------+
222 | hashtable element |-->| hashtable element |-->| hashtable element |-->NULL
223 +-------------------+ +-------------------+ +-------------------+
224 | hashtable element |
225 +-------------------+ +-------------------+
226 | hashtable element |-->| hashtable element |-->NULL
227 +-------------------+ +-------------------+
228 | hashtable element |-->NULL
229 +-------------------+
233 +-------------------+
238 /* data structure for utf8 symbols ********************************************/
241 utf *hashlink; /* link for external hash chain */
242 int blength; /* text length in bytes */
243 char *text; /* pointer to text */
247 /* data structure of internal javastrings stored in global hashtable **********/
249 struct literalstring {
250 literalstring *hashlink; /* link for external hash chain */
251 java_objectheader *string;
255 /* data structure for calls from c code to java methods */
257 struct jni_callblock {
262 typedef struct jni_callblock jni_callblock;
265 /* data structure for accessing hashtables ************************************/
269 u4 entries; /* number of entries in the table */
270 void **ptr; /* pointer to hashtable */
274 /* data structures of remaining constant pool entries *************************/
276 typedef struct { /* Fieldref, Methodref and InterfaceMethodref */
277 classinfo *class; /* class containing this field/method/interface */
278 utf *name; /* field/method/interface name */
279 utf *descriptor; /* field/method/interface type descriptor string */
283 typedef struct { /* Integer */
288 typedef struct { /* Float */
293 typedef struct { /* Long */
298 typedef struct { /* Double */
303 typedef struct { /* NameAndType (Field or Method) */
304 utf *name; /* field/method name */
305 utf *descriptor; /* field/method type descriptor string */
306 } constant_nameandtype;
310 arraydescriptor describes array types. Basic array types contain their
311 type in the arraytype field, objectclass contains a class pointer for
312 arrays of objects (arraytype == ARRAYTYPE_OBJECT), elementdescriptor
313 contains a pointer to an arraydescriptor which describes the element
314 types in the case of arrays of arrays (arraytype == ARRAYTYPE_ARRAY).
319 typedef struct constant_arraydescriptor {
321 classinfo *objectclass;
322 struct constant_arraydescriptor *elementdescriptor;
323 } constant_arraydescriptor;
327 /* data structures of the runtime system **************************************/
329 /* objects *********************************************************************
331 All objects (and arrays) which resides on the heap need the following
332 header at the beginning of the data structure.
335 struct java_objectheader { /* header for all objects */
336 vftbl *vftbl; /* pointer to virtual function table */
341 /* arrays **********************************************************************
343 All arrays are objects (they need the object header with a pointer to a
344 vvftbl (array class table). There is only one class for all arrays. The XXX change
345 type of an array is stored directly in the array object. Following types
349 /* CAUTION: Don't change the numerical values! These constants (with
350 * the exception of ARRAYTYPE_OBJECT) are used as indices in the
351 * primitive type table.
353 #define ARRAYTYPE_INT PRIMITIVETYPE_INT
354 #define ARRAYTYPE_LONG PRIMITIVETYPE_LONG
355 #define ARRAYTYPE_FLOAT PRIMITIVETYPE_FLOAT
356 #define ARRAYTYPE_DOUBLE PRIMITIVETYPE_DOUBLE
357 #define ARRAYTYPE_BYTE PRIMITIVETYPE_BYTE
358 #define ARRAYTYPE_CHAR PRIMITIVETYPE_CHAR
359 #define ARRAYTYPE_SHORT PRIMITIVETYPE_SHORT
360 #define ARRAYTYPE_BOOLEAN PRIMITIVETYPE_BOOLEAN
361 #define ARRAYTYPE_OBJECT PRIMITIVETYPE_VOID /* don't use as index! */
363 typedef struct java_arrayheader { /* header for all arrays */
364 java_objectheader objheader; /* object header */
365 s4 size; /* array size */
366 #ifdef SIZE_FROM_CLASSINFO
367 s4 alignedsize; /* phil */
373 /* structs for all kinds of arrays ********************************************/
375 typedef struct java_chararray {
376 java_arrayheader header;
380 typedef struct java_floatheader {
381 java_arrayheader header;
385 typedef struct java_doublearray {
386 java_arrayheader header;
390 /* booleanarray and bytearray need identical memory layout (access methods
391 use the same machine code */
393 typedef struct java_booleanarray {
394 java_arrayheader header;
398 typedef struct java_bytearray {
399 java_arrayheader header;
403 typedef struct java_shortarray {
404 java_arrayheader header;
408 typedef struct java_intarray {
409 java_arrayheader header;
413 typedef struct java_longarray {
414 java_arrayheader header;
418 /* objectarray and arrayarray need identical memory layout (access methods
419 use the same machine code */
421 typedef struct java_objectarray {
422 java_arrayheader header;
423 java_objectheader *data[1];
428 typedef struct java_arrayarray {
429 java_arrayheader header;
430 constant_arraydescriptor *elementdescriptor;
431 java_arrayheader *data[1];
435 /* structure for primitive classes ********************************************/
437 typedef struct primitivetypeinfo {
438 classinfo *class_wrap; /* class for wrapping primitive type */
439 classinfo *class_primitive; /* primitive class */
440 char *wrapname; /* name of class for wrapping */
441 char typesig; /* one character type signature */
442 char *name; /* name of primitive class */
443 char *arrayname; /* name of primitive array class */
444 classinfo *arrayclass; /* primitive array class */
445 vftbl *arrayvftbl; /* vftbl of primitive array class */
449 /* field, method and class structures *****************************************/
452 typedef struct xtafldinfo {
454 classinfo *fldClassType;
455 classSet *XTAclassSet; /* field class type set */
459 /* fieldinfo ******************************************************************/
461 struct fieldinfo { /* field of a class */
462 s4 flags; /* ACC flags */
463 s4 type; /* basic data type */
464 utf *name; /* name of field */
465 utf *descriptor; /* JavaVM descriptor string of field */
467 s4 offset; /* offset from start of object (instance variables) */
469 union { /* storage for static values (class variables) */
482 /* exceptiontable *************************************************************/
484 typedef struct xtable { /* exceptiontable entry in a method */
485 s4 startpc; /* start pc of guarded area (inclusive) */
486 struct basicblock *start;
488 s4 endpc; /* end pc of guarded area (exklusive) */
489 struct basicblock *end;
491 s4 handlerpc; /* pc of exception handler */
492 struct basicblock *handler;
494 classinfo *catchtype; /* catchtype of exception (NULL == catchall) */
495 struct xtable *next; /* used to build a list of exception when */
496 /* loops are copied */
497 struct xtable *down; /* instead of the old array, a list is used */
501 typedef struct exceptiontable { /* exceptiontable entry in a method */
502 s4 startpc; /* start pc of guarded area (inclusive) */
503 s4 endpc; /* end pc of guarded area (exklusive) */
504 s4 handlerpc; /* pc of exception handler */
505 classinfo *catchtype; /* catchtype of exception (NULL == catchall) */
509 /* methodinfo static info ****************************************************/
510 typedef struct xtainfo {
511 s4 XTAmethodUsed; /* XTA if used in callgraph - not used /used */
512 classSet *XTAclassSet; /* method class type set */
513 /*classSet *PartClassSet */ /* method class type set */
515 classSetNode *paramClassSet; /* cone set of methods parameters */
517 methSet *calls; /* methods this method calls */
518 methSet *calledBy; /* methods that call this method */
519 methSet *marked; /* methods that marked by this method */
520 /*methSet *markedBy*/
521 fldSet *fldsUsed; /* fields used by this method */
522 /*methSetNode *interfaceCalls*/ /* methods this method calls as interface */
523 bool chgdSinceLastParse; /* Changed since last parse ? */
526 /* methodinfo *****************************************************************/
528 struct methodinfo { /* method structure */
529 s4 flags; /* ACC flags */
530 utf *name; /* name of method */
531 utf *descriptor; /* JavaVM descriptor string of method */
532 s4 returntype; /* only temporary valid, return type */
533 classinfo *returnclass; /* pointer to classinfo for the rtn type */ /*XTA*/
534 s4 paramcount; /* only temporary valid, parameter count */
535 u1 *paramtypes; /* only temporary valid, parameter types */
536 classinfo **paramclass; /* pointer to classinfo for a parameter */ /*XTA*/
538 classinfo *class; /* class, the method belongs to */
539 s4 vftblindex; /* index of method in virtual function table
540 (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 exceptiontablelength;/* exceptiontable length */
547 exceptiontable *exceptiontable;
548 /* the exceptiontable */
550 u1 *stubroutine; /* stub for compiling or calling natives */
551 s4 mcodelength; /* legth of generated machine code */
552 u1 *mcode; /* pointer to machine code */
553 u1 *entrypoint; /* entry point in machine code */
558 s4 methodUsed; /* marked (might be used later) /not used /used */
559 s4 monoPoly; /* call is mono or poly or unknown */ /*RT stats */
560 /* should # method def'd and used be kept after static parse (will it be used?) */
567 /* innerclassinfo *************************************************************/
569 typedef struct innerclassinfo {
570 classinfo *inner_class; /* inner class pointer */
571 classinfo *outer_class; /* outer class pointer */
572 utf *name; /* innerclass name */
573 s4 flags; /* ACC flags */
576 /* classinfo ******************************************************************/
578 struct classinfo { /* class structure */
579 java_objectheader header; /* classes are also objects */
580 java_objectarray* signers;
581 struct java_security_ProtectionDomain* pd;
582 struct java_lang_VMClass* vmClass;
583 struct java_lang_reflect_Constructor* constructor;
586 s4 initializing_thread; /* gnu classpath*/
587 s4 erroneous_state; /* gnu classpath*/
588 struct gnu_classpath_RawData* vmData; /* gnu classpath*/
590 s4 flags; /* ACC flags */
591 utf *name; /* class name */
593 s4 cpcount; /* number of entries in constant pool */
594 u1 *cptags; /* constant pool tags */
595 voidptr *cpinfos; /* pointer to constant pool info structures */
597 classinfo *super; /* super class pointer */
598 classinfo *sub; /* sub class pointer */
599 classinfo *nextsub; /* pointer to next class in sub class list */
601 s4 interfacescount; /* number of interfaces */
602 classinfo **interfaces; /* pointer to interfaces */
604 s4 fieldscount; /* number of fields */
605 fieldinfo *fields; /* field table */
607 s4 methodscount; /* number of methods */
608 methodinfo *methods; /* method table */
610 listnode listnode; /* linkage */
612 bool initialized; /* true, if class already initialised */
613 bool linked; /* true, if class already linked */
614 s4 index; /* hierarchy depth (classes) or index
616 s4 instancesize; /* size of an instance of this class */
617 #ifdef SIZE_FROM_CLASSINFO
618 s4 alignedsize; /* size of an instance, aligned to the
619 allocation size on the heap */
622 vftbl *vftbl; /* pointer to virtual function table */
624 methodinfo *finalizer; /* finalizer method */
626 u2 innerclasscount; /* number of inner classes */
627 innerclassinfo *innerclass;
629 classinfo *hashlink; /* link for external hash chain */
630 bool classvftbl; /* has its own copy of the Class vtbl */
632 s4 classUsed; /* 0= not used 1 = used CO-RT */
634 classSetNode *impldBy; /* implemented by class set */
637 /* check if class is an array class. Only use for linked classes! */
638 #define CLASS_IS_ARRAY(clsinfo) (clsinfo->vftbl->arraydesc != NULL)
641 /* virtual function table ******************************************************
643 The vtbl has a bidirectional layout with open ends at both sides.
644 interfacetablelength gives the number of entries of the interface table at
645 the start of the vftbl. The vftbl pointer points to &interfacetable[0].
646 vftbllength gives the number of entries of table at the end of the vftbl.
648 runtime type check (checkcast):
650 Different methods are used for runtime type check depending on the
651 argument of checkcast/instanceof.
653 A check against a class is implemented via relative numbering on the class
654 hierachy tree. The tree is numbered in a depth first traversal setting
655 the base field and the diff field. The diff field gets the result of
656 (high - base) so that a range check can be implemented by an unsigned
657 compare. A sub type test is done by checking the inclusion of base of
658 the sub class in the range of the superclass.
660 A check against an interface is implemented via the interfacevftbl. If the
661 interfacevftbl contains a nonnull value a class is a subclass of this
666 Like standard virtual methods interface methods are called using
667 virtual function tables. All interfaces are numbered sequentially
668 (starting with zero). For each class there exist an interface table
669 of virtual function tables for each implemented interface. The length
670 of the interface table is determined by the highest number of an
671 implemented interface.
673 The following example assumes a class which implements interface 0 and 3:
675 interfacetablelength = 4
678 +-----------+ | method 2 |---> method z
679 | class | | method 1 |---> method y
680 +-----------+ | method 0 |---> method x
681 | ivftbl 0 |----------> +----------+
682 vftblptr ---> +-----------+
683 | ivftbl -1 |--> NULL +----------+
684 | ivftbl -2 |--> NULL | method 1 |---> method x
685 | ivftbl -3 |-----+ | method 0 |---> method a
686 +-----------+ +----> +----------+
693 interfacevftbllength ---> +---------------+
695 *******************************************************************************/
698 methodptr *interfacetable[1]; /* interface table (access via macro) */
700 classinfo *class; /* class, the vtbl belongs to */
702 arraydescriptor *arraydesc; /* for array classes, otherwise NULL */
704 s4 vftbllength; /* virtual function table length */
705 s4 interfacetablelength; /* interface table length */
707 s4 baseval; /* base for runtime type check */
708 /* (-index for interfaces) */
709 s4 diffval; /* high - base for runtime type check */
711 s4 *interfacevftbllength; /* length of interface vftbls */
713 methodptr table[1]; /* class vftbl */
716 #define VFTBLINTERFACETABLE(v,i) (v)->interfacetable[-i]
719 /* arraydescriptor ************************************************************
721 For every array class an arraydescriptor is allocated which
722 describes the array class.
723 The arraydescriptor is referenced from the vftbl of the array
726 *******************************************************************************/
728 struct arraydescriptor {
729 vftbl *componentvftbl; /* vftbl of the component type, NULL for primit. */
730 vftbl *elementvftbl; /* vftbl of the element type, NULL for primitive */
731 short arraytype; /* ARRAYTYPE_* constant */
732 short dimension; /* dimension of the array (always >= 1) */
733 s4 dataoffset; /* offset of the array data from object pointer */
734 s4 componentsize; /* size of a component in bytes */
737 /* references to some system classes ******************************************/
739 extern classinfo *class_java_lang_Object;
740 extern classinfo *class_java_lang_String;
741 extern classinfo *class_java_lang_Throwable;
742 extern classinfo *class_java_lang_Cloneable;
743 extern classinfo *class_java_io_Serializable;
744 extern classinfo *class_java_lang_ClassCastException;
745 extern classinfo *class_java_lang_NullPointerException;
746 extern classinfo *class_java_lang_ArrayIndexOutOfBoundsException;
747 extern classinfo *class_java_lang_NegativeArraySizeException;
748 extern classinfo *class_java_lang_OutOfMemoryError;
749 extern classinfo *class_java_lang_ArithmeticException;
750 extern classinfo *class_java_lang_ArrayStoreException;
751 extern classinfo *class_java_lang_ThreadDeath;
752 extern classinfo *pseudo_class_Arraystub;
753 extern classinfo *pseudo_class_Null;
754 extern vftbl *pseudo_class_Arraystub_vftbl;
756 /* instances of some system classes *******************************************/
758 extern java_objectheader *proto_java_lang_ClassCastException;
759 extern java_objectheader *proto_java_lang_NullPointerException;
760 extern java_objectheader *proto_java_lang_ArrayIndexOutOfBoundsException;
761 extern java_objectheader *proto_java_lang_NegativeArraySizeException;
762 extern java_objectheader *proto_java_lang_OutOfMemoryError;
763 extern java_objectheader *proto_java_lang_ArithmeticException;
764 extern java_objectheader *proto_java_lang_ArrayStoreException;
765 extern java_objectheader *proto_java_lang_ThreadDeath;
768 /* flag variables *************************************************************/
770 extern bool compileall;
771 extern bool runverbose;
773 extern bool opt_rt; /* Rapid Type Analysis for better inlining CO-RT*/
774 extern bool opt_xta; /* X Type Analysis for better inlining CO-XTA*/
775 extern bool opt_vta; /* Variable Type Analysis for better inlining CO-VTA*/
777 //extern int pClassHeir;
778 //extern int pCallgraph;
779 //extern int pOpcodes;
782 //extern void RT_jit_parse(methodinfo *m);
784 /* statistic variables ********************************************************/
786 extern int count_class_infos;
787 extern int count_const_pool_len;
788 extern int count_vftbl_len;
789 extern int count_utf_len;
790 extern int count_all_methods;
791 extern int count_vmcode_len;
792 extern int count_extable_len;
793 extern int count_class_loads;
794 extern int count_class_inits;
795 extern int count_utf_new;
796 extern int count_utf_new_found;
798 /* table of primitive types ***************************************************/
800 /* This array can be indexed by the PRIMITIVETYPE_ and ARRAYTYPE_
801 * constants (except ARRAYTYPE_OBJECT).
803 extern primitivetypeinfo primitivetype_table[PRIMITIVETYPE_COUNT];
806 /* macros for descriptor parsing **********************************************/
808 /* utf_ptr must point to the 'L' or the '[' of a field descriptor.
809 * After the macro call utf_ptr points to the first character after
810 * the field descriptor.
812 * CAUTION: This macro does not check for an unexpected end of the
815 #define SKIP_FIELDDESCRIPTOR(utf_ptr) \
816 { while (*(utf_ptr)=='[') (utf_ptr)++; \
817 if (*(utf_ptr)++=='L') \
818 while(*(utf_ptr)++ != ';') /* skip */; }
820 * utf_ptr....points to first char of descriptor
821 * end_ptr....points to first char after the end of the string
822 * errorflag..must be initialized (to false) by the caller!
824 * utf_ptr....points to first char after the descriptor
825 * errorflag..set to true if the string ended unexpectedly
827 #define SKIP_FIELDDESCRIPTOR_SAFE(utf_ptr,end_ptr,errorflag) \
828 { while ((utf_ptr) != (end_ptr) && *(utf_ptr)=='[') (utf_ptr)++; \
829 if ((utf_ptr) == (end_ptr)) \
830 (errorflag) = true; \
832 if (*(utf_ptr)++=='L') { \
833 while((utf_ptr) != (end_ptr) && *(utf_ptr)++ != ';') /* skip */; \
834 if ((utf_ptr)[-1] != ';') \
835 (errorflag) = true; }}
838 extern classinfo *class_array;
843 * These are local overrides for various environment variables in Emacs.
844 * Please do not remove this and leave it at the end of the file, where
845 * Emacs will automagically detect them.
846 * ---------------------------------------------------------------------
849 * indent-tabs-mode: t