* src/vm/field.c: Moved to .cpp
authorMichael Starzinger <michi@complang.tuwien.ac.at>
Fri, 22 Aug 2008 17:38:55 +0000 (19:38 +0200)
committerMichael Starzinger <michi@complang.tuwien.ac.at>
Fri, 22 Aug 2008 17:38:55 +0000 (19:38 +0200)
* src/vm/field.h: Likewise.
* src/vm/field.cpp: New file, see above.
* src/vm/field.hpp: Likewise.
* src/native/vm/reflection.hpp,
src/vm/Makefile.am,
src/vm/access.c,
src/vm/access.h,
src/vm/annotation.h,
src/vm/class.h,
src/vm/javaobjects.hpp,
src/vm/jit/alpha/patcher.c,
src/vm/jit/arm/patcher.c,
src/vm/jit/i386/patcher.c,
src/vm/jit/intrp/patcher.c,
src/vm/jit/m68k/patcher.c,
src/vm/jit/mips/patcher.c,
src/vm/jit/powerpc/patcher.c,
src/vm/jit/powerpc64/patcher.c,
src/vm/jit/s390/patcher.c,
src/vm/jit/sparc64/patcher.c,
src/vm/jit/x86_64/patcher.c,
src/vm/loader.cpp,
src/vm/references.h,
src/vm/resolve.h,
src/vm/statistics.c: Adapted includes to above change.

--HG--
rename : src/vm/field.c => src/vm/field.cpp
rename : src/vm/field.h => src/vm/field.hpp

26 files changed:
src/native/vm/reflection.hpp
src/vm/Makefile.am
src/vm/access.c
src/vm/access.h
src/vm/annotation.h
src/vm/class.h
src/vm/field.c [deleted file]
src/vm/field.cpp [new file with mode: 0644]
src/vm/field.h [deleted file]
src/vm/field.hpp [new file with mode: 0644]
src/vm/javaobjects.hpp
src/vm/jit/alpha/patcher.c
src/vm/jit/arm/patcher.c
src/vm/jit/i386/patcher.c
src/vm/jit/intrp/patcher.c
src/vm/jit/m68k/patcher.c
src/vm/jit/mips/patcher.c
src/vm/jit/powerpc/patcher.c
src/vm/jit/powerpc64/patcher.c
src/vm/jit/s390/patcher.c
src/vm/jit/sparc64/patcher.c
src/vm/jit/x86_64/patcher.c
src/vm/loader.cpp
src/vm/references.h
src/vm/resolve.h
src/vm/statistics.c

index 82b8fa6ccd73d885e516271e4cc5f1d0ec2d8a5c..4e4fbb4c7260767ce6e915319ee239a852ff330a 100644 (file)
@@ -32,7 +32,7 @@
 
 #include "native/native.h"
 
-#include "vm/field.h"
+#include "vm/field.hpp"
 #include "vm/method.h"
 
 
index 0340a23a4e02b4d83b0b3d19aea471dcc7a9dd26..98ed080094c9ddaa29edd3c48d37df65af680f3e 100644 (file)
@@ -92,8 +92,8 @@ libvm_la_SOURCES = \
        descriptor.h \
        exceptions.cpp \
        exceptions.hpp \
-       field.c \
-       field.h \
+       field.cpp \
+       field.hpp \
        finalizer.c \
        finalizer.h \
        globals.cpp \
index 07b7131db69a73453c125168401a05574afd31ed..9dd2b1e05eb51f15e1b597202b1c0e3065d6cf90 100644 (file)
@@ -38,7 +38,7 @@
 #include "vm/jit/builtin.hpp"
 #include "vm/class.h"
 #include "vm/exceptions.hpp"
-#include "vm/field.h"
+#include "vm/field.hpp"
 #include "vm/globals.hpp"
 #include "vm/method.h"
 
index 1b90872201d610d90daf1300f56002c444b9829b..0b1def4768f6d0bdea16729c653131b0d8031af4 100644 (file)
@@ -35,7 +35,7 @@ extern "C" {
 #endif
 
 #include "vm/class.h"
-#include "vm/field.h"
+#include "vm/field.hpp"
 #include "vm/global.h"
 #include "vm/method.h"
 
index 1b8d05a9985f962159b1faf647765fe6de33fd48..2b0a5432a617b0f72b8810e27c1e2be5fde5f77b 100644 (file)
@@ -32,7 +32,7 @@
 #include "vm/types.h"
 
 #include "vm/class.h"
-#include "vm/field.h"
+#include "vm/field.hpp"
 #include "vm/global.h"
 #include "vm/loader.hpp"
 #include "vm/method.h"
index 7cf122d6d4497bb2e3cbdad1dc392d2de88c3c5b..92ecbb73114f08d68704b6436f6c914c16f5b5d8 100644 (file)
@@ -49,7 +49,7 @@ typedef struct extra_classref extra_classref;
 # include "vm/annotation.h"
 #endif
 
-#include "vm/field.h"
+#include "vm/field.hpp"
 #include "vm/global.h"
 #include "vm/linker.h"
 #include "vm/loader.hpp"
diff --git a/src/vm/field.c b/src/vm/field.c
deleted file mode 100644 (file)
index 7bb9b55..0000000
+++ /dev/null
@@ -1,561 +0,0 @@
-/* src/vm/field.c - field functions
-
-   Copyright (C) 1996-2005, 2006, 2007, 2008
-   CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
-
-   This file is part of CACAO.
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2, or (at
-   your option) any later version.
-
-   This program is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-   02110-1301, USA.
-
-*/
-
-
-#include "config.h"
-
-#include <assert.h>
-#include <stdint.h>
-#include <stdio.h>
-
-#include "mm/memory.h"
-
-#include "native/llni.h"
-
-#include "vm/types.h"
-
-#include "vm/annotation.h"
-#include "vm/array.h"
-#include "vm/jit/builtin.hpp"
-#include "vm/class.h"
-#include "vm/descriptor.h"
-#include "vm/exceptions.hpp"
-#include "vm/field.h"
-#include "vm/global.h"
-#include "vm/loader.hpp"
-#include "vm/options.h"
-#include "vm/primitive.hpp"
-#include "vm/references.h"
-#include "vm/string.hpp"
-#include "vm/suck.h"
-#include "vm/utf8.h"
-#include "vm/vm.hpp"
-
-
-/* field_load ******************************************************************
-
-   Load everything about a class field from the class file and fill a
-   fieldinfo structure.
-
-*******************************************************************************/
-
-#define field_load_NOVALUE  0xffffffff /* must be bigger than any u2 value! */
-
-bool field_load(classbuffer *cb, fieldinfo *f, descriptor_pool *descpool)
-{
-       classinfo *c;
-       u4 attrnum, i;
-       u4 pindex = field_load_NOVALUE;     /* constantvalue_index */
-       utf *u;
-
-       /* Get class. */
-
-       c = cb->clazz;
-
-       f->clazz = c;
-
-       /* Get access flags. */
-
-       if (!suck_check_classbuffer_size(cb, 2 + 2 + 2))
-               return false;
-
-       f->flags = suck_u2(cb);
-
-       /* Get name. */
-
-       if (!(u = class_getconstant(c, suck_u2(cb), CONSTANT_Utf8)))
-               return false;
-
-       f->name = u;
-
-       /* Get descriptor. */
-
-       if (!(u = class_getconstant(c, suck_u2(cb), CONSTANT_Utf8)))
-               return false;
-
-       f->descriptor = u;
-       f->parseddesc = NULL;
-
-       if (!descriptor_pool_add(descpool, u, NULL))
-               return false;
-
-       /* descriptor_pool_add accepts method descriptors, so we have to
-          check against them here before the call of
-          descriptor_to_basic_type below. */
-
-       if (u->text[0] == '(') {
-               exceptions_throw_classformaterror(c, "Method descriptor used for field");
-               return false;
-       }
-
-#ifdef ENABLE_VERIFIER
-       if (opt_verify) {
-               /* check name */
-               if (!is_valid_name_utf(f->name) || f->name->text[0] == '<') {
-                       exceptions_throw_classformaterror(c,
-                                                                                         "Illegal Field name \"%s\"",
-                                                                                         f->name->text);
-                       return false;
-               }
-
-               /* check flag consistency */
-               i = f->flags & (ACC_PUBLIC | ACC_PRIVATE | ACC_PROTECTED);
-
-               if ((i != 0 && i != ACC_PUBLIC && i != ACC_PRIVATE && i != ACC_PROTECTED) ||
-                       ((f->flags & (ACC_FINAL | ACC_VOLATILE)) == (ACC_FINAL | ACC_VOLATILE))) {
-                       exceptions_throw_classformaterror(c,
-                                                                                         "Illegal field modifiers: 0x%X",
-                                                                                         f->flags);
-                       return false;
-               }
-
-               if (c->flags & ACC_INTERFACE) {
-                       if (((f->flags & (ACC_STATIC | ACC_PUBLIC | ACC_FINAL))
-                               != (ACC_STATIC | ACC_PUBLIC | ACC_FINAL)) ||
-                               f->flags & ACC_TRANSIENT) {
-                               exceptions_throw_classformaterror(c,
-                                                                                                 "Illegal field modifiers: 0x%X",
-                                                                                                 f->flags);
-                               return false;
-                       }
-               }
-       }
-#endif /* ENABLE_VERIFIER */
-
-       /* data type */
-
-       f->type = descriptor_to_basic_type(f->descriptor);
-
-       /* For static-fields allocate memory for the value and set the
-          value to 0. */
-
-       if (f->flags & ACC_STATIC) {
-               switch (f->type) {
-               case TYPE_INT:
-               case TYPE_LNG:
-               case TYPE_FLT:
-               case TYPE_DBL:
-                       f->value = NEW(imm_union);
-                       break;
-
-               case TYPE_ADR:
-#if !defined(ENABLE_GC_BOEHM)
-                       f->value = NEW(imm_union);
-#else
-                       f->value = GCNEW_UNCOLLECTABLE(imm_union, 1);
-#endif
-                       break;
-
-               default:
-                       vm_abort("field_load: invalid field type %d", f->type);
-               }
-
-               /* Set the field to zero, for float and double fields set the
-                  correct 0.0 value. */
-
-               switch (f->type) {
-               case TYPE_INT:
-               case TYPE_LNG:
-               case TYPE_ADR:
-                       f->value->l = 0;
-                       break;
-
-               case TYPE_FLT:
-                       f->value->f = 0.0;
-                       break;
-
-               case TYPE_DBL:
-                       f->value->d = 0.0;
-                       break;
-               }
-       }
-       else {
-               /* For instance-fields set the offset to 0. */
-
-               f->offset = 0;
-
-               /* For final fields, which are not static, we need a value
-                  structure. */
-
-               if (f->flags & ACC_FINAL) {
-                       f->value = NEW(imm_union);
-                       /* XXX hack */
-                       f->value->l = 0;
-               }
-
-               switch (f->type) {
-               case TYPE_ADR:
-                       c->flags |= ACC_CLASS_HAS_POINTERS;
-                       break;
-               }
-       }
-
-       /* read attributes */
-
-       if (!suck_check_classbuffer_size(cb, 2))
-               return false;
-
-       attrnum = suck_u2(cb);
-
-       for (i = 0; i < attrnum; i++) {
-               if (!suck_check_classbuffer_size(cb, 2))
-                       return false;
-
-               if (!(u = class_getconstant(c, suck_u2(cb), CONSTANT_Utf8)))
-                       return false;
-
-               if (u == utf_ConstantValue) {
-                       if (!suck_check_classbuffer_size(cb, 4 + 2))
-                               return false;
-
-                       /* check attribute length */
-
-                       if (suck_u4(cb) != 2) {
-                               exceptions_throw_classformaterror(c, "Wrong size for VALUE attribute");
-                               return false;
-                       }
-                       
-                       /* constant value attribute */
-
-                       if (pindex != field_load_NOVALUE) {
-                               exceptions_throw_classformaterror(c, "Multiple ConstantValue attributes");
-                               return false;
-                       }
-                       
-                       /* index of value in constantpool */
-
-                       pindex = suck_u2(cb);
-               
-                       /* initialize field with value from constantpool */             
-
-                       switch (f->type) {
-                       case TYPE_INT: {
-                               constant_integer *ci; 
-
-                               if (!(ci = class_getconstant(c, pindex, CONSTANT_Integer)))
-                                       return false;
-
-                               f->value->i = ci->value;
-                       }
-                       break;
-                                       
-                       case TYPE_LNG: {
-                               constant_long *cl; 
-
-                               if (!(cl = class_getconstant(c, pindex, CONSTANT_Long)))
-                                       return false;
-
-                               f->value->l = cl->value;
-                       }
-                       break;
-
-                       case TYPE_FLT: {
-                               constant_float *cf;
-
-                               if (!(cf = class_getconstant(c, pindex, CONSTANT_Float)))
-                                       return false;
-
-                               f->value->f = cf->value;
-                       }
-                       break;
-                                                                                       
-                       case TYPE_DBL: {
-                               constant_double *cd;
-
-                               if (!(cd = class_getconstant(c, pindex, CONSTANT_Double)))
-                                       return false;
-
-                               f->value->d = cd->value;
-                       }
-                       break;
-                                               
-                       case TYPE_ADR:
-                               if (!(u = class_getconstant(c, pindex, CONSTANT_String)))
-                                       return false;
-
-                               /* Create Java-string from compressed UTF8-string. */
-
-                               f->value->a = literalstring_new(u);
-                               break;
-       
-                       default: 
-                               vm_abort("field_load: invalid field type %d", f->type);
-                       }
-               }
-#if defined(ENABLE_JAVASE)
-               else if (u == utf_Signature) {
-                       /* Signature */
-
-                       if (!loader_load_attribute_signature(cb, &(f->signature)))
-                               return false;
-               }
-
-#if defined(ENABLE_ANNOTATIONS)
-               else if (u == utf_RuntimeVisibleAnnotations) {
-                       /* RuntimeVisibleAnnotations */
-                       if (!annotation_load_field_attribute_runtimevisibleannotations(cb, f))
-                               return false;
-               }
-               else if (u == utf_RuntimeInvisibleAnnotations) {
-                       /* RuntimeInvisibleAnnotations */
-                       if (!annotation_load_field_attribute_runtimeinvisibleannotations(cb, f))
-                               return false;
-               }
-#endif
-#endif
-               else {
-                       /* unknown attribute */
-
-                       if (!loader_skip_attribute_body(cb))
-                               return false;
-               }
-       }
-
-       /* everything was ok */
-
-       return true;
-}
-
-
-/* field_get_type **************************************************************
-
-   Returns the type of the field as class.
-
-*******************************************************************************/
-
-classinfo *field_get_type(fieldinfo *f)
-{
-       typedesc  *td;
-       utf       *u;
-       classinfo *c;
-
-       td = f->parseddesc;
-
-       if (td->type == TYPE_ADR) {
-               assert(td->classref);
-
-               u = td->classref->name;
-
-               /* load the class of the field-type with the field's
-                  classloader */
-
-               c = load_class_from_classloader(u, f->clazz->classloader);
-       }
-       else {
-               c = Primitive_get_class_by_type(td->primitivetype);
-       }
-
-       return c;
-}
-
-
-/* field_free ******************************************************************
-
-   Frees a fields' resources.
-
-*******************************************************************************/
-
-void field_free(fieldinfo *f)
-{
-       /* free memory for fields which have a value */
-
-       if (f->value)
-#if defined(ENABLE_GC_BOEHM)
-               if (f->type != TYPE_ADR)
-#endif
-                       FREE(f->value, imm_union);
-}
-
-
-/* field_get_annotations ******************************************************
-
-   Get a fields' unparsed annotations in a byte array.
-
-   IN:
-       f........the field of which the annotations should be returned
-
-   RETURN VALUE:
-       The unparsed annotations in a byte array (or NULL if there aren't any).
-
-*******************************************************************************/
-
-java_handle_bytearray_t *field_get_annotations(fieldinfo *f)
-{
-#if defined(ENABLE_ANNOTATIONS)
-       classinfo               *c;           /* declaring class           */
-       int                      slot;        /* slot of this field        */
-       java_handle_bytearray_t *annotations; /* unparsed annotations      */
-       java_handle_t           *field_annotations;  /* array of unparsed  */
-                      /* annotations of all fields of the declaring class */
-
-       c           = f->clazz;
-       slot        = f - c->fields;
-       annotations = NULL;
-
-       LLNI_classinfo_field_get(c, field_annotations, field_annotations);
-
-       /* the field_annotations array might be shorter then the field
-        * count if the fields above a certain index have no annotations.
-        */
-       if (field_annotations != NULL &&
-               array_length_get(field_annotations) > slot) {
-               annotations = (java_handle_bytearray_t*)array_objectarray_element_get(
-                               (java_handle_objectarray_t*)field_annotations, slot);
-       }
-       
-       return annotations;
-#else
-       return NULL;
-#endif
-}
-
-
-/* field_printflags ************************************************************
-
-   (debugging only)
-
-*******************************************************************************/
-
-#if !defined(NDEBUG)
-void field_printflags(fieldinfo *f)
-{
-       if (f == NULL) {
-               printf("NULL");
-               return;
-       }
-
-       if (f->flags & ACC_PUBLIC)       printf(" PUBLIC");
-       if (f->flags & ACC_PRIVATE)      printf(" PRIVATE");
-       if (f->flags & ACC_PROTECTED)    printf(" PROTECTED");
-       if (f->flags & ACC_STATIC)       printf(" STATIC");
-       if (f->flags & ACC_FINAL)        printf(" FINAL");
-       if (f->flags & ACC_SYNCHRONIZED) printf(" SYNCHRONIZED");
-       if (f->flags & ACC_VOLATILE)     printf(" VOLATILE");
-       if (f->flags & ACC_TRANSIENT)    printf(" TRANSIENT");
-       if (f->flags & ACC_NATIVE)       printf(" NATIVE");
-       if (f->flags & ACC_INTERFACE)    printf(" INTERFACE");
-       if (f->flags & ACC_ABSTRACT)     printf(" ABSTRACT");
-}
-#endif
-
-
-/* field_print *****************************************************************
-
-   (debugging only)
-
-*******************************************************************************/
-
-#if !defined(NDEBUG)
-void field_print(fieldinfo *f)
-{
-       if (f == NULL) {
-               printf("(fieldinfo*)NULL");
-               return;
-       }
-
-       utf_display_printable_ascii_classname(f->clazz->name);
-       printf(".");
-       utf_display_printable_ascii(f->name);
-       printf(" ");
-       utf_display_printable_ascii(f->descriptor);     
-
-       field_printflags(f);
-
-       if (!(f->flags & ACC_STATIC)) {
-               printf(", offset: %d", f->offset);
-       }
-}
-#endif
-
-
-/* field_println ***************************************************************
-
-   (debugging only)
-
-*******************************************************************************/
-
-#if !defined(NDEBUG)
-void field_println(fieldinfo *f)
-{
-       field_print(f);
-       printf("\n");
-}
-#endif
-
-/* field_fieldref_print ********************************************************
-
-   (debugging only)
-
-*******************************************************************************/
-
-#if !defined(NDEBUG)
-void field_fieldref_print(constant_FMIref *fr)
-{
-       if (fr == NULL) {
-               printf("(constant_FMIref *)NULL");
-               return;
-       }
-
-       if (IS_FMIREF_RESOLVED(fr)) {
-               printf("<field> ");
-               field_print(fr->p.field);
-       }
-       else {
-               printf("<fieldref> ");
-               utf_display_printable_ascii_classname(fr->p.classref->name);
-               printf(".");
-               utf_display_printable_ascii(fr->name);
-               printf(" ");
-               utf_display_printable_ascii(fr->descriptor);
-       }
-}
-#endif
-
-/* field_fieldref_println ******************************************************
-
-   (debugging only)
-
-*******************************************************************************/
-
-#if !defined(NDEBUG)
-void field_fieldref_println(constant_FMIref *fr)
-{
-       field_fieldref_print(fr);
-       printf("\n");
-}
-#endif
-
-/*
- * These are local overrides for various environment variables in Emacs.
- * Please do not remove this and leave it at the end of the file, where
- * Emacs will automagically detect them.
- * ---------------------------------------------------------------------
- * Local variables:
- * mode: c
- * indent-tabs-mode: t
- * c-basic-offset: 4
- * tab-width: 4
- * End:
- * vim:noexpandtab:sw=4:ts=4:
- */
diff --git a/src/vm/field.cpp b/src/vm/field.cpp
new file mode 100644 (file)
index 0000000..70fd041
--- /dev/null
@@ -0,0 +1,561 @@
+/* src/vm/field.cpp - field functions
+
+   Copyright (C) 1996-2005, 2006, 2007, 2008
+   CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
+
+   This file is part of CACAO.
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2, or (at
+   your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+*/
+
+
+#include "config.h"
+
+#include <assert.h>
+#include <stdint.h>
+#include <stdio.h>
+
+#include "mm/memory.h"
+
+#include "native/llni.h"
+
+#include "vm/types.h"
+
+#include "vm/annotation.h"
+#include "vm/array.h"
+#include "vm/jit/builtin.hpp"
+#include "vm/class.h"
+#include "vm/descriptor.h"
+#include "vm/exceptions.hpp"
+#include "vm/field.hpp"
+#include "vm/global.h"
+#include "vm/loader.hpp"
+#include "vm/options.h"
+#include "vm/primitive.hpp"
+#include "vm/references.h"
+#include "vm/string.hpp"
+#include "vm/suck.h"
+#include "vm/utf8.h"
+#include "vm/vm.hpp"
+
+
+/* field_load ******************************************************************
+
+   Load everything about a class field from the class file and fill a
+   fieldinfo structure.
+
+*******************************************************************************/
+
+#define field_load_NOVALUE  0xffffffff /* must be bigger than any u2 value! */
+
+bool field_load(classbuffer *cb, fieldinfo *f, descriptor_pool *descpool)
+{
+       classinfo *c;
+       u4 attrnum, i;
+       u4 pindex = field_load_NOVALUE;     /* constantvalue_index */
+       utf *u;
+
+       /* Get class. */
+
+       c = cb->clazz;
+
+       f->clazz = c;
+
+       /* Get access flags. */
+
+       if (!suck_check_classbuffer_size(cb, 2 + 2 + 2))
+               return false;
+
+       f->flags = suck_u2(cb);
+
+       /* Get name. */
+
+       if (!(u = (utf*) class_getconstant(c, suck_u2(cb), CONSTANT_Utf8)))
+               return false;
+
+       f->name = u;
+
+       /* Get descriptor. */
+
+       if (!(u = (utf*) class_getconstant(c, suck_u2(cb), CONSTANT_Utf8)))
+               return false;
+
+       f->descriptor = u;
+       f->parseddesc = NULL;
+
+       if (!descriptor_pool_add(descpool, u, NULL))
+               return false;
+
+       /* descriptor_pool_add accepts method descriptors, so we have to
+          check against them here before the call of
+          descriptor_to_basic_type below. */
+
+       if (u->text[0] == '(') {
+               exceptions_throw_classformaterror(c, "Method descriptor used for field");
+               return false;
+       }
+
+#ifdef ENABLE_VERIFIER
+       if (opt_verify) {
+               /* check name */
+               if (!is_valid_name_utf(f->name) || f->name->text[0] == '<') {
+                       exceptions_throw_classformaterror(c,
+                                                                                         "Illegal Field name \"%s\"",
+                                                                                         f->name->text);
+                       return false;
+               }
+
+               /* check flag consistency */
+               i = f->flags & (ACC_PUBLIC | ACC_PRIVATE | ACC_PROTECTED);
+
+               if ((i != 0 && i != ACC_PUBLIC && i != ACC_PRIVATE && i != ACC_PROTECTED) ||
+                       ((f->flags & (ACC_FINAL | ACC_VOLATILE)) == (ACC_FINAL | ACC_VOLATILE))) {
+                       exceptions_throw_classformaterror(c,
+                                                                                         "Illegal field modifiers: 0x%X",
+                                                                                         f->flags);
+                       return false;
+               }
+
+               if (c->flags & ACC_INTERFACE) {
+                       if (((f->flags & (ACC_STATIC | ACC_PUBLIC | ACC_FINAL))
+                               != (ACC_STATIC | ACC_PUBLIC | ACC_FINAL)) ||
+                               f->flags & ACC_TRANSIENT) {
+                               exceptions_throw_classformaterror(c,
+                                                                                                 "Illegal field modifiers: 0x%X",
+                                                                                                 f->flags);
+                               return false;
+                       }
+               }
+       }
+#endif /* ENABLE_VERIFIER */
+
+       /* data type */
+
+       f->type = descriptor_to_basic_type(f->descriptor);
+
+       /* For static-fields allocate memory for the value and set the
+          value to 0. */
+
+       if (f->flags & ACC_STATIC) {
+               switch (f->type) {
+               case TYPE_INT:
+               case TYPE_LNG:
+               case TYPE_FLT:
+               case TYPE_DBL:
+                       f->value = NEW(imm_union);
+                       break;
+
+               case TYPE_ADR:
+#if !defined(ENABLE_GC_BOEHM)
+                       f->value = NEW(imm_union);
+#else
+                       f->value = GCNEW_UNCOLLECTABLE(imm_union, 1);
+#endif
+                       break;
+
+               default:
+                       vm_abort("field_load: invalid field type %d", f->type);
+               }
+
+               /* Set the field to zero, for float and double fields set the
+                  correct 0.0 value. */
+
+               switch (f->type) {
+               case TYPE_INT:
+               case TYPE_LNG:
+               case TYPE_ADR:
+                       f->value->l = 0;
+                       break;
+
+               case TYPE_FLT:
+                       f->value->f = 0.0;
+                       break;
+
+               case TYPE_DBL:
+                       f->value->d = 0.0;
+                       break;
+               }
+       }
+       else {
+               /* For instance-fields set the offset to 0. */
+
+               f->offset = 0;
+
+               /* For final fields, which are not static, we need a value
+                  structure. */
+
+               if (f->flags & ACC_FINAL) {
+                       f->value = NEW(imm_union);
+                       /* XXX hack */
+                       f->value->l = 0;
+               }
+
+               switch (f->type) {
+               case TYPE_ADR:
+                       c->flags |= ACC_CLASS_HAS_POINTERS;
+                       break;
+               }
+       }
+
+       /* read attributes */
+
+       if (!suck_check_classbuffer_size(cb, 2))
+               return false;
+
+       attrnum = suck_u2(cb);
+
+       for (i = 0; i < attrnum; i++) {
+               if (!suck_check_classbuffer_size(cb, 2))
+                       return false;
+
+               if (!(u = (utf*) class_getconstant(c, suck_u2(cb), CONSTANT_Utf8)))
+                       return false;
+
+               if (u == utf_ConstantValue) {
+                       if (!suck_check_classbuffer_size(cb, 4 + 2))
+                               return false;
+
+                       /* check attribute length */
+
+                       if (suck_u4(cb) != 2) {
+                               exceptions_throw_classformaterror(c, "Wrong size for VALUE attribute");
+                               return false;
+                       }
+
+                       /* constant value attribute */
+
+                       if (pindex != field_load_NOVALUE) {
+                               exceptions_throw_classformaterror(c, "Multiple ConstantValue attributes");
+                               return false;
+                       }
+
+                       /* index of value in constantpool */
+
+                       pindex = suck_u2(cb);
+
+                       /* initialize field with value from constantpool */
+
+                       switch (f->type) {
+                       case TYPE_INT: {
+                               constant_integer *ci; 
+
+                               if (!(ci = (constant_integer*) class_getconstant(c, pindex, CONSTANT_Integer)))
+                                       return false;
+
+                               f->value->i = ci->value;
+                       }
+                       break;
+
+                       case TYPE_LNG: {
+                               constant_long *cl; 
+
+                               if (!(cl = (constant_long*) class_getconstant(c, pindex, CONSTANT_Long)))
+                                       return false;
+
+                               f->value->l = cl->value;
+                       }
+                       break;
+
+                       case TYPE_FLT: {
+                               constant_float *cf;
+
+                               if (!(cf = (constant_float*) class_getconstant(c, pindex, CONSTANT_Float)))
+                                       return false;
+
+                               f->value->f = cf->value;
+                       }
+                       break;
+
+                       case TYPE_DBL: {
+                               constant_double *cd;
+
+                               if (!(cd = (constant_double*) class_getconstant(c, pindex, CONSTANT_Double)))
+                                       return false;
+
+                               f->value->d = cd->value;
+                       }
+                       break;
+
+                       case TYPE_ADR:
+                               if (!(u = (utf*) class_getconstant(c, pindex, CONSTANT_String)))
+                                       return false;
+
+                               /* Create Java-string from compressed UTF8-string. */
+
+                               f->value->a = literalstring_new(u);
+                               break;
+
+                       default: 
+                               vm_abort("field_load: invalid field type %d", f->type);
+                       }
+               }
+#if defined(ENABLE_JAVASE)
+               else if (u == utf_Signature) {
+                       /* Signature */
+
+                       if (!loader_load_attribute_signature(cb, &(f->signature)))
+                               return false;
+               }
+
+#if defined(ENABLE_ANNOTATIONS)
+               else if (u == utf_RuntimeVisibleAnnotations) {
+                       /* RuntimeVisibleAnnotations */
+                       if (!annotation_load_field_attribute_runtimevisibleannotations(cb, f))
+                               return false;
+               }
+               else if (u == utf_RuntimeInvisibleAnnotations) {
+                       /* RuntimeInvisibleAnnotations */
+                       if (!annotation_load_field_attribute_runtimeinvisibleannotations(cb, f))
+                               return false;
+               }
+#endif
+#endif
+               else {
+                       /* unknown attribute */
+
+                       if (!loader_skip_attribute_body(cb))
+                               return false;
+               }
+       }
+
+       /* everything was ok */
+
+       return true;
+}
+
+
+/* field_get_type **************************************************************
+
+   Returns the type of the field as class.
+
+*******************************************************************************/
+
+classinfo *field_get_type(fieldinfo *f)
+{
+       typedesc  *td;
+       utf       *u;
+       classinfo *c;
+
+       td = f->parseddesc;
+
+       if (td->type == TYPE_ADR) {
+               assert(td->classref);
+
+               u = td->classref->name;
+
+               /* load the class of the field-type with the field's
+                  classloader */
+
+               c = load_class_from_classloader(u, f->clazz->classloader);
+       }
+       else {
+               c = Primitive::get_class_by_type(td->primitivetype);
+       }
+
+       return c;
+}
+
+
+/* field_free ******************************************************************
+
+   Frees a fields' resources.
+
+*******************************************************************************/
+
+void field_free(fieldinfo *f)
+{
+       /* free memory for fields which have a value */
+
+       if (f->value)
+#if defined(ENABLE_GC_BOEHM)
+               if (f->type != TYPE_ADR)
+#endif
+                       FREE(f->value, imm_union);
+}
+
+
+/* field_get_annotations ******************************************************
+
+   Get a fields' unparsed annotations in a byte array.
+
+   IN:
+       f........the field of which the annotations should be returned
+
+   RETURN VALUE:
+       The unparsed annotations in a byte array (or NULL if there aren't any).
+
+*******************************************************************************/
+
+java_handle_bytearray_t *field_get_annotations(fieldinfo *f)
+{
+#if defined(ENABLE_ANNOTATIONS)
+       classinfo               *c;           /* declaring class           */
+       int                      slot;        /* slot of this field        */
+       java_handle_bytearray_t *annotations; /* unparsed annotations      */
+       java_handle_t           *field_annotations;  /* array of unparsed  */
+                      /* annotations of all fields of the declaring class */
+
+       c           = f->clazz;
+       slot        = f - c->fields;
+       annotations = NULL;
+
+       LLNI_classinfo_field_get(c, field_annotations, field_annotations);
+
+       /* the field_annotations array might be shorter then the field
+        * count if the fields above a certain index have no annotations.
+        */
+       if (field_annotations != NULL &&
+               array_length_get(field_annotations) > slot) {
+               annotations = (java_handle_bytearray_t*)array_objectarray_element_get(
+                               (java_handle_objectarray_t*)field_annotations, slot);
+       }
+       
+       return annotations;
+#else
+       return NULL;
+#endif
+}
+
+
+/* field_printflags ************************************************************
+
+   (debugging only)
+
+*******************************************************************************/
+
+#if !defined(NDEBUG)
+void field_printflags(fieldinfo *f)
+{
+       if (f == NULL) {
+               printf("NULL");
+               return;
+       }
+
+       if (f->flags & ACC_PUBLIC)       printf(" PUBLIC");
+       if (f->flags & ACC_PRIVATE)      printf(" PRIVATE");
+       if (f->flags & ACC_PROTECTED)    printf(" PROTECTED");
+       if (f->flags & ACC_STATIC)       printf(" STATIC");
+       if (f->flags & ACC_FINAL)        printf(" FINAL");
+       if (f->flags & ACC_SYNCHRONIZED) printf(" SYNCHRONIZED");
+       if (f->flags & ACC_VOLATILE)     printf(" VOLATILE");
+       if (f->flags & ACC_TRANSIENT)    printf(" TRANSIENT");
+       if (f->flags & ACC_NATIVE)       printf(" NATIVE");
+       if (f->flags & ACC_INTERFACE)    printf(" INTERFACE");
+       if (f->flags & ACC_ABSTRACT)     printf(" ABSTRACT");
+}
+#endif
+
+
+/* field_print *****************************************************************
+
+   (debugging only)
+
+*******************************************************************************/
+
+#if !defined(NDEBUG)
+void field_print(fieldinfo *f)
+{
+       if (f == NULL) {
+               printf("(fieldinfo*)NULL");
+               return;
+       }
+
+       utf_display_printable_ascii_classname(f->clazz->name);
+       printf(".");
+       utf_display_printable_ascii(f->name);
+       printf(" ");
+       utf_display_printable_ascii(f->descriptor);     
+
+       field_printflags(f);
+
+       if (!(f->flags & ACC_STATIC)) {
+               printf(", offset: %d", f->offset);
+       }
+}
+#endif
+
+
+/* field_println ***************************************************************
+
+   (debugging only)
+
+*******************************************************************************/
+
+#if !defined(NDEBUG)
+void field_println(fieldinfo *f)
+{
+       field_print(f);
+       printf("\n");
+}
+#endif
+
+/* field_fieldref_print ********************************************************
+
+   (debugging only)
+
+*******************************************************************************/
+
+#if !defined(NDEBUG)
+void field_fieldref_print(constant_FMIref *fr)
+{
+       if (fr == NULL) {
+               printf("(constant_FMIref *)NULL");
+               return;
+       }
+
+       if (IS_FMIREF_RESOLVED(fr)) {
+               printf("<field> ");
+               field_print(fr->p.field);
+       }
+       else {
+               printf("<fieldref> ");
+               utf_display_printable_ascii_classname(fr->p.classref->name);
+               printf(".");
+               utf_display_printable_ascii(fr->name);
+               printf(" ");
+               utf_display_printable_ascii(fr->descriptor);
+       }
+}
+#endif
+
+/* field_fieldref_println ******************************************************
+
+   (debugging only)
+
+*******************************************************************************/
+
+#if !defined(NDEBUG)
+void field_fieldref_println(constant_FMIref *fr)
+{
+       field_fieldref_print(fr);
+       printf("\n");
+}
+#endif
+
+/*
+ * These are local overrides for various environment variables in Emacs.
+ * Please do not remove this and leave it at the end of the file, where
+ * Emacs will automagically detect them.
+ * ---------------------------------------------------------------------
+ * Local variables:
+ * mode: c
+ * indent-tabs-mode: t
+ * c-basic-offset: 4
+ * tab-width: 4
+ * End:
+ * vim:noexpandtab:sw=4:ts=4:
+ */
diff --git a/src/vm/field.h b/src/vm/field.h
deleted file mode 100644 (file)
index 80a5aa1..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/* src/vm/field.h - field functions header
-
-   Copyright (C) 1996-2005, 2006, 2007, 2008
-   CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
-
-   This file is part of CACAO.
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2, or (at
-   your option) any later version.
-
-   This program is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-   02110-1301, USA.
-
-*/
-
-
-#ifndef _FIELD_H
-#define _FIELD_H
-
-/* forward typedefs ***********************************************************/
-
-typedef struct fieldinfo fieldinfo; 
-
-
-#include "config.h"
-#include "vm/types.h"
-
-#include "vm/descriptor.h"
-#include "vm/class.h"
-#include "vm/global.h"
-#include "vm/loader.hpp"
-#include "vm/references.h"
-#include "vm/utf8.h"
-
-
-/* fieldinfo ******************************************************************/
-
-struct fieldinfo {           /* field of a class                                 */
-
-       /* CAUTION: The first field must be a pointer that is never the same      */
-       /*          value as CLASSREF_PSEUDO_VFTBL! This is used to check whether */
-       /*          a constant_FMIref has been resolved.                          */
-
-       classinfo *clazz;     /* needed by typechecker. Could be optimized        */
-                             /* away by using constant_FMIref instead of         */
-                             /* fieldinfo throughout the compiler.               */
-
-       s4         flags;     /* ACC flags                                        */
-       s4         type;      /* basic data type                                  */
-       utf       *name;      /* name of field                                    */
-       utf       *descriptor;/* JavaVM descriptor string of field                */
-       utf       *signature; /* Signature attribute string                       */
-       typedesc  *parseddesc;/* parsed descriptor                                */
-
-       int32_t    offset;    /* offset from start of object (instance variables) */
-       imm_union *value;     /* storage for static values (class variables)      */
-};
-
-
-/* function prototypes ********************************************************/
-
-bool       field_load(classbuffer *cb, fieldinfo *f, descriptor_pool *descpool);
-classinfo *field_get_type(fieldinfo *f);
-void       field_free(fieldinfo *f);
-
-java_handle_bytearray_t *field_get_annotations(fieldinfo *f);
-
-#if !defined(NDEBUG)
-void field_printflags(fieldinfo *f);
-void field_print(fieldinfo *f);
-void field_println(fieldinfo *f);
-void field_fieldref_print(constant_FMIref *fr);
-void field_fieldref_println(constant_FMIref *fr);
-#endif
-
-#endif /* _FIELD_H */
-
-
-/*
- * These are local overrides for various environment variables in Emacs.
- * Please do not remove this and leave it at the end of the file, where
- * Emacs will automagically detect them.
- * ---------------------------------------------------------------------
- * Local variables:
- * mode: c
- * indent-tabs-mode: t
- * c-basic-offset: 4
- * tab-width: 4
- * End:
- */
diff --git a/src/vm/field.hpp b/src/vm/field.hpp
new file mode 100644 (file)
index 0000000..7904fdf
--- /dev/null
@@ -0,0 +1,99 @@
+/* src/vm/field.hpp - field functions header
+
+   Copyright (C) 1996-2005, 2006, 2007, 2008
+   CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
+
+   This file is part of CACAO.
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2, or (at
+   your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+*/
+
+
+#ifndef _FIELD_HPP
+#define _FIELD_HPP
+
+/* forward typedefs ***********************************************************/
+
+typedef struct fieldinfo fieldinfo; 
+
+
+#include "config.h"
+#include "vm/types.h"
+
+#include "vm/descriptor.h"
+#include "vm/class.h"
+#include "vm/global.h"
+#include "vm/loader.hpp"
+#include "vm/references.h"
+#include "vm/utf8.h"
+
+
+/* fieldinfo ******************************************************************/
+
+struct fieldinfo {           /* field of a class                                 */
+
+       /* CAUTION: The first field must be a pointer that is never the same      */
+       /*          value as CLASSREF_PSEUDO_VFTBL! This is used to check whether */
+       /*          a constant_FMIref has been resolved.                          */
+
+       classinfo *clazz;     /* needed by typechecker. Could be optimized        */
+                             /* away by using constant_FMIref instead of         */
+                             /* fieldinfo throughout the compiler.               */
+
+       s4         flags;     /* ACC flags                                        */
+       s4         type;      /* basic data type                                  */
+       utf       *name;      /* name of field                                    */
+       utf       *descriptor;/* JavaVM descriptor string of field                */
+       utf       *signature; /* Signature attribute string                       */
+       typedesc  *parseddesc;/* parsed descriptor                                */
+
+       int32_t    offset;    /* offset from start of object (instance variables) */
+       imm_union *value;     /* storage for static values (class variables)      */
+};
+
+
+/* function prototypes ********************************************************/
+
+bool       field_load(classbuffer *cb, fieldinfo *f, descriptor_pool *descpool);
+classinfo *field_get_type(fieldinfo *f);
+void       field_free(fieldinfo *f);
+
+java_handle_bytearray_t *field_get_annotations(fieldinfo *f);
+
+#if !defined(NDEBUG)
+void field_printflags(fieldinfo *f);
+void field_print(fieldinfo *f);
+void field_println(fieldinfo *f);
+void field_fieldref_print(constant_FMIref *fr);
+void field_fieldref_println(constant_FMIref *fr);
+#endif
+
+#endif /* _FIELD_HPP */
+
+
+/*
+ * These are local overrides for various environment variables in Emacs.
+ * Please do not remove this and leave it at the end of the file, where
+ * Emacs will automagically detect them.
+ * ---------------------------------------------------------------------
+ * Local variables:
+ * mode: c
+ * indent-tabs-mode: t
+ * c-basic-offset: 4
+ * tab-width: 4
+ * End:
+ */
index cc7d164a7d474b317fdb4da67b8137e83b0bb76b..4ecd9dd497e8f95ad24822050c3786081a928aa6 100644 (file)
@@ -34,7 +34,7 @@
 #include "native/llni.h"
 
 #include "vm/class.h"
-#include "vm/field.h"
+#include "vm/field.hpp"
 #include "vm/global.h"
 #include "vm/globals.hpp"
 #include "vm/method.h"
index 9af3e4449eb4bfb4d487aaeb46ea94e9a2fb9b8b..d57361b6c5527ccfc7dc20951e6947210648dc9e 100644 (file)
@@ -37,7 +37,7 @@
 
 #include "vm/jit/builtin.hpp"
 #include "vm/class.h"
-#include "vm/field.h"
+#include "vm/field.hpp"
 #include "vm/initialize.h"
 #include "vm/options.h"
 #include "vm/references.h"
index 2357374c586f8e1d4bf19b733b312f5a1992caa9..d36fe15814f97deb4bd805c88e628e4a07d6f65c 100644 (file)
@@ -39,7 +39,7 @@
 
 #include "vm/jit/builtin.hpp"
 #include "vm/class.h"
-#include "vm/field.h"
+#include "vm/field.hpp"
 #include "vm/initialize.h"
 #include "vm/options.h"
 #include "vm/references.h"
index 6778854fe50f597898fceee2ca9d310572cddc90..30baa1a2fa6cf9dfcc4584edddd5fc75d730532c 100644 (file)
@@ -38,7 +38,7 @@
 
 #include "vm/jit/builtin.hpp"
 #include "vm/class.h"
-#include "vm/field.h"
+#include "vm/field.hpp"
 #include "vm/initialize.h"
 #include "vm/options.h"
 #include "vm/references.h"
index 4c14aa5ee4a36da70b9f6e4dc102d477ed98a87b..2899588285fbd9c991101b54eb6ae0013f8f9322 100644 (file)
@@ -32,7 +32,7 @@
 
 #include "vm/jit/builtin.hpp"
 #include "vm/class.h"
-#include "vm/field.h"
+#include "vm/field.hpp"
 #include "vm/initialize.h"
 #include "vm/options.h"
 #include "vm/references.h"
index 5ebb95395ce6ef621f30bbcf435261fa5e6dcfe5..61e0a18fb3c6bbd01e1535df1189e5450271a856 100644 (file)
@@ -36,7 +36,7 @@
 
 #include "vm/jit/builtin.hpp"
 #include "vm/class.h"
-#include "vm/field.h"
+#include "vm/field.hpp"
 #include "vm/initialize.h"
 #include "vm/options.h"
 #include "vm/references.h"
index de6c2418184472c3479b4b638fe9ddecae547dd1..be0e14d87c1a0b50909b8fe66442c2fecc2b80aa 100644 (file)
@@ -37,7 +37,7 @@
 
 #include "vm/jit/builtin.hpp"
 #include "vm/class.h"
-#include "vm/field.h"
+#include "vm/field.hpp"
 #include "vm/initialize.h"
 #include "vm/options.h"
 #include "vm/references.h"
index 581833fdcfadbc0cf83468372fb2583c353fb235..282d8e08f7a7f44a3c899d62ba9299477ef09ed5 100644 (file)
@@ -38,7 +38,7 @@
 
 #include "vm/jit/builtin.hpp"
 #include "vm/class.h"
-#include "vm/field.h"
+#include "vm/field.hpp"
 #include "vm/initialize.h"
 #include "vm/options.h"
 #include "vm/references.h"
index 8d79587ae62f33b53079419cbaaa5987d51cdac1..ce22cf1ad185c8da748f4cec66e510c6cdf7fb14 100644 (file)
@@ -38,7 +38,7 @@
 
 #include "vm/jit/builtin.hpp"
 #include "vm/class.h"
-#include "vm/field.h"
+#include "vm/field.hpp"
 #include "vm/initialize.h"
 #include "vm/options.h"
 #include "vm/references.h"
index bd9c5e2e8770d426109dcc12ef17b0c569316ff0..ba9eea9790f37f9a6c695e74130ae17f1b7a4e4b 100644 (file)
@@ -33,7 +33,7 @@
 
 #include "vm/jit/builtin.hpp"
 #include "vm/class.h"
-#include "vm/field.h"
+#include "vm/field.hpp"
 #include "vm/initialize.h"
 #include "vm/options.h"
 #include "vm/references.h"
index b1510a72aeeae8aa58c7b215fc4c94098694e980..2d9cc8da91bb3d2e1c0d18007ce8f03af68ef85b 100644 (file)
@@ -41,7 +41,7 @@
 #include "vm/jit/builtin.hpp"
 #include "vm/class.h"
 #include "vm/exceptions.hpp"
-#include "vm/field.h"
+#include "vm/field.hpp"
 #include "vm/initialize.h"
 #include "vm/options.h"
 #include "vm/references.h"
index 3c8a813393bd7ffc3115c7edec41ed8b470d059d..41ed1c08b82194fc86c864ae4cadbc1b4aed7891 100644 (file)
@@ -38,7 +38,7 @@
 
 #include "vm/jit/builtin.hpp"
 #include "vm/class.h"
-#include "vm/field.h"
+#include "vm/field.hpp"
 #include "vm/initialize.h"
 #include "vm/options.h"
 #include "vm/references.h"
index 71d5e9c7e8a1c0c52d797b18e192199c9cf4b502..b89883837b9c6c8ffaa6cdccfe72af7a9394ca83 100644 (file)
@@ -44,7 +44,7 @@
 #include "vm/jit/builtin.hpp"
 #include "vm/classcache.h"
 #include "vm/exceptions.hpp"
-#include "vm/field.h"
+#include "vm/field.hpp"
 #include "vm/global.h"
 #include "vm/globals.hpp"
 #include "vm/linker.h"
index fe3af07016409a9e92d074eab345622e1dc4f36d..576a9049600e38abb77a8654f07c1991f92398dd 100644 (file)
@@ -63,7 +63,7 @@ typedef union parseddesc {
 
 #include "vm/class.h"
 #include "vm/descriptor.h"
-#include "vm/field.h"
+#include "vm/field.hpp"
 #include "vm/global.h"
 #include "vm/method.h"
 #include "vm/utf8.h"
index 2f9d5b305c92f650e6b5007f1e620fa294adb95c..cfa0b9205c28344509c5d074c434db000c23de70 100644 (file)
@@ -38,7 +38,7 @@ typedef struct unresolved_subtype_set unresolved_subtype_set;
 #include "vm/types.h"
 
 #include "vm/class.h"
-#include "vm/field.h"
+#include "vm/field.hpp"
 #include "vm/global.h"
 #include "vm/method.h"
 #include "vm/references.h"
index d5756ee4fd84cdef348e97f489381e2cd86b7ece..9b4720713239846b767ca841a5a20c27dc6d41df 100644 (file)
@@ -47,7 +47,7 @@
 #include "toolbox/logging.h"
 
 #include "vm/class.h"
-#include "vm/field.h"
+#include "vm/field.hpp"
 #include "vm/global.h"
 #include "vm/method.h"
 #include "vm/options.h"