1 /* src/vm/stackmap.h - class attribute StackMapTable
3 Copyright (C) 2006, 2007, 2008
4 CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
6 This file is part of CACAO.
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2, or (at
11 your option) any later version.
13 This program is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
29 /* forward typedefs ***********************************************************/
31 typedef struct stack_map_t stack_map_t;
32 typedef union stack_map_frame_t stack_map_frame_t;
33 typedef struct same_locals_1_stack_item_frame_t same_locals_1_stack_item_frame_t;
34 typedef struct same_locals_1_stack_item_frame_extended_t same_locals_1_stack_item_frame_extended_t;
35 typedef struct chop_frame_t chop_frame_t;
36 typedef struct same_frame_extended_t same_frame_extended_t;
37 typedef struct append_frame_t append_frame_t;
38 typedef struct full_frame_t full_frame_t;
40 typedef union verification_type_info_t verification_type_info_t;
41 typedef struct Top_variable_info_t Top_variable_info_t;
42 typedef struct Integer_variable_info_t Integer_variable_info_t;
43 typedef struct Float_variable_info_t Float_variable_info_t;
44 typedef struct Long_variable_info_t Long_variable_info_t;
45 typedef struct Double_variable_info_t Double_variable_info_t;
46 typedef struct Null_variable_info_t Null_variable_info_t;
47 typedef struct UninitializedThis_variable_info_t UninitializedThis_variable_info_t;
48 typedef struct Object_variable_info_t Object_variable_info_t;
49 typedef struct Uninitialized_variable_info_t Uninitialized_variable_info_t;
55 #include "vm/global.h"
56 #include "vm/loader.hpp"
57 #include "vm/method.hpp"
60 /* verification_type_info *****************************************************/
63 #define ITEM_Integer 1
68 #define ITEM_UninitializedThis 6
70 #define ITEM_Uninitialized 8
72 struct Top_variable_info_t {
76 struct Integer_variable_info_t {
80 struct Float_variable_info_t {
84 struct Long_variable_info_t {
88 struct Double_variable_info_t {
92 struct Null_variable_info_t {
96 struct UninitializedThis_variable_info_t {
100 struct Object_variable_info_t {
105 struct Uninitialized_variable_info_t {
110 union verification_type_info_t {
112 Top_variable_info_t Top_variable_info;
113 Integer_variable_info_t Integer_variable_info;
114 Float_variable_info_t Float_variable_info;
115 Long_variable_info_t Long_variable_info;
116 Double_variable_info_t Double_variable_info;
117 Null_variable_info_t Null_variable_info;
118 UninitializedThis_variable_info_t UninitializedThis_variable_info;
119 Object_variable_info_t Object_variable_info;
120 Uninitialized_variable_info_t Uninitialized_variable_info;
124 /* stack_map_t ****************************************************************/
127 u2 attribute_name_index;
129 u2 number_of_entries;
130 stack_map_frame_t *entries;
134 /* same_locals_1_stack_item_frame_t *******************************************/
136 struct same_locals_1_stack_item_frame_t {
138 verification_type_info_t stack[1];
142 /* same_locals_1_stack_item_frame_extended_t **********************************/
144 struct same_locals_1_stack_item_frame_extended_t {
147 verification_type_info_t stack[1];
151 /* chop_frame_t ***************************************************************/
153 struct chop_frame_t {
159 /* same_frame_extended_t ******************************************************/
161 struct same_frame_extended_t {
167 /* append_frame_t *************************************************************/
169 struct append_frame_t {
172 verification_type_info_t *locals;
176 /* full_frame_t ***************************************************************/
178 struct full_frame_t {
182 verification_type_info_t *locals;
183 u2 number_of_stack_items;
184 verification_type_info_t *stack;
188 /* stack_map_frame_t **********************************************************/
190 #define FRAME_TYPE_SAME 63 /* 0-63 */
191 #define FRAME_TYPE_SAME_LOCALS_1_STACK_ITEM 127 /* 0-127 */
192 #define FRAME_TYPE_RESERVED 246 /* 128-246 */
193 #define FRAME_TYPE_SAME_LOCALS_1_STACK_ITEM_EXTENDED 247 /* 247 */
194 #define FRAME_TYPE_CHOP 250 /* 248-250 */
195 #define FRAME_TYPE_SAME_FRAME_EXTENDED 251 /* 251 */
196 #define FRAME_TYPE_APPEND 254 /* 252-254 */
197 #define FRAME_TYPE_FULL_FRAME 255 /* 255 */
199 union stack_map_frame_t {
201 same_locals_1_stack_item_frame_t same_locals_1_stack_item_frame;
202 same_locals_1_stack_item_frame_extended_t same_locals_1_stack_item_frame_extended;
203 chop_frame_t chop_frame;
204 same_frame_extended_t same_frame_extended;
205 append_frame_t append_frame;
206 full_frame_t full_frame;
209 #if defined(__cplusplus)
213 /* function prototypes ********************************************************/
215 bool stackmap_load_attribute_stackmaptable(classbuffer *cb, methodinfo *m);
217 #if defined(__cplusplus)
221 #endif /* _STACKMAP_H */
225 * These are local overrides for various environment variables in Emacs.
226 * Please do not remove this and leave it at the end of the file, where
227 * Emacs will automagically detect them.
228 * ---------------------------------------------------------------------
231 * indent-tabs-mode: t
235 * vim:noexpandtab:sw=4:ts=4: