* src/vm/jit/arm/emit.c [ENABLE_SOFTFLOAT] (emit_load): Implemented.
[cacao.git] / src / vm / field.c
1 /* src/vm/field.c - field functions
2
3    Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
4    C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
5    E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
6    J. Wenninger, Institut f. Computersprachen - TU Wien
7
8    This file is part of CACAO.
9
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.
14
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.
19
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
23    02110-1301, USA.
24
25    Contact: cacao@cacaojvm.org
26
27    Authors: Reinhard Grafl
28
29    Changes: Andreas Krall
30             Roman Obermaiser
31             Mark Probst
32             Edwin Steiner
33             Christian Thalinger
34
35    $Id: field.c 4879 2006-05-05 17:34:49Z edwin $
36
37 */
38
39
40 #include "config.h"
41
42 #include <stdio.h>
43
44 #include "vm/types.h"
45
46 #include "vm/field.h"
47 #include "vm/utf8.h"
48
49
50 /* field_free ******************************************************************
51
52    Frees a fields' resources.
53
54 *******************************************************************************/
55
56 void field_free(fieldinfo *f)
57 {
58         /* empty */
59 }
60
61
62 /* field_printflags ************************************************************
63
64    (debugging only)
65
66 *******************************************************************************/
67
68 #if !defined(NDEBUG)
69 void field_printflags(fieldinfo *f)
70 {
71         if (f == NULL) {
72                 printf("NULL");
73                 return;
74         }
75
76         if (f->flags & ACC_PUBLIC)       printf(" PUBLIC");
77         if (f->flags & ACC_PRIVATE)      printf(" PRIVATE");
78         if (f->flags & ACC_PROTECTED)    printf(" PROTECTED");
79         if (f->flags & ACC_STATIC)       printf(" STATIC");
80         if (f->flags & ACC_FINAL)        printf(" FINAL");
81         if (f->flags & ACC_SYNCHRONIZED) printf(" SYNCHRONIZED");
82         if (f->flags & ACC_VOLATILE)     printf(" VOLATILE");
83         if (f->flags & ACC_TRANSIENT)    printf(" TRANSIENT");
84         if (f->flags & ACC_NATIVE)       printf(" NATIVE");
85         if (f->flags & ACC_INTERFACE)    printf(" INTERFACE");
86         if (f->flags & ACC_ABSTRACT)     printf(" ABSTRACT");
87 }
88 #endif
89
90
91 /* field_print *****************************************************************
92
93    (debugging only)
94
95 *******************************************************************************/
96
97 #if !defined(NDEBUG)
98 void field_print(fieldinfo *f)
99 {
100         if (f == NULL) {
101                 printf("(fieldinfo*)NULL");
102                 return;
103         }
104
105         utf_display_printable_ascii_classname(f->class->name);
106         printf(".");
107         utf_display_printable_ascii(f->name);
108         printf(" ");
109         utf_display_printable_ascii(f->descriptor);     
110
111         field_printflags(f);
112 }
113 #endif
114
115
116 /* field_println ***************************************************************
117
118    (debugging only)
119
120 *******************************************************************************/
121
122 #if !defined(NDEBUG)
123 void field_println(fieldinfo *f)
124 {
125         field_print(f);
126         printf("\n");
127 }
128 #endif
129
130 /* field_fieldref_print ********************************************************
131
132    (debugging only)
133
134 *******************************************************************************/
135
136 #if !defined(NDEBUG)
137 void field_fieldref_print(constant_FMIref *fr)
138 {
139         if (fr == NULL) {
140                 printf("(constant_FMIref *)NULL");
141                 return;
142         }
143
144         if (IS_FMIREF_RESOLVED(fr)) {
145                 printf("<field> ");
146                 field_print(fr->p.field);
147         }
148         else {
149                 printf("<fieldref> ");
150                 utf_display_printable_ascii_classname(fr->p.classref->name);
151                 printf(".");
152                 utf_display_printable_ascii(fr->name);
153                 printf(" ");
154                 utf_display_printable_ascii(fr->descriptor);
155         }
156 }
157 #endif
158
159 /* field_fieldref_println ******************************************************
160
161    (debugging only)
162
163 *******************************************************************************/
164
165 #if !defined(NDEBUG)
166 void field_fieldref_println(constant_FMIref *fr)
167 {
168         field_fieldref_print(fr);
169         printf("\n");
170 }
171 #endif
172
173 /*
174  * These are local overrides for various environment variables in Emacs.
175  * Please do not remove this and leave it at the end of the file, where
176  * Emacs will automagically detect them.
177  * ---------------------------------------------------------------------
178  * Local variables:
179  * mode: c
180  * indent-tabs-mode: t
181  * c-basic-offset: 4
182  * tab-width: 4
183  * End:
184  */