You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by dl...@apache.org on 2006/04/25 14:36:15 UTC

svn commit: r396866 - in /incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src: class.h jvalue.h jvm.h jvmcfg.c jvmreg.h portable.h thread.h

Author: dlydick
Date: Tue Apr 25 05:36:12 2006
New Revision: 396866

URL: http://svn.apache.org/viewcvs?rev=396866&view=rev
Log:
Explicitly pack key structures, regardless of compiler options

Modified:
    incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/class.h
    incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/jvalue.h
    incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/jvm.h
    incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/jvmcfg.c
    incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/jvmreg.h
    incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/portable.h
    incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/thread.h

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/class.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/class.h?rev=396866&r1=396865&r2=396866&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/class.h (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/class.h Tue Apr 25 05:36:12 2006
@@ -86,7 +86,20 @@
  * 
  * @returns pointer to a class slot
  * 
+ *
+ * @internal The JVM spec compliance of much code depends
+ *           code depends on packed structures, especially
+ *           in the class file arena, yet the use of global
+ *           project-wide -fpack-struct (GCC version of
+ *           structure packing option) conflicts with issues
+ *           such as portability.  Since the largest structures
+ *           of the code are not inherently portably, they
+ *           are packed here with a pragma and the compiler
+ *           is free to not pack anything else.
+ *
  */
+#pragma pack(1)
+
 #define CLASS(clsidx) pjvm->class[clsidx]
 
 /*!
@@ -250,6 +263,12 @@
                           */
 
 } rclass;
+
+/*!
+ * @internal Remove effects of packing pragma on other code.
+ *
+ */
+#pragma pack()
 
 /* Prototypes for functions in 'class.c' */
 extern rvoid           class_init(rvoid);

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/jvalue.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/jvalue.h?rev=396866&r1=396865&r2=396866&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/jvalue.h (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/jvalue.h Tue Apr 25 05:36:12 2006
@@ -132,7 +132,20 @@
  * @e extensively in the runtime environment, this inherent constraint
  * can help plan maximum heap sizing.
  *
+ *
+ * @internal The JVM spec compliance of much code depends
+ *           code depends on packed structures, especially
+ *           in the class file arena, yet the use of global
+ *           project-wide -fpack-struct (GCC version of
+ *           structure packing option) conflicts with issues
+ *           such as portability.  Since the largest structures
+ *           of the code are not inherently portably, they
+ *           are packed here with a pragma and the compiler
+ *           is free to not pack anything else.
+ *
  */
+#pragma pack(1)
+
 typedef union
 {
     jbyte    _jbyte;    /**< Sub-integer primative @link
@@ -166,6 +179,12 @@
     jvm_object_hash  _jobjhash;/**< Object hash of an arbitrary object*/
 
 } jvalue;
+
+/*!
+ * @internal Remove effects of packing pragma on other code.
+ *
+ */
+#pragma pack()
 
 #endif /* _jvalue_h_included_ */
 

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/jvm.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/jvm.h?rev=396866&r1=396865&r2=396866&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/jvm.h (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/jvm.h Tue Apr 25 05:36:12 2006
@@ -78,7 +78,21 @@
  *
  * This model has all the usual components, a program counter,
  * a stack pointer and stack area, and thread defintions.
+ *
+ *
+ * @internal The JVM spec compliance of much code depends
+ *           code depends on packed structures, especially
+ *           in the class file arena, yet the use of global
+ *           project-wide -fpack-struct (GCC version of
+ *           structure packing option) conflicts with issues
+ *           such as portability.  Since the largest structures
+ *           of the code are not inherently portably, they
+ *           are packed here with a pragma and the compiler
+ *           is free to not pack anything else.
+ *
  */
+#pragma pack(1)
+
 typedef struct
 {
     /*
@@ -268,6 +282,12 @@
                                          * dimension reference.  */
 
 } rjvm;
+
+/*!
+ * @internal Remove effects of packing pragma on other code.
+ *
+ */
+#pragma pack()
 
 extern rjvm *pjvm;     /**< Declared in @link #pjvm jvm.c @endlink */
 

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/jvmcfg.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/jvmcfg.c?rev=396866&r1=396865&r2=396866&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/jvmcfg.c (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/jvmcfg.c Tue Apr 25 05:36:12 2006
@@ -82,6 +82,18 @@
 const jvm_attribute_index jvm_attribute_index_bad =JVMCFG_BAD_ATTRIBUTE;
 
 /*!
+ * @brief Real machine BAD annotation type index in annotation
+ */
+const jvm_annotation_type_index jvm_attribute_type_index_bad =
+                                             JVMCFG_BAD_ANNOTATION_TYPE;
+
+/*!
+ * @brief Real machine BAD element value index in annotation type
+ */
+const jvm_element_value_pair_index jvm_element_value_pair_index_bad =
+                                          JVMCFG_BAD_ELEMENT_VALUE_PAIR;
+
+/*!
  * @brief Real machine NATIVE (method) attribute index
  */
 const jvm_attribute_index jvm_attribute_index_native =

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/jvmreg.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/jvmreg.h?rev=396866&r1=396865&r2=396866&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/jvmreg.h (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/jvmreg.h Tue Apr 25 05:36:12 2006
@@ -64,7 +64,21 @@
  * @todo  HARMONY-6-jvm-jvmreg.h-1 Does an @p @b arraydims item need
  *        to be added for processing of array classes, or is the
  *        scalar concept sufficient in code?
+ *
+ *
+ * @internal The JVM spec compliance of much code depends
+ *           code depends on packed structures, especially
+ *           in the class file arena, yet the use of global
+ *           project-wide -fpack-struct (GCC version of
+ *           structure packing option) conflicts with issues
+ *           such as portability.  Since the largest structures
+ *           of the code are not inherently portably, they
+ *           are packed here with a pragma and the compiler
+ *           is free to not pack anything else.
+ *
  */
+#pragma pack(1)
+
 typedef struct
 {
     jvm_class_index     clsidx;   /**< class[clsidx] of code location*/
@@ -74,6 +88,12 @@
                                                            exceptions */
     jvm_pc_offset       offset;    /**< instruction within code area */
 } jvm_pc;
+
+/*!
+ * @internal Remove effects of packing pragma on other code.
+ *
+ */
+#pragma pack()
 
 
 /*!

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/portable.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/portable.h?rev=396866&r1=396865&r2=396866&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/portable.h (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/portable.h Tue Apr 25 05:36:12 2006
@@ -279,7 +279,10 @@
  *           active at the same time for other conditions, it is
  *           better to be ugly and correct than simple and pretty,
  *           yet vulnerable to failures.
+ *
  */
+#pragma pack(1)
+
 typedef struct
 {
     jmp_buf real_member1; /**< Main part of definition */

Modified: incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/thread.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/thread.h?rev=396866&r1=396865&r2=396866&view=diff
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/thread.h (original)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/bootjvm/bootJVM/jvm/src/thread.h Tue Apr 25 05:36:12 2006
@@ -265,7 +265,21 @@
 
 /*!
  * @brief Real machine thread model implementation.
+ *
+ *
+ * @internal The JVM spec compliance of much code depends
+ *           code depends on packed structures, especially
+ *           in the class file arena, yet the use of global
+ *           project-wide -fpack-struct (GCC version of
+ *           structure packing option) conflicts with issues
+ *           such as portability.  Since the largest structures
+ *           of the code are not inherently portably, they
+ *           are packed here with a pragma and the compiler
+ *           is free to not pack anything else.
+ *
  */
+#pragma pack(1)
+
 typedef struct
 {
 
@@ -478,6 +492,12 @@
                                   */
 
 } rthread;
+
+/*!
+ * @internal Remove effects of packing pragma on other code.
+ *
+ */
+#pragma pack()
 
 
 /*!