1 /* src/vmcore/stackmap.h - class attribute StackMapTable
3 Copyright (C) 2006, 2007 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., 51 Franklin Street, Fifth Floor, Boston, MA
31 /* forward typedefs ***********************************************************/
33 typedef struct stack_map_t stack_map_t;
34 typedef union stack_map_frame_t stack_map_frame_t;
35 typedef struct same_locals_1_stack_item_frame_t same_locals_1_stack_item_frame_t;
36 typedef struct same_locals_1_stack_item_frame_extended_t same_locals_1_stack_item_frame_extended_t;
37 typedef struct chop_frame_t chop_frame_t;
38 typedef struct same_frame_extended_t same_frame_extended_t;
39 typedef struct append_frame_t append_frame_t;
40 typedef struct full_frame_t full_frame_t;
42 typedef union verification_type_info_t verification_type_info_t;
43 typedef struct Top_variable_info_t Top_variable_info_t;
44 typedef struct Integer_variable_info_t Integer_variable_info_t;
45 typedef struct Float_variable_info_t Float_variable_info_t;
46 typedef struct Long_variable_info_t Long_variable_info_t;
47 typedef struct Double_variable_info_t Double_variable_info_t;
48 typedef struct Null_variable_info_t Null_variable_info_t;
49 typedef struct UninitializedThis_variable_info_t UninitializedThis_variable_info_t;
50 typedef struct Object_variable_info_t Object_variable_info_t;
51 typedef struct Uninitialized_variable_info_t Uninitialized_variable_info_t;
57 #include "vm/global.h"
59 #include "vmcore/loader.h"
60 #include "vmcore/method.h"
63 /* verification_type_info *****************************************************/
66 #define ITEM_Integer 1
71 #define ITEM_UninitializedThis 6
73 #define ITEM_Uninitialized 8
75 struct Top_variable_info_t {
79 struct Integer_variable_info_t {
83 struct Float_variable_info_t {
87 struct Long_variable_info_t {
91 struct Double_variable_info_t {
95 struct Null_variable_info_t {
99 struct UninitializedThis_variable_info_t {
103 struct Object_variable_info_t {
108 struct Uninitialized_variable_info_t {
113 union verification_type_info_t {
115 Top_variable_info_t Top_variable_info;
116 Integer_variable_info_t Integer_variable_info;
117 Float_variable_info_t Float_variable_info;
118 Long_variable_info_t Long_variable_info;
119 Double_variable_info_t Double_variable_info;
120 Null_variable_info_t Null_variable_info;
121 UninitializedThis_variable_info_t UninitializedThis_variable_info;
122 Object_variable_info_t Object_variable_info;
123 Uninitialized_variable_info_t Uninitialized_variable_info;
127 /* stack_map_t ****************************************************************/
130 u2 attribute_name_index;
132 u2 number_of_entries;
133 stack_map_frame_t *entries;
137 /* same_locals_1_stack_item_frame_t *******************************************/
139 struct same_locals_1_stack_item_frame_t {
141 verification_type_info_t stack[1];
145 /* same_locals_1_stack_item_frame_extended_t **********************************/
147 struct same_locals_1_stack_item_frame_extended_t {
150 verification_type_info_t stack[1];
154 /* chop_frame_t ***************************************************************/
156 struct chop_frame_t {
162 /* same_frame_extended_t ******************************************************/
164 struct same_frame_extended_t {
170 /* append_frame_t *************************************************************/
172 struct append_frame_t {
175 verification_type_info_t *locals;
179 /* full_frame_t ***************************************************************/
181 struct full_frame_t {
185 verification_type_info_t *locals;
186 u2 number_of_stack_items;
187 verification_type_info_t *stack;
191 /* stack_map_frame_t **********************************************************/
193 #define FRAME_TYPE_SAME 63 /* 0-63 */
194 #define FRAME_TYPE_SAME_LOCALS_1_STACK_ITEM 127 /* 0-127 */
195 #define FRAME_TYPE_RESERVED 246 /* 128-246 */
196 #define FRAME_TYPE_SAME_LOCALS_1_STACK_ITEM_EXTENDED 247 /* 247 */
197 #define FRAME_TYPE_CHOP 250 /* 248-250 */
198 #define FRAME_TYPE_SAME_FRAME_EXTENDED 251 /* 251 */
199 #define FRAME_TYPE_APPEND 254 /* 252-254 */
200 #define FRAME_TYPE_FULL_FRAME 255 /* 255 */
202 union stack_map_frame_t {
204 same_locals_1_stack_item_frame_t same_locals_1_stack_item_frame;
205 same_locals_1_stack_item_frame_extended_t same_locals_1_stack_item_frame_extended;
206 chop_frame_t chop_frame;
207 same_frame_extended_t same_frame_extended;
208 append_frame_t append_frame;
209 full_frame_t full_frame;
213 /* function prototypes ********************************************************/
215 bool stackmap_load_attribute_stackmaptable(classbuffer *cb, methodinfo *m);
217 #endif /* _STACKMAP_H */
221 * These are local overrides for various environment variables in Emacs.
222 * Please do not remove this and leave it at the end of the file, where
223 * Emacs will automagically detect them.
224 * ---------------------------------------------------------------------
227 * indent-tabs-mode: t
231 * vim:noexpandtab:sw=4:ts=4: