1 /* src/vm/stackmap.h - class attribute StackMapTable
3 Copyright (C) 2006 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
25 Contact: cacao@cacaojvm.org
27 Authors: Christian Thalinger
29 $Id: utf8.h 5920 2006-11-05 21:23:09Z twisti $
37 /* forward typedefs ***********************************************************/
39 typedef struct stack_map_t stack_map_t;
40 typedef union stack_map_frame_t stack_map_frame_t;
41 typedef struct same_locals_1_stack_item_frame_t same_locals_1_stack_item_frame_t;
42 typedef struct same_locals_1_stack_item_frame_extended_t same_locals_1_stack_item_frame_extended_t;
43 typedef struct chop_frame_t chop_frame_t;
44 typedef struct same_frame_extended_t same_frame_extended_t;
45 typedef struct append_frame_t append_frame_t;
46 typedef struct full_frame_t full_frame_t;
48 typedef union verification_type_info_t verification_type_info_t;
49 typedef struct Top_variable_info_t Top_variable_info_t;
50 typedef struct Integer_variable_info_t Integer_variable_info_t;
51 typedef struct Float_variable_info_t Float_variable_info_t;
52 typedef struct Long_variable_info_t Long_variable_info_t;
53 typedef struct Double_variable_info_t Double_variable_info_t;
54 typedef struct Null_variable_info_t Null_variable_info_t;
55 typedef struct UninitializedThis_variable_info_t UninitializedThis_variable_info_t;
56 typedef struct Object_variable_info_t Object_variable_info_t;
57 typedef struct Uninitialized_variable_info_t Uninitialized_variable_info_t;
63 #include "vm/global.h"
64 #include "vm/loader.h"
65 #include "vm/method.h"
68 /* verification_type_info *****************************************************/
71 #define ITEM_Integer 1
76 #define ITEM_UninitializedThis 6
78 #define ITEM_Uninitialized 8
80 struct Top_variable_info_t {
84 struct Integer_variable_info_t {
88 struct Float_variable_info_t {
92 struct Long_variable_info_t {
96 struct Double_variable_info_t {
100 struct Null_variable_info_t {
104 struct UninitializedThis_variable_info_t {
108 struct Object_variable_info_t {
113 struct Uninitialized_variable_info_t {
118 union verification_type_info_t {
120 Top_variable_info_t Top_variable_info;
121 Integer_variable_info_t Integer_variable_info;
122 Float_variable_info_t Float_variable_info;
123 Long_variable_info_t Long_variable_info;
124 Double_variable_info_t Double_variable_info;
125 Null_variable_info_t Null_variable_info;
126 UninitializedThis_variable_info_t UninitializedThis_variable_info;
127 Object_variable_info_t Object_variable_info;
128 Uninitialized_variable_info_t Uninitialized_variable_info;
132 /* stack_map_t ****************************************************************/
135 u2 attribute_name_index;
137 u2 number_of_entries;
138 stack_map_frame_t *entries;
142 /* same_locals_1_stack_item_frame_t *******************************************/
144 struct same_locals_1_stack_item_frame_t {
146 verification_type_info_t stack[1];
150 /* same_locals_1_stack_item_frame_extended_t **********************************/
152 struct same_locals_1_stack_item_frame_extended_t {
155 verification_type_info_t stack[1];
159 /* chop_frame_t ***************************************************************/
161 struct chop_frame_t {
167 /* same_frame_extended_t ******************************************************/
169 struct same_frame_extended_t {
175 /* append_frame_t *************************************************************/
177 struct append_frame_t {
180 verification_type_info_t *locals;
184 /* full_frame_t ***************************************************************/
186 struct full_frame_t {
190 verification_type_info_t *locals;
191 u2 number_of_stack_items;
192 verification_type_info_t *stack;
196 /* stack_map_frame_t **********************************************************/
198 #define FRAME_TYPE_SAME 63 /* 0-63 */
199 #define FRAME_TYPE_SAME_LOCALS_1_STACK_ITEM 127 /* 0-127 */
200 #define FRAME_TYPE_RESERVED 246 /* 128-246 */
201 #define FRAME_TYPE_SAME_LOCALS_1_STACK_ITEM_EXTENDED 247 /* 247 */
202 #define FRAME_TYPE_CHOP 250 /* 248-250 */
203 #define FRAME_TYPE_SAME_FRAME_EXTENDED 251 /* 251 */
204 #define FRAME_TYPE_APPEND 254 /* 252-254 */
205 #define FRAME_TYPE_FULL_FRAME 255 /* 255 */
207 union stack_map_frame_t {
209 same_locals_1_stack_item_frame_t same_locals_1_stack_item_frame;
210 same_locals_1_stack_item_frame_extended_t same_locals_1_stack_item_frame_extended;
211 chop_frame_t chop_frame;
212 same_frame_extended_t same_frame_extended;
213 append_frame_t append_frame;
214 full_frame_t full_frame;
218 /* function prototypes ********************************************************/
220 bool stackmap_load_attribute_stackmaptable(classbuffer *cb, methodinfo *m);
222 #endif /* _STACKMAP_H */
226 * These are local overrides for various environment variables in Emacs.
227 * Please do not remove this and leave it at the end of the file, where
228 * Emacs will automagically detect them.
229 * ---------------------------------------------------------------------
232 * indent-tabs-mode: t
236 * vim:noexpandtab:sw=4:ts=4: