* src/vmcore/primitive.c: Removed.
authortwisti <none@none>
Fri, 10 Aug 2007 15:12:00 +0000 (15:12 +0000)
committertwisti <none@none>
Fri, 10 Aug 2007 15:12:00 +0000 (15:12 +0000)
* src/vmcore/primitive.h: Likewise.

* src/vmcore/Makefile.am (libvmcore_la_SOURCES): Removed
primitive.[ch].

* src/vmcore/primitivecore.c: New file.
* src/vm/primitive.c: Likwise.
* src/vm/primitive.h: Likewise.

* src/vm/Makefile.am (libvm_la_SOURCES): Added primitive.[ch].

* src/cacaoh/dummy.c (vm/primitive.h): Added.
(primitive_class_get_by_type): New function.
(primitive_class_get_by_char): Likewise.

* src/native/jni.c,
src/native/vm/gnu/java_lang_VMClassLoader.c,
src/native/vm/gnu/java_lang_reflect_Field.c,
src/native/vm/java_lang_Class.c,
src/native/vm/sun/jvm.c,
src/vm/builtin.c,
src/vm/jit/verify/typecheck-stackbased.c,
src/vm/jit/verify/typecheck-typeinferer.c,
src/vm/jit/verify/typecheck.c,
src/vm/jit/verify/typeinfo.c,
src/vm/resolve.c,
src/vm/string.c,
src/vm/vm.c,
src/vmcore/descriptor.c,
src/vmcore/field.c,
src/vmcore/linker.c,
src/vmcore/loader.c: Changed primitive.h include.

--HG--
rename : src/vmcore/primitive.c => src/vmcore/primitivecore.c

25 files changed:
src/cacaoh/dummy.c
src/native/jni.c
src/native/vm/gnu/java_lang_VMClassLoader.c
src/native/vm/gnu/java_lang_reflect_Field.c
src/native/vm/java_lang_Class.c
src/native/vm/sun/jvm.c
src/vm/Makefile.am
src/vm/builtin.c
src/vm/jit/verify/typecheck-stackbased.c
src/vm/jit/verify/typecheck-typeinferer.c
src/vm/jit/verify/typecheck.c
src/vm/jit/verify/typeinfo.c
src/vm/primitive.c [new file with mode: 0644]
src/vm/primitive.h [new file with mode: 0644]
src/vm/resolve.c
src/vm/string.c
src/vm/vm.c
src/vmcore/Makefile.am
src/vmcore/descriptor.c
src/vmcore/field.c
src/vmcore/linker.c
src/vmcore/loader.c
src/vmcore/primitive.c [deleted file]
src/vmcore/primitive.h [deleted file]
src/vmcore/primitivecore.c [new file with mode: 0644]

index e1ef57ec68c6e4a5d73d586acff857038acf51e8..6b3272fcec7609eaaa1d37c2f2274daf330572b6 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: dummy.c 8236 2007-07-27 10:18:17Z twisti $
+   $Id: dummy.c 8288 2007-08-10 15:12:00Z twisti $
 
 */
 
@@ -38,6 +38,7 @@
 #include "toolbox/logging.h"
 
 #include "vm/global.h"
+#include "vm/primitive.h"
 #include "vm/vm.h"
 
 #include "vmcore/class.h"
@@ -456,6 +457,21 @@ int32_t dump_size(void)
 }
 
 
+/* primitive ******************************************************************/
+
+classinfo *primitive_class_get_by_type(int type)
+{
+       abort();
+       return NULL;
+}
+
+classinfo *primitive_class_get_by_char(char ch)
+{
+       abort();
+       return NULL;
+}
+
+
 /* properties *****************************************************************/
 
 void properties_add(char *key, char *value)
index e8c0f74e2f921cb0df54cbea39c376d690fd2a84..99b518b8e635e72b24ae17494a2de6541c70c1f3 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: jni.c 8287 2007-08-10 15:10:29Z twisti $
+   $Id: jni.c 8288 2007-08-10 15:12:00Z twisti $
 
 */
 
 #include "vm/exceptions.h"
 #include "vm/global.h"
 #include "vm/initialize.h"
+#include "vm/primitive.h"
 #include "vm/resolve.h"
 #include "vm/stringlocal.h"
 #include "vm/vm.h"
 
 #include "vmcore/loader.h"
 #include "vmcore/options.h"
-#include "vmcore/primitive.h"
 #include "vmcore/statistics.h"
 
 
index b664bf5194a6781b796bf08d586107f2ac3b04b2..d9f97608c2cc494926ea76975a8faf7e27f21d96 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: java_lang_VMClassLoader.c 8062 2007-06-11 08:12:14Z twisti $
+   $Id: java_lang_VMClassLoader.c 8288 2007-08-10 15:12:00Z twisti $
 
 */
 
@@ -52,6 +52,7 @@
 #include "vm/builtin.h"
 #include "vm/exceptions.h"
 #include "vm/initialize.h"
+#include "vm/primitive.h"
 #include "vm/stringlocal.h"
 #include "vm/vm.h"
 
@@ -62,7 +63,6 @@
 #include "vmcore/linker.h"
 #include "vmcore/loader.h"
 #include "vmcore/options.h"
-#include "vmcore/primitive.h"
 #include "vmcore/statistics.h"
 #include "vmcore/suck.h"
 #include "vmcore/zip.h"
index 8d4c3780131eedcb235acd5b9906d05e0a181173..ef9e22078ab976c9b461fe1e3302a091c5331c1d 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: java_lang_reflect_Field.c 8284 2007-08-10 08:58:39Z michi $
+   $Id: java_lang_reflect_Field.c 8288 2007-08-10 15:12:00Z twisti $
 
 */
 
 #include "vm/exceptions.h"
 #include "vm/global.h"
 #include "vm/initialize.h"
+#include "vm/primitive.h"
 #include "vm/resolve.h"
 #include "vm/stringlocal.h"
 
 #include "vm/jit/stacktrace.h"
 
 #include "vmcore/loader.h"
-#include "vmcore/primitive.h"
 #include "vmcore/utf8.h"
 
 
index acdb88360db51740c2b132d40812f7b18fa1cd67..5a7a37b683c0a62e6df54ed9178a9a9dfe322cdc 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: java_lang_Class.c 8284 2007-08-10 08:58:39Z michi $
+   $Id: java_lang_Class.c 8288 2007-08-10 15:12:00Z twisti $
 
 */
 
 #include "vm/exceptions.h"
 #include "vm/global.h"
 #include "vm/initialize.h"
+#include "vm/primitive.h"
 #include "vm/resolve.h"
 #include "vm/stringlocal.h"
 
 #include "vmcore/class.h"
 #include "vmcore/loader.h"
-#include "vmcore/primitive.h"
 
 #if defined(WITH_CLASSPATH_GNU) && defined(ENABLE_ANNOTATIONS)
 #include "vmcore/annotation.h"
index ce5cfea88e316a1f79b59acf66831a960f6eafa0..6b922c79a7ff51426d21712e52487c89516d8db4 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: jvm.c 8262 2007-08-06 12:44:01Z panzi $
+   $Id: jvm.c 8288 2007-08-10 15:12:00Z twisti $
 
 */
 
 #include "vm/builtin.h"
 #include "vm/exceptions.h"
 #include "vm/initialize.h"
+#include "vm/primitive.h"
 #include "vm/properties.h"
+#include "vm/resolve.h"
 #include "vm/stringlocal.h"
 #include "vm/vm.h"
-#include "vm/resolve.h"
 
 #include "vm/jit/stacktrace.h"
 
 #include "vmcore/classcache.h"
 #include "vmcore/options.h"
-#include "vmcore/primitive.h"
 
 
 /* debugging macro ************************************************************/
index 96c6400358fc3c44ec16046aa14e4f662d312197..9659f3127c6d6b50921650fe553cf416b1bac146 100644 (file)
@@ -22,7 +22,7 @@
 ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 ## 02110-1301, USA.
 ##
-## $Id: Makefile.am 7869 2007-05-05 08:08:49Z pm $
+## $Id: Makefile.am 8288 2007-08-10 15:12:00Z twisti $
 
 ## Process this file with automake to produce Makefile.in
 
@@ -59,6 +59,8 @@ libvm_la_SOURCES = \
        initialize.c \
        initialize.h \
        jit_interface.h \
+       primitive.c \
+       primitive.h \
        properties.c \
        properties.h \
        resolve.c \
index d898157e31edf3627682ff40a62151fecb5b755e..76662b7f9b0870a2133bcc585d381662fdeeb9fb 100644 (file)
@@ -28,7 +28,7 @@
    calls instead of machine instructions, using the C calling
    convention.
 
-   $Id: builtin.c 8284 2007-08-10 08:58:39Z michi $
+   $Id: builtin.c 8288 2007-08-10 15:12:00Z twisti $
 
 */
 
@@ -69,6 +69,7 @@
 #include "vm/exceptions.h"
 #include "vm/global.h"
 #include "vm/initialize.h"
+#include "vm/primitive.h"
 #include "vm/stringlocal.h"
 
 #include "vm/jit/asmpart.h"
@@ -77,7 +78,6 @@
 #include "vmcore/linker.h"
 #include "vmcore/loader.h"
 #include "vmcore/options.h"
-#include "vmcore/primitive.h"
 #include "vmcore/rt-timing.h"
 
 #if defined(ENABLE_VMLOG)
index 9d3cd85435348f51009d5bc69d660fb6b871c417..0a8007e4ade3c5d31288fab3c20b92130fdacf32 100644 (file)
 #include "mm/memory.h"
 
 #include "vm/global.h"
+#include "vm/primitive.h"
 
 #include "vm/jit/parse.h"
 #include "vm/jit/show.h"
 #include "vm/jit/stack.h"
 #include "vm/jit/verify/typecheck-common.h"
 
-#include "vmcore/primitive.h"
-
 
 /* this #if runs over the whole file: */
 #if defined(ENABLE_VERIFIER)
index e3620f9b94b5e0b1583f6a8ccded97d5ef4e3fe5..2dacbd54d559ba9efd34a49763f2abd176a76e4c 100644 (file)
@@ -42,6 +42,7 @@
 #include "vm/access.h"
 #include "vm/builtin.h"
 #include "vm/exceptions.h"
+#include "vm/primitive.h"
 #include "vm/resolve.h"
 #include "vm/vm.h"
 
@@ -53,7 +54,6 @@
 
 #include "vmcore/loader.h"
 #include "vmcore/options.h"
-#include "vmcore/primitive.h"
 
 #define TYPECHECK_NO_STATISTICS
 #include <typecheck-common.h>
index fab2c184d65958a4f6745e3f66844342c6a74e48..a97fec3fa4ebf9b81942836dc14e976da29c2a37 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: typecheck.c 8159 2007-06-28 00:31:31Z michi $
+   $Id: typecheck.c 8288 2007-08-10 15:12:00Z twisti $
 
 */
 
@@ -155,6 +155,7 @@ error reporting.
 #include "vm/builtin.h"
 #include "vm/exceptions.h"
 #include "vm/global.h"
+#include "vm/primitive.h"
 #include "vm/resolve.h"
 
 #include "vm/jit/jit.h"
@@ -163,7 +164,6 @@ error reporting.
 
 #include "vmcore/loader.h"
 #include "vmcore/options.h"
-#include "vmcore/primitive.h"
 
 #include <typecheck-common.h>
 
index 8e32e146036a59e90008ce31d280f937965fc0af..c381f3637665cf991a31416a77f1b35851eb1be5 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: typeinfo.c 8123 2007-06-20 23:50:55Z michi $
+   $Id: typeinfo.c 8288 2007-08-10 15:12:00Z twisti $
 
 */
 
@@ -36,6 +36,7 @@
 #include "toolbox/logging.h"
 
 #include "vm/exceptions.h"
+#include "vm/primitive.h"
 #include "vm/resolve.h"
 
 #include "vm/jit/jit.h"
@@ -44,7 +45,6 @@
 #include "vmcore/class.h"
 #include "vmcore/descriptor.h"
 #include "vmcore/loader.h"
-#include "vmcore/primitive.h"
 
 
 /* check if a linked class is an array class. Only use for linked classes! */
diff --git a/src/vm/primitive.c b/src/vm/primitive.c
new file mode 100644 (file)
index 0000000..6ece390
--- /dev/null
@@ -0,0 +1,169 @@
+/* src/vm/primitive.c - primitive types
+
+   Copyright (C) 2007 R. Grafl, A. Krall, C. Kruegel,
+   C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
+   E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
+   J. Wenninger, Institut f. Computersprachen - TU Wien
+
+   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.
+
+   $Id: linker.c 8042 2007-06-07 17:43:29Z twisti $
+
+*/
+
+
+#include "config.h"
+
+#include <assert.h>
+#include <stdint.h>
+
+#include "vm/global.h"
+#include "vm/primitive.h"
+
+#include "vmcore/class.h"
+#include "vmcore/utf8.h"
+
+
+/* primitive_class_get_by_name *************************************************
+
+   Returns the primitive class of the given class name.
+
+*******************************************************************************/
+
+classinfo *primitive_class_get_by_name(utf *name)
+{
+       int i;
+
+       /* search table of primitive classes */
+
+       for (i = 0; i < PRIMITIVETYPE_COUNT; i++)
+               if (primitivetype_table[i].name == name)
+                       return primitivetype_table[i].class_primitive;
+
+       /* keep compiler happy */
+
+       return NULL;
+}
+
+
+/* primitive_class_get_by_type *************************************************
+
+   Returns the primitive class of the given type.
+
+*******************************************************************************/
+
+classinfo *primitive_class_get_by_type(int type)
+{
+       return primitivetype_table[type].class_primitive;
+}
+
+
+/* primitive_class_get_by_char *************************************************
+
+   Returns the primitive class of the given type.
+
+*******************************************************************************/
+
+classinfo *primitive_class_get_by_char(char ch)
+{
+       int index;
+
+       switch (ch) {
+       case 'I':
+               index = PRIMITIVETYPE_INT;
+               break;
+       case 'J':
+               index = PRIMITIVETYPE_LONG;
+               break;
+       case 'F':
+               index = PRIMITIVETYPE_FLOAT;
+               break;
+       case 'D':
+               index = PRIMITIVETYPE_DOUBLE;
+               break;
+       case 'B':
+               index = PRIMITIVETYPE_BYTE;
+               break;
+       case 'C':
+               index = PRIMITIVETYPE_CHAR;
+               break;
+       case 'S':
+               index = PRIMITIVETYPE_SHORT;
+               break;
+       case 'Z':
+               index = PRIMITIVETYPE_BOOLEAN;
+               break;
+       case 'V':
+               index = PRIMITIVETYPE_VOID;
+               break;
+       default:
+               return NULL;
+       }
+
+       return primitivetype_table[index].class_primitive;
+}
+
+
+/* primitive_arrayclass_get_by_name ********************************************
+
+   Returns the primitive array-class of the given primitive class
+   name.
+
+*******************************************************************************/
+
+classinfo *primitive_arrayclass_get_by_name(utf *name)
+{
+       int i;
+
+       /* search table of primitive classes */
+
+       for (i = 0; i < PRIMITIVETYPE_COUNT; i++)
+               if (primitivetype_table[i].name == name)
+                       return primitivetype_table[i].arrayclass;
+
+       /* keep compiler happy */
+
+       return NULL;
+}
+
+
+/* primitive_arrayclass_get_by_type ********************************************
+
+   Returns the primitive array-class of the given type.
+
+*******************************************************************************/
+
+classinfo *primitive_arrayclass_get_by_type(int type)
+{
+       return primitivetype_table[type].arrayclass;
+}
+
+
+/*
+ * 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/primitive.h b/src/vm/primitive.h
new file mode 100644 (file)
index 0000000..5a0d231
--- /dev/null
@@ -0,0 +1,131 @@
+/* src/vm/primitive.c - primitive types
+
+   Copyright (C) 2007 R. Grafl, A. Krall, C. Kruegel,
+   C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
+   E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
+   J. Wenninger, Institut f. Computersprachen - TU Wien
+
+   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.
+
+   $Id: linker.c 8042 2007-06-07 17:43:29Z twisti $
+
+*/
+
+
+#ifndef _PRIMITIVE_H
+#define _PRIMITIVE_H
+
+#include "config.h"
+
+#include <stdint.h>
+
+#include "vm/global.h"
+
+#include "vmcore/class.h"
+#include "vmcore/linker.h"
+#include "vmcore/utf8.h"
+
+
+/* primitive data types *******************************************************/
+
+/* These values are used in parsed descriptors and in some other
+   places were the different types handled internally as TYPE_INT have
+   to be distinguished. */
+
+#define PRIMITIVETYPE_COUNT  11  /* number of primitive types (+ dummies)     */
+
+/* CAUTION: Don't change the numerical values! These constants are
+   used as indices into the primitive type table. */
+
+#define PRIMITIVETYPE_INT     TYPE_INT
+#define PRIMITIVETYPE_LONG    TYPE_LNG
+#define PRIMITIVETYPE_FLOAT   TYPE_FLT
+#define PRIMITIVETYPE_DOUBLE  TYPE_DBL
+#define PRIMITIVETYPE_DUMMY1  TYPE_ADR     /* not used! */
+#define PRIMITIVETYPE_BYTE    5
+#define PRIMITIVETYPE_CHAR    6
+#define PRIMITIVETYPE_SHORT   7
+#define PRIMITIVETYPE_BOOLEAN 8
+#define PRIMITIVETYPE_DUMMY2  9            /* not used! */
+#define PRIMITIVETYPE_VOID    TYPE_VOID
+
+
+/* CAUTION: Don't change the numerical values! These constants (with
+   the exception of ARRAYTYPE_OBJECT) are used as indices in the
+   primitive type table. */
+
+#define ARRAYTYPE_INT         PRIMITIVETYPE_INT
+#define ARRAYTYPE_LONG        PRIMITIVETYPE_LONG
+#define ARRAYTYPE_FLOAT       PRIMITIVETYPE_FLOAT
+#define ARRAYTYPE_DOUBLE      PRIMITIVETYPE_DOUBLE
+#define ARRAYTYPE_BYTE        PRIMITIVETYPE_BYTE
+#define ARRAYTYPE_CHAR        PRIMITIVETYPE_CHAR
+#define ARRAYTYPE_SHORT       PRIMITIVETYPE_SHORT
+#define ARRAYTYPE_BOOLEAN     PRIMITIVETYPE_BOOLEAN
+#define ARRAYTYPE_OBJECT      PRIMITIVETYPE_VOID     /* don't use as index! */
+
+
+/* primitivetypeinfo **********************************************************/
+
+struct primitivetypeinfo {
+       char      *cname;                    /* char name of primitive class      */
+       utf       *name;                     /* name of primitive class           */
+       classinfo *class_wrap;               /* class for wrapping primitive type */
+       classinfo *class_primitive;          /* primitive class                   */
+       char      *wrapname;                 /* name of class for wrapping        */
+       char       typesig;                  /* one character type signature      */
+       char      *arrayname;                /* name of primitive array class     */
+       classinfo *arrayclass;               /* primitive array class             */
+};
+
+
+/* global variables ***********************************************************/
+
+/* This array can be indexed by the PRIMITIVETYPE_ and ARRAYTYPE_
+   constants (except ARRAYTYPE_OBJECT). */
+
+extern primitivetypeinfo primitivetype_table[PRIMITIVETYPE_COUNT];
+
+
+/* function prototypes ********************************************************/
+
+/* this function is in src/vmcore/primitivecore.c */
+bool       primitive_init(void);
+
+classinfo *primitive_class_get_by_name(utf *name);
+classinfo *primitive_class_get_by_type(int type);
+classinfo *primitive_class_get_by_char(char ch);
+classinfo *primitive_arrayclass_get_by_name(utf *name);
+classinfo *primitive_arrayclass_get_by_type(int type);
+
+#endif /* _PRIMITIVE_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:
+ * vim:noexpandtab:sw=4:ts=4:
+ */
index f608af7383b480308209b58e2d5b7fdf306d56d4..a02e120c9ff93185e673b727b00b7a33311f3290 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: resolve.c 8123 2007-06-20 23:50:55Z michi $
+   $Id: resolve.c 8288 2007-08-10 15:12:00Z twisti $
 
 */
 
@@ -38,6 +38,7 @@
 #include "vm/access.h"
 #include "vm/exceptions.h"
 #include "vm/global.h"
+#include "vm/primitive.h"
 #include "vm/resolve.h"
 
 #include "vm/jit/jit.h"
@@ -48,7 +49,6 @@
 #include "vmcore/linker.h"
 #include "vmcore/loader.h"
 #include "vmcore/options.h"
-#include "vmcore/primitive.h"
 
 
 /******************************************************************************/
index 6969a31f2b323979e3e7a57450d2e3129e73a6a3..d291704bef6b39d7376ed5f8fb4af95efefb5fbe 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: string.c 8284 2007-08-10 08:58:39Z michi $
+   $Id: string.c 8288 2007-08-10 15:12:00Z twisti $
 
 */
 
 
 #include "vm/builtin.h"
 #include "vm/exceptions.h"
+#include "vm/primitive.h"
 #include "vm/stringlocal.h"
 #include "vm/vm.h"
 
 #include "vmcore/options.h"
-#include "vmcore/primitive.h"
 #include "vmcore/statistics.h"
 #include "vmcore/utf8.h"
 
index 43f8c64f4b2c2ec4771c6e077dd641f95cb650b7..56d41a7ce0334c4d6812e7160a6fffc671f1cdf0 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: vm.c 8284 2007-08-10 08:58:39Z michi $
+   $Id: vm.c 8288 2007-08-10 15:12:00Z twisti $
 
 */
 
@@ -83,6 +83,7 @@
 #include "vm/finalizer.h"
 #include "vm/global.h"
 #include "vm/initialize.h"
+#include "vm/primitive.h"
 #include "vm/properties.h"
 #include "vm/signallocal.h"
 #include "vm/stringlocal.h"
 
 #include "vmcore/classcache.h"
 #include "vmcore/options.h"
-#include "vmcore/primitive.h"
 #include "vmcore/statistics.h"
 #include "vmcore/suck.h"
 
index 08734f08e26527426a56edbf4e690a33258b4f25..7a21b34fe85a072e8ee5a9718858ac55bb8d1523 100644 (file)
@@ -81,8 +81,7 @@ libvmcore_la_SOURCES = \
        method.h \
        options.c \
        options.h \
-       primitive.c \
-       primitive.h \
+       primitivecore.c \
        references.h \
        $(RT_TIMING_SOURCES) \
        $(STACKMAP_SOURCES) \
index 9fce46c62cf55397b4e59e3ad5c6d337ab6ceac4..a9b8a378bcc8f8f49dff9d22ebec919d50def5eb 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: descriptor.c 8233 2007-07-25 15:11:20Z twisti $
+   $Id: descriptor.c 8288 2007-08-10 15:12:00Z twisti $
 
 */
 
 
 #include "vm/exceptions.h"
 #include "vm/jit_interface.h"
+#include "vm/primitive.h"
 #include "vm/vm.h"
 
 #include "vmcore/descriptor.h"
-#include "vmcore/primitive.h"
 #include "vmcore/options.h"
 
 
index 2728851f503568b4dffa3829396064c40c20f953..98e29f2a6a6ebaee94f69dfc26c0fe30ca05759d 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: field.c 8268 2007-08-07 13:24:43Z twisti $
+   $Id: field.c 8288 2007-08-10 15:12:00Z twisti $
 
 */
 
@@ -41,6 +41,7 @@
 
 #include "vm/exceptions.h"
 #include "vm/global.h"
+#include "vm/primitive.h"
 #include "vm/stringlocal.h"
 #include "vm/vm.h"
 
@@ -50,7 +51,6 @@
 #include "vmcore/field.h"
 #include "vmcore/loader.h"
 #include "vmcore/options.h"
-#include "vmcore/primitive.h"
 #include "vmcore/references.h"
 #include "vmcore/suck.h"
 #include "vmcore/utf8.h"
index 1181b4aed680bd4d4881bf784c939007a4f0c742..8438109c7c5c1c3673970c93b99bf3a4feb5de01 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: linker.c 8286 2007-08-10 10:46:17Z michi $
+   $Id: linker.c 8288 2007-08-10 15:12:00Z twisti $
 
 */
 
@@ -43,6 +43,7 @@
 
 #include "vm/access.h"
 #include "vm/exceptions.h"
+#include "vm/primitive.h"
 #include "vm/stringlocal.h"
 #include "vm/vm.h"
 
@@ -52,7 +53,6 @@
 #include "vmcore/classcache.h"
 #include "vmcore/loader.h"
 #include "vmcore/options.h"
-#include "vmcore/primitive.h"
 #include "vmcore/rt-timing.h"
 
 /* #include "vm/resolve.h" */
index 62742a9b84016a1a28173a426c42051a0d9ae9d6..f2762b05e8bad051f31fc5a6873d1794365f6256 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: loader.c 8268 2007-08-07 13:24:43Z twisti $
+   $Id: loader.c 8288 2007-08-10 15:12:00Z twisti $
 
 */
 
@@ -44,6 +44,7 @@
 #include "vm/builtin.h"
 #include "vm/exceptions.h"
 #include "vm/global.h"
+#include "vm/primitive.h"
 #include "vm/stringlocal.h"
 #include "vm/vm.h"
 
@@ -60,7 +61,6 @@
 #include "vmcore/loader.h"
 #include "vmcore/method.h"
 #include "vmcore/options.h"
-#include "vmcore/primitive.h"
 #include "vmcore/rt-timing.h"
 
 #if defined(ENABLE_STATISTICS)
diff --git a/src/vmcore/primitive.c b/src/vmcore/primitive.c
deleted file mode 100644 (file)
index 8d39343..0000000
+++ /dev/null
@@ -1,282 +0,0 @@
-/* src/vmcore/primitive.c - primitive types
-
-   Copyright (C) 2007 R. Grafl, A. Krall, C. Kruegel,
-   C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
-   E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
-   J. Wenninger, Institut f. Computersprachen - TU Wien
-
-   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.
-
-   $Id: linker.c 8042 2007-06-07 17:43:29Z twisti $
-
-*/
-
-
-#include "config.h"
-
-#include <assert.h>
-#include <stdint.h>
-
-#include "vm/global.h"
-
-#include "vmcore/class.h"
-#include "vmcore/primitive.h"
-#include "vmcore/utf8.h"
-
-
-/* primitivetype_table *********************************************************
-
-   Structure for primitive classes: contains the class for wrapping
-   the primitive type, the primitive class, the name of the class for
-   wrapping, the one character type signature and the name of the
-   primitive class.
-   CAUTION: Don't change the order of the types. This table is indexed
-   by the ARRAYTYPE_ constants (except ARRAYTYPE_OBJECT).
-
-*******************************************************************************/
-
-primitivetypeinfo primitivetype_table[PRIMITIVETYPE_COUNT] = {
-       { "int"     , NULL, NULL, NULL, "java/lang/Integer",   'I', "[I", NULL },
-       { "long"    , NULL, NULL, NULL, "java/lang/Long",      'J', "[J", NULL },
-       { "float"   , NULL, NULL, NULL, "java/lang/Float",     'F', "[F", NULL },
-       { "double"  , NULL, NULL, NULL, "java/lang/Double",    'D', "[D", NULL },
-       { NULL      , NULL, NULL, NULL, NULL,                   0 , NULL, NULL },
-       { "byte"    , NULL, NULL, NULL, "java/lang/Byte",      'B', "[B", NULL },
-       { "char"    , NULL, NULL, NULL, "java/lang/Character", 'C', "[C", NULL },
-       { "short"   , NULL, NULL, NULL, "java/lang/Short",     'S', "[S", NULL },
-       { "boolean" , NULL, NULL, NULL, "java/lang/Boolean",   'Z', "[Z", NULL },
-       { NULL      , NULL, NULL, NULL, NULL,                   0 , NULL, NULL },
-#if defined(ENABLE_JAVASE)
-       { "void"    , NULL, NULL, NULL, "java/lang/Void",      'V', NULL, NULL }
-#else
-       { NULL      , NULL, NULL, NULL, NULL,                   0 , NULL, NULL },
-#endif
-};
-
-
-/* primitive_init **************************************************************
-
-   Create classes representing primitive types.
-
-*******************************************************************************/
-
-bool primitive_init(void)
-{  
-       utf       *name;
-       classinfo *c;
-       utf       *u;
-       int        i;
-
-       for (i = 0; i < PRIMITIVETYPE_COUNT; i++) {
-               /* skip dummies */
-
-               if (primitivetype_table[i].cname == NULL)
-                       continue;
-
-               /* create UTF-8 name */
-
-               name = utf_new_char(primitivetype_table[i].cname);
-
-               primitivetype_table[i].name = name;
-
-               /* create primitive class */
-
-               c = class_create_classinfo(name);
-
-               /* primitive classes don't have a super class */
-
-               c->super.any = NULL;
-
-               /* set flags and mark it as primitive class */
-
-               c->flags = ACC_PUBLIC | ACC_FINAL | ACC_ABSTRACT | ACC_CLASS_PRIMITIVE;
-               
-               /* prevent loader from loading primitive class */
-
-               c->state |= CLASS_LOADED;
-
-               /* INFO: don't put primitive classes into the classcache */
-
-               if (!link_class(c))
-                       return false;
-
-               primitivetype_table[i].class_primitive = c;
-
-               /* create class for wrapping the primitive type */
-
-               u = utf_new_char(primitivetype_table[i].wrapname);
-               c = load_class_bootstrap(u);
-
-               if (c == NULL)
-                       return false;
-
-               primitivetype_table[i].class_wrap = c;
-
-               /* create the primitive array class */
-
-               if (primitivetype_table[i].arrayname) {
-                       u = utf_new_char(primitivetype_table[i].arrayname);
-                       c = class_create_classinfo(u);
-                       c = load_newly_created_array(c, NULL);
-
-                       if (c == NULL)
-                               return false;
-
-                       primitivetype_table[i].arrayclass = c;
-
-                       assert(c->state & CLASS_LOADED);
-
-                       if (!(c->state & CLASS_LINKED))
-                               if (!link_class(c))
-                                       return false;
-               }
-       }
-
-       return true;
-}
-
-
-/* primitive_class_get_by_name *************************************************
-
-   Returns the primitive class of the given class name.
-
-*******************************************************************************/
-
-classinfo *primitive_class_get_by_name(utf *name)
-{
-       int i;
-
-       /* search table of primitive classes */
-
-       for (i = 0; i < PRIMITIVETYPE_COUNT; i++)
-               if (primitivetype_table[i].name == name)
-                       return primitivetype_table[i].class_primitive;
-
-       /* keep compiler happy */
-
-       return NULL;
-}
-
-
-/* primitive_class_get_by_type *************************************************
-
-   Returns the primitive class of the given type.
-
-*******************************************************************************/
-
-classinfo *primitive_class_get_by_type(int32_t type)
-{
-       return primitivetype_table[type].class_primitive;
-}
-
-
-/* primitive_class_get_by_char *************************************************
-
-   Returns the primitive class of the given type.
-
-*******************************************************************************/
-
-classinfo *primitive_class_get_by_char(char ch)
-{
-       int32_t index;
-
-       switch (ch) {
-       case 'I':
-               index = PRIMITIVETYPE_INT;
-               break;
-       case 'J':
-               index = PRIMITIVETYPE_LONG;
-               break;
-       case 'F':
-               index = PRIMITIVETYPE_FLOAT;
-               break;
-       case 'D':
-               index = PRIMITIVETYPE_DOUBLE;
-               break;
-       case 'B':
-               index = PRIMITIVETYPE_BYTE;
-               break;
-       case 'C':
-               index = PRIMITIVETYPE_CHAR;
-               break;
-       case 'S':
-               index = PRIMITIVETYPE_SHORT;
-               break;
-       case 'Z':
-               index = PRIMITIVETYPE_BOOLEAN;
-               break;
-       case 'V':
-               index = PRIMITIVETYPE_VOID;
-               break;
-       default:
-               return NULL;
-       }
-
-       return primitivetype_table[index].class_primitive;
-}
-
-
-/* primitive_arrayclass_get_by_name ********************************************
-
-   Returns the primitive array-class of the given primitive class
-   name.
-
-*******************************************************************************/
-
-classinfo *primitive_arrayclass_get_by_name(utf *name)
-{
-       int i;
-
-       /* search table of primitive classes */
-
-       for (i = 0; i < PRIMITIVETYPE_COUNT; i++)
-               if (primitivetype_table[i].name == name)
-                       return primitivetype_table[i].arrayclass;
-
-       /* keep compiler happy */
-
-       return NULL;
-}
-
-
-/* primitive_arrayclass_get_by_type ********************************************
-
-   Returns the primitive array-class of the given type.
-
-*******************************************************************************/
-
-classinfo *primitive_arrayclass_get_by_type(int32_t type)
-{
-       return primitivetype_table[type].arrayclass;
-}
-
-
-/*
- * 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/vmcore/primitive.h b/src/vmcore/primitive.h
deleted file mode 100644 (file)
index f9feb51..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-/* src/vmcore/primitive.c - primitive types
-
-   Copyright (C) 2007 R. Grafl, A. Krall, C. Kruegel,
-   C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
-   E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
-   J. Wenninger, Institut f. Computersprachen - TU Wien
-
-   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.
-
-   $Id: linker.c 8042 2007-06-07 17:43:29Z twisti $
-
-*/
-
-
-#ifndef _PRIMITIVE_H
-#define _PRIMITIVE_H
-
-#include "config.h"
-
-#include <stdint.h>
-
-#include "vm/global.h"
-
-#include "vmcore/class.h"
-#include "vmcore/linker.h"
-#include "vmcore/utf8.h"
-
-
-/* primitive data types *******************************************************/
-
-/* These values are used in parsed descriptors and in some other
-   places were the different types handled internally as TYPE_INT have
-   to be distinguished. */
-
-#define PRIMITIVETYPE_COUNT  11  /* number of primitive types (+ dummies)     */
-
-/* CAUTION: Don't change the numerical values! These constants are
-   used as indices into the primitive type table. */
-
-#define PRIMITIVETYPE_INT     TYPE_INT
-#define PRIMITIVETYPE_LONG    TYPE_LNG
-#define PRIMITIVETYPE_FLOAT   TYPE_FLT
-#define PRIMITIVETYPE_DOUBLE  TYPE_DBL
-#define PRIMITIVETYPE_DUMMY1  TYPE_ADR     /* not used! */
-#define PRIMITIVETYPE_BYTE    5
-#define PRIMITIVETYPE_CHAR    6
-#define PRIMITIVETYPE_SHORT   7
-#define PRIMITIVETYPE_BOOLEAN 8
-#define PRIMITIVETYPE_DUMMY2  9            /* not used! */
-#define PRIMITIVETYPE_VOID    TYPE_VOID
-
-
-/* CAUTION: Don't change the numerical values! These constants (with
-   the exception of ARRAYTYPE_OBJECT) are used as indices in the
-   primitive type table. */
-
-#define ARRAYTYPE_INT         PRIMITIVETYPE_INT
-#define ARRAYTYPE_LONG        PRIMITIVETYPE_LONG
-#define ARRAYTYPE_FLOAT       PRIMITIVETYPE_FLOAT
-#define ARRAYTYPE_DOUBLE      PRIMITIVETYPE_DOUBLE
-#define ARRAYTYPE_BYTE        PRIMITIVETYPE_BYTE
-#define ARRAYTYPE_CHAR        PRIMITIVETYPE_CHAR
-#define ARRAYTYPE_SHORT       PRIMITIVETYPE_SHORT
-#define ARRAYTYPE_BOOLEAN     PRIMITIVETYPE_BOOLEAN
-#define ARRAYTYPE_OBJECT      PRIMITIVETYPE_VOID     /* don't use as index! */
-
-
-/* primitivetypeinfo **********************************************************/
-
-struct primitivetypeinfo {
-       char      *cname;                    /* char name of primitive class      */
-       utf       *name;                     /* name of primitive class           */
-       classinfo *class_wrap;               /* class for wrapping primitive type */
-       classinfo *class_primitive;          /* primitive class                   */
-       char      *wrapname;                 /* name of class for wrapping        */
-       char       typesig;                  /* one character type signature      */
-       char      *arrayname;                /* name of primitive array class     */
-       classinfo *arrayclass;               /* primitive array class             */
-};
-
-
-/* global variables ***********************************************************/
-
-/* This array can be indexed by the PRIMITIVETYPE_ and ARRAYTYPE_
-   constants (except ARRAYTYPE_OBJECT). */
-
-extern primitivetypeinfo primitivetype_table[PRIMITIVETYPE_COUNT];
-
-
-/* function prototypes ********************************************************/
-
-bool       primitive_init(void);
-classinfo *primitive_class_get_by_name(utf *name);
-classinfo *primitive_class_get_by_type(int32_t type);
-classinfo *primitive_class_get_by_char(char ch);
-classinfo *primitive_arrayclass_get_by_name(utf *name);
-classinfo *primitive_arrayclass_get_by_type(int32_t type);
-
-#endif /* _PRIMITIVE_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:
- * vim:noexpandtab:sw=4:ts=4:
- */
diff --git a/src/vmcore/primitivecore.c b/src/vmcore/primitivecore.c
new file mode 100644 (file)
index 0000000..cff3995
--- /dev/null
@@ -0,0 +1,167 @@
+/* src/vmcore/primitivecore.c - core functions for primitive types
+
+   Copyright (C) 2007 R. Grafl, A. Krall, C. Kruegel,
+   C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
+   E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
+   J. Wenninger, Institut f. Computersprachen - TU Wien
+
+   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.
+
+   $Id: linker.c 8042 2007-06-07 17:43:29Z twisti $
+
+*/
+
+
+#include "config.h"
+
+#include <assert.h>
+#include <stdint.h>
+
+#include "vm/global.h"
+#include "vm/primitive.h"
+
+#include "vmcore/class.h"
+#include "vmcore/utf8.h"
+
+
+/* primitivetype_table *********************************************************
+
+   Structure for primitive classes: contains the class for wrapping
+   the primitive type, the primitive class, the name of the class for
+   wrapping, the one character type signature and the name of the
+   primitive class.
+   CAUTION: Don't change the order of the types. This table is indexed
+   by the ARRAYTYPE_ constants (except ARRAYTYPE_OBJECT).
+
+*******************************************************************************/
+
+primitivetypeinfo primitivetype_table[PRIMITIVETYPE_COUNT] = {
+       { "int"     , NULL, NULL, NULL, "java/lang/Integer",   'I', "[I", NULL },
+       { "long"    , NULL, NULL, NULL, "java/lang/Long",      'J', "[J", NULL },
+       { "float"   , NULL, NULL, NULL, "java/lang/Float",     'F', "[F", NULL },
+       { "double"  , NULL, NULL, NULL, "java/lang/Double",    'D', "[D", NULL },
+       { NULL      , NULL, NULL, NULL, NULL,                   0 , NULL, NULL },
+       { "byte"    , NULL, NULL, NULL, "java/lang/Byte",      'B', "[B", NULL },
+       { "char"    , NULL, NULL, NULL, "java/lang/Character", 'C', "[C", NULL },
+       { "short"   , NULL, NULL, NULL, "java/lang/Short",     'S', "[S", NULL },
+       { "boolean" , NULL, NULL, NULL, "java/lang/Boolean",   'Z', "[Z", NULL },
+       { NULL      , NULL, NULL, NULL, NULL,                   0 , NULL, NULL },
+#if defined(ENABLE_JAVASE)
+       { "void"    , NULL, NULL, NULL, "java/lang/Void",      'V', NULL, NULL }
+#else
+       { NULL      , NULL, NULL, NULL, NULL,                   0 , NULL, NULL },
+#endif
+};
+
+
+/* primitive_init **************************************************************
+
+   Create classes representing primitive types.
+
+*******************************************************************************/
+
+bool primitive_init(void)
+{  
+       utf       *name;
+       classinfo *c;
+       utf       *u;
+       int        i;
+
+       for (i = 0; i < PRIMITIVETYPE_COUNT; i++) {
+               /* skip dummies */
+
+               if (primitivetype_table[i].cname == NULL)
+                       continue;
+
+               /* create UTF-8 name */
+
+               name = utf_new_char(primitivetype_table[i].cname);
+
+               primitivetype_table[i].name = name;
+
+               /* create primitive class */
+
+               c = class_create_classinfo(name);
+
+               /* primitive classes don't have a super class */
+
+               c->super.any = NULL;
+
+               /* set flags and mark it as primitive class */
+
+               c->flags = ACC_PUBLIC | ACC_FINAL | ACC_ABSTRACT | ACC_CLASS_PRIMITIVE;
+               
+               /* prevent loader from loading primitive class */
+
+               c->state |= CLASS_LOADED;
+
+               /* INFO: don't put primitive classes into the classcache */
+
+               if (!link_class(c))
+                       return false;
+
+               primitivetype_table[i].class_primitive = c;
+
+               /* create class for wrapping the primitive type */
+
+               u = utf_new_char(primitivetype_table[i].wrapname);
+               c = load_class_bootstrap(u);
+
+               if (c == NULL)
+                       return false;
+
+               primitivetype_table[i].class_wrap = c;
+
+               /* create the primitive array class */
+
+               if (primitivetype_table[i].arrayname) {
+                       u = utf_new_char(primitivetype_table[i].arrayname);
+                       c = class_create_classinfo(u);
+                       c = load_newly_created_array(c, NULL);
+
+                       if (c == NULL)
+                               return false;
+
+                       primitivetype_table[i].arrayclass = c;
+
+                       assert(c->state & CLASS_LOADED);
+
+                       if (!(c->state & CLASS_LINKED))
+                               if (!link_class(c))
+                                       return false;
+               }
+       }
+
+       return true;
+}
+
+
+/*
+ * 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:
+ */