DEADSOFTWARE

Patched for Linux
[mp3cc.git] / MPC.3.5.LINUX / preverifier / oobj.h
1 /*
2 * @(#)oobj.h 1.5 00/04/12
3 *
4 * Copyright 1995-1998 by Sun Microsystems, Inc.,
5 * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
6 * All rights reserved.
7 *
8 * This software is the confidential and proprietary information
9 * of Sun Microsystems, Inc. ("Confidential Information"). You
10 * shall not disclose such Confidential Information and shall use
11 * it only in accordance with the terms of the license agreement
12 * you entered into with Sun.
13 * Use is subject to license terms.
14 */
15 /*
16 * Java object header format
17 */
19 #ifndef _OOBJ_H_
20 #define _OOBJ_H_
22 #include <stddef.h>
23 #include <stdarg.h>
24 #include <stdio.h>
25 #include <stdlib.h>
26 #include <string.h>
27 #include <limits.h>
29 #include "typedefs.h"
30 #include "signature.h"
32 #define JAVA_CLASSFILE_MAGIC 0xCafeBabe
34 #define JAVASRCEXT "java"
35 #define JAVASRCEXTLEN 4
36 #define JAVAOBJEXT "class"
37 #define JAVAOBJEXTLEN 5
39 #define JAVA_VERSION 45
40 #define JAVA_MINOR_VERSION 3
41 #define ARRAYHEADER long alloclen
43 /* The size (in bytes) of a statically allocated area that the
44 * verifier uses internally in various string operations.
45 */
46 #ifndef STRINGBUFFERSIZE
47 #define STRINGBUFFERSIZE 512
48 #endif
50 #define MAXOPTIONS 2048 /* maximum # of parameters */
52 /* maximum size allowed for package name of a class file */
53 #define MAXPACKAGENAME 1024
55 #define MAXPATHLEN 255
57 #define HandleTo(T) typedef struct H##T { Class##T *obj; struct methodtable *methods;} H##T
60 typedef long OBJECT;
61 typedef OBJECT Classjava_lang_Object;
62 typedef OBJECT ClassObject;
63 HandleTo(java_lang_Object);
64 typedef Hjava_lang_Object JHandle;
65 typedef Hjava_lang_Object HObject;
67 typedef unsigned short unicode;
69 extern unicode *str2unicode(char *, unicode *, long);
70 extern char *int642CString(int64_t number, char *buf, int buflen);
72 #define ALIGN(n) (((n)+3)&~3)
73 #define UCALIGN(n) ((unsigned char *)ALIGN((int)(n)))
75 struct Hjava_lang_Class; /* forward reference for some compilers */
76 struct Classjava_lang_Class; /* forward reference for some compilers */
78 typedef struct Classjava_lang_Class Classjava_lang_Class;
80 HandleTo(java_lang_Class);
81 typedef struct Hjava_lang_Class ClassClass;
84 struct fieldblock {
85 ClassClass *clazz;
86 char *signature;
87 char *name;
88 unsigned long ID;
89 unsigned short access;
90 union {
91 unsigned long offset; /* info of data */
92 OBJECT static_value;
93 void *static_address;
94 } u;
95 unsigned deprecated:1;
96 unsigned synthetic:1;
97 };
99 #define fieldname(fb) ((fb)->name)
100 #define fieldsig(fb) ((fb)->signature)
101 #define fieldIsArray(fb) (fieldsig(fb)[0] == SIGNATURE_ARRAY)
102 #define fieldIsClass(fb) (fieldsig(fb)[0] == SIGNATURE_CLASS)
103 #define fieldclass(fb) ((fb)->clazz)
105 struct execenv;
107 #define VERIFIER_TOOL
109 /* Includes/eliminates a large amount of optional debugging code
110 * (such as class and stack frame printing operations) in/from
111 * the system. By eliminating debug code, the system will be smaller.
112 * Inclusion of debugging code increases the size of the system but
113 * does not introduce any performance overhead unless calls to the
114 * debugging routines are added to the source code or various tracing
115 * options are turned on.
116 */
118 #ifndef INCLUDEDEBUGCODE
119 #define INCLUDEDEBUGCODE 0
120 #endif
122 #define DEBUG_VERIFIER 1
123 #define DEBUG_READFROMFILE 0
125 enum {
126 ITEM_Bogus,
127 ITEM_Void, /* only as a function return value */
128 ITEM_Integer,
129 ITEM_Float,
130 ITEM_Double,
131 ITEM_Double_2, /* 2nd word of double in register */
132 ITEM_Long,
133 ITEM_Long_2, /* 2nd word of long in register */
134 ITEM_InitObject, /* "this" is init method, before call
135 to super() */
136 ITEM_Object, /* Extra info field gives name. */
137 ITEM_NewObject, /* Like object, but uninitialized. */
138 ITEM_ReturnAddress, /* Extra info gives instr # of start pc */
139 /* The following three are only used within array types.
140 * Normally, we use ITEM_Integer, instead. */
141 ITEM_Boolean,
142 ITEM_Byte,
143 ITEM_Short,
144 ITEM_Char
145 };
147 /* These are the constants that appear in class files. */
148 enum {
149 CF_ITEM_Bogus,
150 CF_ITEM_Integer,
151 CF_ITEM_Float,
152 CF_ITEM_Double,
153 CF_ITEM_Long,
154 CF_ITEM_Null,
155 CF_ITEM_InitObject,
157 CF_ITEM_Object,
158 CF_ITEM_NewObject,
159 };
161 struct map_entry {
162 unsigned char type;
163 long info;
164 };
166 struct stack_map {
167 int offset;
168 int nlocals;
169 struct map_entry *locals;
170 int nstacks;
171 struct map_entry *stacks;
172 };
174 struct methodblock {
175 struct fieldblock fb;
176 unsigned char *code; /* the code */
177 struct CatchFrame *exception_table;
178 struct lineno *line_number_table;
179 struct localvar *localvar_table;
181 unsigned long code_length;
182 unsigned long exception_table_length;
183 unsigned long line_number_table_length;
184 unsigned long localvar_table_length;
186 bool_t (*invoker)
187 (JHandle *o, struct methodblock *mb, int args_size, struct execenv *ee);
188 unsigned short args_size; /* total size of all arguments */
189 unsigned short maxstack; /* maximum stack usage */
190 unsigned short nlocals; /* maximum number of locals */
191 /* 2 spare bytes here */
192 void *CompiledCode; /* it's type is machine dependent */
193 void *CompiledCodeInfo; /* it's type is machine dependent */
194 long CompiledCodeFlags; /* machine dependent bits */
195 unsigned long inlining; /* possible inlining of code */
196 unsigned short nexceptions; /* number of checked exceptions */
197 unsigned short *exceptions; /* constant pool indices */
198 char *mp_marks;
199 int n_stack_maps;
200 struct stack_map *stack_maps;
201 };
203 struct HIOstream;
205 struct methodtable {
206 ClassClass *classdescriptor;
207 struct methodblock *methods[1];
208 };
210 struct imethodtable {
211 int icount; /* number of interfaces to follow */
212 struct {
213 ClassClass *classdescriptor;
214 unsigned long *offsets; /* info of data */
215 } itable[1];
216 };
218 typedef struct {
219 char body[1];
220 } ArrayOfByte;
221 typedef ArrayOfByte ClassArrayOfByte;
222 HandleTo(ArrayOfByte);
224 typedef struct {
225 unicode body[1];
226 } ArrayOfChar;
227 typedef ArrayOfChar ClassArrayOfChar;
228 HandleTo(ArrayOfChar);
230 typedef struct {
231 signed short body[1];
232 } ArrayOfShort;
233 typedef ArrayOfShort ClassArrayOfShort;
234 HandleTo(ArrayOfShort);
236 typedef struct {
237 long body[1];
238 } ArrayOfInt;
239 typedef ArrayOfInt ClassArrayOfInt;
240 HandleTo(ArrayOfInt);
242 typedef struct {
243 int64_t body[1];
244 } ArrayOfLong;
245 typedef ArrayOfLong ClassArrayOfLong;
246 HandleTo(ArrayOfLong);
248 typedef struct {
249 float body[1];
250 } ArrayOfFloat;
251 typedef ArrayOfFloat ClassArrayOfFloat;
252 HandleTo(ArrayOfFloat);
254 typedef struct {
255 double body[1];
256 } ArrayOfDouble;
257 typedef ArrayOfDouble ClassArrayOfDouble;
258 HandleTo(ArrayOfDouble);
260 typedef struct {
261 JHandle *(body[1]);
262 } ArrayOfArray;
263 typedef ArrayOfArray ClassArrayOfArray;
264 HandleTo(ArrayOfArray);
266 typedef struct {
267 HObject *(body[1]);
268 } ArrayOfObject;
269 typedef ArrayOfObject ClassArrayOfObject;
270 HandleTo(ArrayOfObject);
272 typedef struct Hjava_lang_String HString;
274 typedef struct {
275 HString *(body[1]);
276 } ArrayOfString;
277 typedef ArrayOfString ClassArrayOfString;
278 HandleTo(ArrayOfString);
281 /* Note: any handles in this structure must also have explicit
282 code in the ScanClasses() routine of the garbage collector
283 to mark the handle. */
284 struct Classjava_lang_Class {
285 /* Things following here are saved in the .class file */
286 unsigned short major_version;
287 unsigned short minor_version;
288 char *name;
289 char *super_name;
290 char *source_name;
291 ClassClass *superclass;
292 ClassClass *HandleToSelf;
293 struct Hjava_lang_ClassLoader *loader;
294 struct methodblock *finalizer;
296 union cp_item_type *constantpool;
297 struct methodblock *methods;
298 struct fieldblock *fields;
299 short *implements;
301 struct methodtable *methodtable;
302 struct methodtable *methodtable_mem;
303 struct fieldblock **slottable;
305 int superclass_idx;
307 HString *classname;
309 union {
310 struct {
311 unsigned long thishash; /* unused */
312 unsigned long totalhash; /* unused */
313 } cbhash;
314 struct {
315 unsigned char typecode; /* VM typecode */
316 char typesig; /* signature constant */
317 unsigned char slotsize; /* (bytes) in slot */
318 unsigned char elementsize; /* (bytes) in array */
319 unsigned long xxspare;
320 } cbtypeinfo;
321 } hashinfo;
323 unsigned short constantpool_count; /* number of items in pool */
324 unsigned short methods_count; /* number of methods */
325 unsigned short fields_count; /* number of fields */
326 unsigned short implements_count; /* number of protocols */
328 unsigned short methodtable_size; /* the size of method table */
329 unsigned short slottbl_size; /* size of slottable */
330 unsigned short instance_size; /* (bytes) of an instance */
332 unsigned short access; /* how this class can be accesses */
333 unsigned short flags; /* see the CCF_* macros */
334 struct HArrayOfObject *signers;
335 struct imethodtable *imethodtable;
337 void *init_thread; /* EE of initializing thread */
339 ClassClass *last_subclass_of;
340 void *reserved_for_jit;
341 char *absolute_source_name;
342 struct { int high, low; } timestamp;
343 int n_new_class_entries;
344 char **new_class_entries;
345 int n_new_utf8_entries;
346 char **new_utf8_entries;
347 int has_stack_maps;
349 int inner_classes_count;
350 struct innerClasses *inner_classes;
352 unsigned deprecated:1;
353 unsigned synthetic:1;
354 unsigned hasTimeStamp:1;
355 };
357 struct innerClasses {
358 int inner_class;
359 int outer_class;
360 char *inner_name;
361 int access;
362 };
364 extern void FreeClass(ClassClass *cb);
365 extern void MakeClassSticky(ClassClass *cb);
367 #define cbAccess(cb) ((unhand(cb))->access)
368 #define cbClassname(cb) ((unhand(cb))->classname)
369 #define cbConstantPool(cb) ((unhand(cb))->constantpool)
370 #define cbConstantPoolCount(cb) ((unhand(cb))->constantpool_count)
371 #define cbFields(cb) ((unhand(cb))->fields)
372 #define cbFieldsCount(cb) ((unhand(cb))->fields_count)
373 #define cbFinalizer(cb) ((unhand(cb))->finalizer)
374 #define cbFlags(cb) ((unhand(cb))->flags)
375 #define cbHandle(cb) (cb)
376 #define cbImplements(cb) ((unhand(cb))->implements)
377 #define cbImplementsCount(cb) ((unhand(cb))->implements_count)
378 #define cbInstanceSize(cb) ((unhand(cb))->instance_size)
379 #define cbIntfMethodTable(cb) ((unhand(cb))->imethodtable)
380 #define cbLastSubclassOf(cb) ((unhand(cb))->last_subclass_of)
381 #define cbLoader(cb) ((unhand(cb))->loader)
382 #define cbMajorVersion(cb) ((unhand(cb))->major_version)
383 #define cbMethods(cb) ((unhand(cb))->methods)
384 #define cbMethodsCount(cb) ((unhand(cb))->methods_count)
385 #define cbMethodTable(cb) ((unhand(cb))->methodtable)
386 #define cbMethodTableMem(cb) ((unhand(cb))->methodtable_mem)
387 #define cbMethodTableSize(cb) ((unhand(cb))->methodtable_size)
388 #define cbMinorVersion(cb) ((unhand(cb))->minor_version)
389 #define cbName(cb) ((unhand(cb))->name)
390 #define cbSigners(cb) ((unhand(cb))->signers)
391 #define cbSlotTable(cb) ((unhand(cb))->slottable)
392 #define cbSlotTableSize(cb) ((unhand(cb))->slottbl_size)
393 #define cbSourceName(cb) ((unhand(cb))->source_name)
394 #define cbSuperclass(cb) ((unhand(cb))->superclass)
395 #define cbSuperName(cb) ((unhand(cb))->super_name)
396 #define cbThisHash(cb) ((unhand(cb))->hashinfo.cbhash.thishash)
397 #define cbTotalHash(cb) ((unhand(cb))->hashinfo.cbhash.totalhash)
398 #define cbInitThread(cb) ((unhand(cb))->init_thread)
399 #define cbInnerClasses(cb) ((unhand(cb))->inner_classes)
400 #define cbInnerClassesCount(cb)((unhand(cb))->inner_classes_count)
404 #define cbAbsoluteSourceName(cb) ((unhand(cb))->absolute_source_name)
405 #define cbTimestamp(cb) ((unhand(cb))->timestamp)
407 #define cbIsInterface(cb) ((cbAccess(cb) & ACC_INTERFACE) != 0)
408 #define cbIsAbstract(cb) ((cbAccess(cb) & ACC_ABSTRACT) != 0)
409 #define cbAccessNotAbstract(cb) ((unhand(cb))->access & ~ACC_ABSTRACT)
411 /* These are currently only valid for primitive types */
412 #define cbIsPrimitive(cb) (CCIs(cb, Primitive))
413 #define cbTypeCode(cb) ((unhand(cb))->hashinfo.cbtypeinfo.typecode)
414 #define cbTypeSig(cb) ((unhand(cb))->hashinfo.cbtypeinfo.typesig)
415 #define cbSlotSize(cb) ((unhand(cb))->hashinfo.cbtypeinfo.slotsize)
416 #define cbElementSize(cb) ((unhand(cb))->hashinfo.cbtypeinfo.elementsize)
418 extern char *classname2string(char *str, char *dst, int size);
420 #define twoword_static_address(fb) ((fb)->u.static_address)
421 #define normal_static_address(fb) (&(fb)->u.static_value)
423 /* ClassClass flags */
424 #define CCF_IsSysLock 0x01 /* any instance treated as a "system" lock */
425 #define CCF_IsResolved 0x02 /* has <clinit> been run? */
426 #define CCF_IsError 0x04 /* Resolution caused an error */
427 #define CCF_IsSoftRef 0x08 /* whether this is class Ref or subclass */
428 #define CCF_IsInitialized 0x10 /* whether this is class has been inited */
429 #define CCF_IsLinked 0x20 /* Has symbolic entries been linked */
430 #define CCF_IsVerified 0x40 /* has the verifier been run */
432 #define CCF_IsPrimitive 0x100 /* if pseudo-class for a primitive type */
433 #define CCF_IsReferenced 0x200 /* Class is in use */
434 #define CCF_IsSticky 0x400 /* Don't unload this class */
436 #define CCIs(cb,flag) (((unhand(cb))->flags & CCF_Is##flag) != 0)
437 #define CCSet(cb,flag) ((unhand(cb))->flags |= CCF_Is##flag)
438 #define CCClear(cb,flag) ((unhand(cb))->flags &= ~CCF_Is##flag)
440 /* map from pc to line number */
441 struct lineno {
442 unsigned long pc,
443 line_number;
444 };
446 extern struct lineno *lntbl;
447 extern long lntsize, lntused;
449 /* Symbol table entry for local variables and parameters.
450 pc0/length defines the range that the variable is valid, slot
451 is the position in the local variable array in ExecEnv.
452 nameoff and sigoff are offsets into the string table for the
453 variable name and type signature. A variable is defined with
454 DefineVariable, and at that time, the node for that name is
455 stored in the localvar entry. When code generate is completed
456 for a particular scope, a second pass it made to replace the
457 src node entry with the correct length. */
459 struct localvar {
460 long pc0; /* starting pc for this variable */
461 long length; /* -1 initially, end pc - pc when we're done */
462 char *name; /* */
463 char *signature;
464 long slot; /* local variable slot */
465 };
467 /* Try/catch is implemented as follows. On a per class basis,
468 there is a catch frame handler (below) for each catch frame
469 that appears in the source. It contains the pc range of the
470 corresponding try body, a pc to jump to in the event that that
471 handler is chosen, and a catchType which must match the object
472 being thrown if that catch handler is to be taken.
474 The list of catch frames are sorted by pc. If one range is
475 inside another, then outer most range (the one that encompasses
476 the other) appears last in the list. Therefore, it is possible
477 to search forward, and the first one that matches is the
478 innermost one.
480 Methods with catch handlers will layout the code without the
481 catch frames. After all the code is generated, the catch
482 clauses are generated and table entries are created.
484 When the class is complete, the table entries are dumped along
485 with the rest of the class. */
487 struct CatchFrame {
488 long start_pc, end_pc; /* pc range of corresponding try block */
489 long handler_pc; /* pc of catch handler */
490 void* compiled_CatchFrame; /* space to be used by machine code */
491 short catchType; /* type of catch parameter */
492 };
494 #define MC_SUPER (1<<5)
495 #define MC_NARGSMASK (MC_SUPER-1)
496 #define MC_INT (0<<6)
497 #define MC_FLOAT (1<<6)
498 #define MC_VOID (2<<6)
499 #define MC_OTHER (3<<6)
500 #define MC_TYPEMASK (3<<6)
502 enum {
503 CONSTANT_Utf8 = 1,
504 CONSTANT_Unicode, /* unused */
505 CONSTANT_Integer,
506 CONSTANT_Float,
507 CONSTANT_Long,
508 CONSTANT_Double,
509 CONSTANT_Class,
510 CONSTANT_String,
511 CONSTANT_Fieldref,
512 CONSTANT_Methodref,
513 CONSTANT_InterfaceMethodref,
514 CONSTANT_NameAndType
515 };
517 union cp_item_type {
518 int i;
519 float f;
520 char *cp;
521 unsigned char *type; /* for type table */
522 ClassClass *clazz;
523 struct methodblock *mb;
524 struct fieldblock *fb;
525 struct Hjava_lang_String *str;
526 void *p; /* for very rare occasions */
527 };
529 typedef union cp_item_type cp_item_type;
531 #define CONSTANT_POOL_ENTRY_RESOLVED 0x80
532 #define CONSTANT_POOL_ENTRY_TYPEMASK 0x7F
533 #define CONSTANT_POOL_TYPE_TABLE_GET(cp,i) (((unsigned char *)(cp))[i])
534 #define CONSTANT_POOL_TYPE_TABLE_PUT(cp,i,v) (CONSTANT_POOL_TYPE_TABLE_GET(cp,i) = (v))
535 #define CONSTANT_POOL_TYPE_TABLE_SET_RESOLVED(cp,i) \
536 (CONSTANT_POOL_TYPE_TABLE_GET(cp,i) |= CONSTANT_POOL_ENTRY_RESOLVED)
537 #define CONSTANT_POOL_TYPE_TABLE_IS_RESOLVED(cp,i) \
538 ((CONSTANT_POOL_TYPE_TABLE_GET(cp,i) & CONSTANT_POOL_ENTRY_RESOLVED) != 0)
539 #define CONSTANT_POOL_TYPE_TABLE_GET_TYPE(cp,i) \
540 (CONSTANT_POOL_TYPE_TABLE_GET(cp,i) & CONSTANT_POOL_ENTRY_TYPEMASK)
542 #define CONSTANT_POOL_TYPE_TABLE_INDEX 0
543 #define CONSTANT_POOL_UNUSED_INDEX 1
545 /* The following are used by the constant pool of "array" classes. */
547 #define CONSTANT_POOL_ARRAY_DEPTH_INDEX 1
548 #define CONSTANT_POOL_ARRAY_TYPE_INDEX 2
549 #define CONSTANT_POOL_ARRAY_CLASS_INDEX 3
550 #define CONSTANT_POOL_ARRAY_LENGTH 4
552 /*
553 * Package shorthand: this isn't obviously the correct place.
554 */
555 #define JAVAPKG "java/lang/"
556 #define JAVAIOPKG "java/io/"
557 #define JAVANETPKG "java/net/"
559 #define unhand(o) ((o)->obj)
562 extern ClassClass *classJavaLangClass; /* class java/lang/Class */
563 extern ClassClass *classJavaLangObject; /* class java/lang/Object */
564 extern ClassClass *classJavaLangString; /* class java/lang/String */
566 extern ClassClass *classJavaLangThrowable;
567 extern ClassClass *classJavaLangException;
568 extern ClassClass *classJavaLangError;
569 extern ClassClass *classJavaLangRuntimeException;
570 extern ClassClass *classJavaLangThreadDeath;
572 extern ClassClass *interfaceJavaLangCloneable; /* class java/lang/Cloneable */
573 extern ClassClass *interfaceJavaIoSerializable; /* class java/io/Serializable */
575 enum { VERIFY_NONE, VERIFY_REMOTE, VERIFY_ALL };
577 extern int verifyclasses;
578 extern bool_t verbose;
579 extern char * const opnames[];
581 int jio_snprintf(char *str, size_t count, const char *fmt, ...);
582 int jio_vsnprintf(char *str, size_t count, const char *fmt, va_list args);
584 int jio_printf(const char *fmt, ...);
585 int jio_fprintf(FILE *, const char *fmt, ...);
586 int jio_vfprintf(FILE *, const char *fmt, va_list args);
588 struct StrIDhash;
589 unsigned short Str2ID(struct StrIDhash **, char *, void ***, int);
590 char *ID2Str(struct StrIDhash *, unsigned short, void ***);
591 void Str2IDFree(struct StrIDhash **);
593 unsigned NameAndTypeToHash(char *name, char *type);
594 bool_t IsSameClassPackage(ClassClass *class1, ClassClass *class2);
595 unsigned Signature2ArgsSize(char *method_signature);
596 char *GetClassConstantClassName(cp_item_type *constant_pool, int index);
597 ClassClass *FindClass(struct execenv *ee, char *name, bool_t resolve);
598 ClassClass *FindClassFromClass(struct execenv *ee, char *name,
599 bool_t resolve, ClassClass *from);
601 bool_t createInternalClass(unsigned char *bytes, unsigned char *limit,
602 ClassClass *cb, struct Hjava_lang_ClassLoader *,
603 char *utfname, char **detail);
605 bool_t VerifyClass(ClassClass *cb);
606 //bool_t IsLegalClassname(char *name, bool_t allowArrayClass);
607 bool_t verify_class_codes(ClassClass *cb);
609 struct execenv {
610 /* Detecting class circularities */
611 struct seenclass {
612 ClassClass *cb;
613 struct seenclass *next;
614 } seenclasses;
616 /* error message occurred during class loading */
617 char *class_loading_msg;
618 };
620 typedef struct execenv ExecEnv;
622 extern ExecEnv * EE();
624 ClassClass *FindStickySystemClass(struct execenv *, char *, bool_t resolve);
625 bool_t VerifyClassAccess(ClassClass *, ClassClass *, bool_t);
626 void InitializeInvoker(ClassClass *cb);
627 bool_t RunStaticInitializers(ClassClass *cb);
628 ClassClass *ClassLoaderFindClass(ExecEnv *ee,
629 struct Hjava_lang_ClassLoader *loader,
630 char *name, bool_t resolve);
631 ClassClass *LoadClassLocally(char *name);
632 ClassClass *createFakeArrayClass(char *name, int base_type, int depth,
633 ClassClass *inner_cb,
634 struct Hjava_lang_ClassLoader *);
635 ClassClass *createPrimitiveClass(char *name, char sig, unsigned char typecode,
636 unsigned char slotsize, unsigned char elementsize);
638 bool_t isJARfile(char *fn, int length);
640 #define BINCLASS_LOCK()
641 #define BINCLASS_UNLOCK()
642 #define LOADCLASS_LOCK()
643 #define LOADCLASS_UNLOCK()
644 #define NAMETYPEHASH_LOCK()
645 #define NAMETYPEHASH_UNLOCK()
647 #define FINALIZER_METHOD_NAME "finalize"
648 #define FINALIZER_METHOD_SIGNATURE "()V"
650 #define CLS_RESLV_INIT_CLASS "java/lang/Class"
651 #define CLS_RESLV_INIT_OBJECT "java/lang/Object"
652 #define CLS_RESLV_INIT_REF "sun/misc/Ref"
654 #define METHOD_FLAG_BITS 5
655 #define FLAG_MASK ((1<<METHOD_FLAG_BITS)-1) /* valid flag bits */
656 #define METHOD_MASK (~FLAG_MASK) /* valid mtable ptr bits */
657 #define LENGTH_MASK METHOD_MASK
659 #define mt_slot(methodtable, slot) (methodtable)->methods[slot]
661 #define monitorEnter(m)
662 #define monitorExit(m)
664 #define exceptionOccurred(ee) 0
665 void SignalError(struct execenv *, char *, char *);
667 void panic(const char *format, ...);
669 void printCurrentClassName(void);
671 void ensure_dir_exists(char *dir);
672 void ensure_dir_writable(char *dir);
674 extern bool_t no_native_methods;
675 extern bool_t no_floating_point;
676 extern bool_t no_finalizers;
678 extern int errorCode; /* status error returned by program*/
679 /* Set to 1 if any errors encountered
680 * during class verification in VerifyFile()
681 */
682 #endif /* !_OOBJ_H_ */