harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r575312 - in /harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363: Pass2.cpp context.h ver_utils.h
Date Thu, 13 Sep 2007 13:42:43 GMT
Author: mloenko
Date: Thu Sep 13 06:42:42 2007
New Revision: 575312

URL: http://svn.apache.org/viewvc?rev=575312&view=rev
Log:
fix for HARMONY-4760 (14 VTSVM tests fail with VerifyError)

Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/Pass2.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/context.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/ver_utils.h

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/Pass2.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/Pass2.cpp?rev=575312&r1=575311&r2=575312&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/Pass2.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/Pass2.cpp Thu Sep 13 06:42:42
2007
@@ -413,7 +413,7 @@
 
         case OP_ALOAD: {
             //get local index from bytecode
-            int local_idx = wide ? read_int16(m_bytecode + instr + 2) : m_bytecode[instr
+ 1];
+            unsigned local_idx = wide ? read_int16(m_bytecode + instr + 2) : m_bytecode[instr
+ 1];
 
             //call macro
             CHECK_ALOAD( local_idx );
@@ -475,7 +475,7 @@
 
         case OP_ASTORE: {
             //get local index from bytecode
-            int local_idx = wide ? read_int16(m_bytecode + instr + 2) : m_bytecode[instr
+ 1];
+            unsigned local_idx = wide ? read_int16(m_bytecode + instr + 2) : m_bytecode[instr
+ 1];
 
             //call MACRO
             CHECK_ASTORE( local_idx );
@@ -654,7 +654,7 @@
 
         case OP_DLOAD: {
             //get local index from bytecode
-            int local_idx = wide ? read_int16(m_bytecode + instr + 2) : m_bytecode[instr
+ 1];
+            unsigned local_idx = wide ? read_int16(m_bytecode + instr + 2) : m_bytecode[instr
+ 1];
 
             //call macro
             CHECK_xxLOAD( local_idx, SM_DOUBLE );
@@ -688,7 +688,7 @@
 
         case OP_DSTORE: {
             //get local index from bytecode
-            int local_idx = wide ? read_int16(m_bytecode + instr + 2) : m_bytecode[instr
+ 1];
+            unsigned local_idx = wide ? read_int16(m_bytecode + instr + 2) : m_bytecode[instr
+ 1];
 
             CHECK_xxSTORE( local_idx, SM_DOUBLE );
 
@@ -932,7 +932,7 @@
 
         case OP_FLOAD: {
             //get local index from bytecode
-            int local_idx = wide ? read_int16(m_bytecode + instr + 2) : m_bytecode[instr
+ 1];
+            unsigned local_idx = wide ? read_int16(m_bytecode + instr + 2) : m_bytecode[instr
+ 1];
 
             //call macro
             CHECK_xLOAD( local_idx, SM_FLOAT );
@@ -966,7 +966,7 @@
 
         case OP_FSTORE: {
             //get local index from bytecode
-            int local_idx = wide ? read_int16(m_bytecode + instr + 2) : m_bytecode[instr
+ 1];
+            unsigned local_idx = wide ? read_int16(m_bytecode + instr + 2) : m_bytecode[instr
+ 1];
 
             CHECK_xSTORE( local_idx, SM_FLOAT );
 
@@ -1107,7 +1107,7 @@
                              }
 
         case OP_IINC: {
-            int local_idx = wide ? read_int16(m_bytecode + instr + 2) : m_bytecode[instr
+ 1];
+            unsigned local_idx = wide ? read_int16(m_bytecode + instr + 2) : m_bytecode[instr
+ 1];
 
             if( !workmap_valid_local(local_idx) ) {
                 return error(VF_ErrorLocals, "invalid local index");
@@ -1122,7 +1122,7 @@
 
         case OP_ILOAD: {
             //get local index from bytecode
-            int local_idx = wide ? read_int16(m_bytecode + instr + 2) : m_bytecode[instr
+ 1];
+            unsigned local_idx = wide ? read_int16(m_bytecode + instr + 2) : m_bytecode[instr
+ 1];
 
             //call macro
             CHECK_xLOAD( local_idx, SM_INTEGER );
@@ -1168,7 +1168,7 @@
 
         case OP_ISTORE: {
             //get local index from bytecode
-            int local_idx = wide ? read_int16(m_bytecode + instr + 2) : m_bytecode[instr
+ 1];
+            unsigned local_idx = wide ? read_int16(m_bytecode + instr + 2) : m_bytecode[instr
+ 1];
 
             CHECK_xSTORE( local_idx, SM_INTEGER );
 
@@ -1303,7 +1303,7 @@
 
         case OP_LLOAD: {
             //get local index from bytecode
-            int local_idx = wide ? read_int16(m_bytecode + instr + 2) : m_bytecode[instr
+ 1];
+            unsigned local_idx = wide ? read_int16(m_bytecode + instr + 2) : m_bytecode[instr
+ 1];
 
             //call macro
             CHECK_xxLOAD( local_idx, SM_LONG );
@@ -1337,7 +1337,7 @@
 
         case OP_LSTORE: {
             //get local index from bytecode
-            int local_idx = wide ? read_int16(m_bytecode + instr + 2) : m_bytecode[instr
+ 1];
+            unsigned local_idx = wide ? read_int16(m_bytecode + instr + 2) : m_bytecode[instr
+ 1];
 
             CHECK_xxSTORE( local_idx, SM_LONG );
 
@@ -1515,7 +1515,7 @@
 
         case OP_GETFIELD: {
             //check and resolve instruction
-            int cp_idx = read_int16(m_bytecode + instr + 1);
+            unsigned short cp_idx = read_int16(m_bytecode + instr + 1);
             SmConstant ref, value;
             if( !tpool.cpool_get_field(cp_idx, &ref, &value) ) return error(VF_ErrorUnknown,
"incorrect constantpool entry");
 
@@ -1533,7 +1533,7 @@
 
         case OP_GETSTATIC: {
             //check and resolve instruction
-            int cp_idx = read_int16(m_bytecode + instr + 1);
+            unsigned short cp_idx = read_int16(m_bytecode + instr + 1);
             SmConstant value;
             if( !tpool.cpool_get_field(cp_idx, 0, &value) ) return error(VF_ErrorUnknown,
"incorrect constantpool entry");
 
@@ -1545,7 +1545,7 @@
 
         case OP_PUTFIELD: {
             //check and resolve instruction
-            int cp_idx = read_int16(m_bytecode + instr + 1);
+            unsigned short cp_idx = read_int16(m_bytecode + instr + 1);
             SmConstant expected_ref, expected_val;
             if( !tpool.cpool_get_field(cp_idx, &expected_ref, &expected_val) ) {
                 return error(VF_ErrorUnknown, "incorrect constantpool entry");
@@ -1574,7 +1574,7 @@
 
         case OP_PUTSTATIC: {
             //check and resolve instruction
-            int cp_idx = read_int16(m_bytecode + instr + 1);
+            unsigned short cp_idx = read_int16(m_bytecode + instr + 1);
             SmConstant expected_val;
             if( !tpool.cpool_get_field(cp_idx, 0, &expected_val) ) return error(VF_ErrorUnknown,
"incorrect constantpool entry");
 
@@ -1751,7 +1751,7 @@
                      }
         case OP_RET: {
             //get local index from bytecode
-            int local_idx = wide ? read_int16(m_bytecode + instr + 2) : m_bytecode[instr
+ 1];
+            unsigned local_idx = wide ? read_int16(m_bytecode + instr + 2) : m_bytecode[instr
+ 1];
 
             //check whether it is a valid local
             if( !workmap_valid_local(local_idx) ) {

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/context.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/context.h?rev=575312&r1=575311&r2=575312&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/context.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/context.h Thu Sep 13 06:42:42
2007
@@ -534,12 +534,12 @@
         int instr_get_len_compound(Address instr, OpCode opcode);
 
         //read two-byte value
-        static int16 read_int16(byte* ptr) {
+        static uint16 read_int16(byte* ptr) {
             return (ptr[0] << 8) | ptr[1];
         }
 
         //read four-byte value
-        static int32 read_int32(byte* ptr) {
+        static uint32 read_int32(byte* ptr) {
             return (ptr[0] << 24) | (ptr[1] << 16) | (ptr[2] << 8) | ptr[3];
         }
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/ver_utils.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/ver_utils.h?rev=575312&r1=575311&r2=575312&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/ver_utils.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/ver_utils.h Thu Sep 13 06:42:42
2007
@@ -385,7 +385,7 @@
             int idx = 0;
 
             for( ; idx < length - 3; idx += 4 ) {
-                if( *((int32*) (key+idx) ) != *((int32*) (h_key+idx) ) ) return false;
+                if( *((uint32*) (key+idx) ) != *((uint32*) (h_key+idx) ) ) return false;
             }
 
             for( ; idx < length; idx++) {
@@ -406,7 +406,7 @@
             int idx = 0;
 
             for( ; idx < length - 3; idx += 4 ) {
-                result += *((int32*) (key+idx) );
+                result += *((uint32*) (key+idx) );
             }
 
             for( ; idx < length; idx++) {



Mime
View raw message