harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From var...@apache.org
Subject svn commit: r593440 - /harmony/enhanced/drlvm/trunk/vm/port/src/encoder/ia32_em64t/enc_base.h
Date Fri, 09 Nov 2007 07:00:30 GMT
Author: varlax
Date: Thu Nov  8 23:00:29 2007
New Revision: 593440

URL: http://svn.apache.org/viewvc?rev=593440&view=rev
Log:
Applied HARMONY-5065 [drlvm][jit] OpcodeDesc structure is padded incorrectly

Modified:
    harmony/enhanced/drlvm/trunk/vm/port/src/encoder/ia32_em64t/enc_base.h

Modified: harmony/enhanced/drlvm/trunk/vm/port/src/encoder/ia32_em64t/enc_base.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/src/encoder/ia32_em64t/enc_base.h?rev=593440&r1=593439&r2=593440&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/port/src/encoder/ia32_em64t/enc_base.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/src/encoder/ia32_em64t/enc_base.h Thu Nov  8 23:00:29
2007
@@ -208,42 +208,41 @@
      * @brief Info about single opcode - its opcode bytes, operands, 
      *        operands' roles.
      */
-    struct OpcodeDesc {
-        /**
-         * @brief Raw opcode bytes.
-         *
-         * 'Raw' opcode bytes which do not require any analysis and are  
-         * independent from arguments/sizes/etc (may include opcode size
-         * prefix).
-         */
-        char        opcode[5];     // 4 bytes
-        unsigned    opcode_len;    // 4
-        unsigned    aux0;          // 4
-        unsigned    aux1;          // 4
-        /**
-         * @brief Info about opcode's operands.
-         * 
-         * The [3] mostly comes from IDIV/IMUL which both may have up to 3 
-         * operands.
-         */
-        OpndDesc        opnds[3];   // 12*3 = 36
-        unsigned        first_opnd; // 4
-        /**
-         * @brief Info about operands - total number, number of uses/defs, 
-         *        operands' roles.
-         */
-        OpndRolesDesc   roles;   // 16
-        /**
-         * @brief If not zero, then this is final OpcodeDesc structure in 
-         *        the list of opcodes for a given mnemonic.
-         */
-        char            last;    // 1
-                                 // total: 74
-        /**
-         * @brief Padding to make structure's size a power of 2.
-         */
-        char padding[128-74];
-    };
+   union OpcodeDesc {
+       char dummy[128]; // To make total size a power of 2
+
+       struct {
+           /**
+           * @brief Raw opcode bytes.
+           *
+           * 'Raw' opcode bytes which do not require any analysis and are
+           * independent from arguments/sizes/etc (may include opcode size
+           * prefix).
+           */
+           char        opcode[5];
+           unsigned    opcode_len;
+           unsigned    aux0;
+           unsigned    aux1;
+           /**
+           * @brief Info about opcode's operands.
+           * 
+           * The [3] mostly comes from IDIV/IMUL which both may have up to 3
+           * operands.
+           */
+           OpndDesc        opnds[3];
+           unsigned        first_opnd;
+           /**
+           * @brief Info about operands - total number, number of uses/defs,
+           *        operands' roles.
+           */
+           OpndRolesDesc   roles;
+           /**
+           * @brief If not zero, then this is final OpcodeDesc structure in
+           *        the list of opcodes for a given mnemonic.
+           */
+           char            last;
+       };
+   };
 public:
     /**
      * @brief General info about mnemonic.



Mime
View raw message