1 /*
2 * @(#)check_code.h 1.3 02/09/27
3 *
4 * Copyright 1995-1999 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 */
16 #include <setjmp.h>
23 #define MAX_ARRAY_DIMENSIONS 255
26 #define UNKNOWN_STACK_SIZE -1
27 #define UNKNOWN_REGISTER_COUNT -1
28 #define UNKNOWN_RET_INSTRUCTION -1
30 #undef MAX
31 #undef MIN
32 #define MAX(a, b) ((a) > (b) ? (a) : (b))
33 #define MIN(a, b) ((a) < (b) ? (a) : (b))
35 #define BITS_PER_INT (CHAR_BIT * sizeof(int)/sizeof(char))
36 #define SET_BIT(flags, i) (flags[(i)/BITS_PER_INT] |= \
37 ((unsigned)1 << ((i) % BITS_PER_INT)))
38 #define IS_BIT_SET(flags, i) (flags[(i)/BITS_PER_INT] & \
39 ((unsigned)1 << ((i) % BITS_PER_INT)))
44 #define GET_ITEM_TYPE(thing) ((thing) & 0x1F)
45 #define GET_INDIRECTION(thing) (((thing) & 0xFFFF) >> 5)
46 #define GET_EXTRA_INFO(thing) ((unsigned short)((thing) >> 16))
47 #define WITH_ZERO_INDIRECTION(thing) ((thing) & ~(0xFFE0))
48 #define WITH_ZERO_EXTRA_INFO(thing) ((thing) & 0xFFFF)
50 #define MAKE_FULLINFO(type, indirect, extra) \
51 ((fullinfo_type)((type) + ((indirect) << 5) + ((extra) << 16)))
52 #define MAKE_CLASSNAME_INFO(context, classname, addr) \
53 MAKE_FULLINFO(ITEM_Object, 0, \
54 Str2ID_Local(context, &context->classHash, (classname), (addr), FALSE))
55 #define MAKE_CLASSNAME_INFO_WITH_COPY(context, classname, addr) \
56 MAKE_FULLINFO(ITEM_Object, 0, \
57 Str2ID_Local(context, &context->classHash, (classname), (addr), TRUE))
58 #define MAKE_Object_ARRAY(indirect) \
59 (context->object_info + ((indirect) << 5))
61 #define NULL_FULLINFO MAKE_FULLINFO(ITEM_Object, 0, 0)
63 /* opc_invokespecial calls to <init> need to be treated special */
64 #define opc_invokeinit 0x100
67 /* these fields are per class */
77 /* these fields are per method */
89 /* Used by inliner */
90 bool_t redoJsr;
92 /* Used by the space allocator */
97 /* Jump here on any error. */
99 };
104 };
111 };
116 };
129 fullinfo_type fi;
131 fullinfo_type p;
142 };
147 };
150 fullinfo_type item;
152 };