harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dlyd...@apache.org
Subject svn commit: r330890 - in /incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM: jni/src/harmony/generic/0.0/src/java/lang/String.java jni/src/harmony/generic/0.0/src/java_lang_String.c jvm/include/jlString.h
Date Fri, 04 Nov 2005 20:45:38 GMT
Author: dlydick
Date: Fri Nov  4 12:45:17 2005
New Revision: 330890

URL: http://svn.apache.org/viewcvs?rev=330890&view=rev
Log:
Added mechanism for internal support of strings as a quasi-primative.

Modified:
    incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jni/src/harmony/generic/0.0/src/java/lang/String.java
    incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jni/src/harmony/generic/0.0/src/java_lang_String.c
    incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/include/jlString.h

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jni/src/harmony/generic/0.0/src/java/lang/String.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jni/src/harmony/generic/0.0/src/java/lang/String.java?rev=330890&r1=330889&r2=330890&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jni/src/harmony/generic/0.0/src/java/lang/String.java
(original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jni/src/harmony/generic/0.0/src/java/lang/String.java
Fri Nov  4 12:45:17 2005
@@ -9,6 +9,17 @@
  * should be stored in a shared archive along with the other classes
  * of this Java package's native methods.
  *
+ * An important item here is the storage location of the string's
+ * data char[] array.  It is needed in order to complete
+ * @link #object_utf8_string_lookup()
+   object_utf8_string_lookup()@endlink and other string routines.
+ *
+ * @see @link jvm/src/object.c jvm/src/object.c@endlink
+ *
+ * @see @link jvm/include/jlString.h jvm/include/jlString.h@endlink
+ *
+ * @see @link jvm/src/native.c jvm/src/native.c@endlink
+ *
  *
  * @section Control
  *
@@ -63,11 +74,39 @@
  */
 public class String
 {
+/******** BEGIN:  DO NOT CHANGE THE ORDER OF THESE FIELD DEFINITIONS! */
+
+
     /* Please see 'jvm/include/arch.h' for corresponding 'C' defns */
     private static final String copyright =
 "\0$URL$ " +
 "$Id$ " +
         org.apache.harmony.Copyright.copyrightText;
+        /**< Class static variable field index 0 (not critical) */
+
+    /*!
+     * @warning <b>DO NOT CHANGE THE POSITION OR ORDER OF THESE
+     *          DECLARATIONS!</b>
+     *
+     *          This is @e required for proper operation of the native
+     *          interface and of the core string contents loading in
+     *          @link #object_instance_new()
+                object_instance_new()@endlink as defined in
+     *          @link jvm/include/jlString.h
+                jvm/include/jlString.h@endlink and
+     *          @link jvm/src/native.c jvm/src/native.c@endlink.
+     *
+     * @todo HARMONY-6-jni-String.java-1 Verify that this order is
+     *       actually what is laid down in the compilation of this
+     *       class.  @e Hopefully, it is not compiler-dependent.
+     *
+     */
+
+    private char value[]; /**< Object instance variable field index 0 */
+
+    private int length; /**< Object instance variable field index 1 */
+
+/******** END: DO NOT CHANGE THE ORDER OF THESE FIELD DEFINITIONS! ****/
 
     /*!
      * @brief Native definition

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jni/src/harmony/generic/0.0/src/java_lang_String.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jni/src/harmony/generic/0.0/src/java_lang_String.c?rev=330890&r1=330889&r2=330890&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jni/src/harmony/generic/0.0/src/java_lang_String.c
(original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jni/src/harmony/generic/0.0/src/java_lang_String.c
Fri Nov  4 12:45:17 2005
@@ -61,6 +61,22 @@
 #include "java_lang_String.h"
 #include "jlString.h"
 
+/*!
+ * @internal Force agreement and alignment of fields
+ *
+ */
+#if 0 != JLSTRING_CRITICAL_FIELD_VALUE
+#error Critical java.lang.String 'value' field number mismatch
+#endif
+
+#if 1 != JLSTRING_CRITICAL_FIELD_LENGTH
+#error Critical java.lang.String 'length' field number mismatch
+#endif
+
+#if 2 != JLSTRING_CRITICAL_NUM_FIELDS
+#error Critical java.lang.String number of fields mismatch
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/include/jlString.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/include/jlString.h?rev=330890&r1=330889&r2=330890&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/include/jlString.h
(original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/include/jlString.h
Fri Nov  4 12:45:17 2005
@@ -119,6 +119,36 @@
 /**********************************************************************/
 
 /*!
+ * @name Object instance field definitions from java.lang.String
+ *
+ * @brief Fields correlating to the critical string fields of
+ * @link jni/src/harmony/generic/0.0/src/java/lang/String.java
+   jni/src/harmony/generic/0.0/src/java/lang/String.java@endlink
+ * are defined for 'C' compilation here.
+ *
+ * @warning  This introduces coupling into the JNI implementation.
+ *
+ */
+
+/*@{ */ /* Begin grouped definitions */
+
+#define JLSTRING_CRITICAL_FIELD_VALUE     0 /**< Place holder for
+                                             *   string 'value' field
+                                             */
+
+#define JLSTRING_CRITICAL_FIELD_LENGTH    1 /**< Place holder for
+                                             *   string 'length' field
+                                             */
+
+#define JLSTRING_CRITICAL_NUM_FIELDS      2 /**< Number of critical
+                                             *   fields in class file
+                                             */
+
+/*@} */ /* End grouped definitions */
+
+/**********************************************************************/
+
+/*!
  * @name Unified set of prototypes for functions
  * in @link jvm/src/jlString.c jlString.c@endlink
  *



Mime
View raw message