harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcfi...@apache.org
Subject svn commit: r650103 - in /harmony/enhanced/drlvm/trunk/vm: vmcore/include/ vmcore/src/kernel_classes/native/ vmcore/src/verifier-3363/base/ vmcore/src/verifier-3363/java5/ vmcore/src/verifier-3363/java6/ vmi/src/ vmstart/src/compmgr/
Date Mon, 21 Apr 2008 11:18:50 GMT
Author: mcfirst
Date: Mon Apr 21 04:18:40 2008
New Revision: 650103

URL: http://svn.apache.org/viewvc?rev=650103&view=rev
Log:
Applying the patch from HARMONY-5765 [drlvm][verifier] type cast to unsigned ruined table
switches

Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/stack_trace.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelper.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/context_base.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/context_x.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java5/context_5.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java6/context_6.cpp
    harmony/enhanced/drlvm/trunk/vm/vmi/src/vmi.cpp
    harmony/enhanced/drlvm/trunk/vm/vmstart/src/compmgr/component_manager_impl.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/include/stack_trace.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/stack_trace.h?rev=650103&r1=650102&r2=650103&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/include/stack_trace.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/stack_trace.h Mon Apr 21 04:18:40 2008
@@ -45,7 +45,7 @@
  */
 
 #include <stdio.h>
-
+#include "open/hythread.h"
 #include "open/types.h"
 #include "ExpandableMemBlock.h"
 #include "vm_threads.h"

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelper.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelper.cpp?rev=650103&r1=650102&r2=650103&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelper.cpp
(original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelper.cpp
Mon Apr 21 04:18:40 2008
@@ -14,8 +14,6 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-
-
 #include "org_apache_harmony_drlvm_VMHelper.h"
 
 #include "open/vm.h"

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/context_base.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/context_base.h?rev=650103&r1=650102&r2=650103&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/context_base.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/context_base.h Mon Apr 21
04:18:40 2008
@@ -204,15 +204,25 @@
     int instr_get_len_compound(Address instr, OpCode opcode);
 
     //read two-byte value
-    static Address read_int16(Byte* ptr) {
+    static int16 read_int16(Byte* ptr) {
         return (ptr[0] << 8) | ptr[1];
     }
 
     //read four-byte value
-    static Address read_int32(Byte* ptr) {
+    static int32 read_int32(Byte* ptr) {
         return (ptr[0] << 24) | (ptr[1] << 16) | (ptr[2] << 8) | ptr[3];
     }
 
+    //get a 16-bit jump target
+    static Address instr_get_int16_target(Address instr, Byte* ptr) {
+        return (Address) (instr + read_int16(ptr));
+    }
+
+    //get a 32-bit jump target
+    static Address instr_get_int32_target(Address instr, Byte* ptr) {
+        return (Address) (instr + read_int32(ptr));
+    }
+
     //get properties specific for the given opcode
     static ParseInfo &instr_get_parse_info(OpCode opcode) {
         return parseTable[opcode];
@@ -260,11 +270,8 @@
 
     //return the jump target for the given instruction
     static Address instr_get_jump_target(ParseInfo &pi, Byte* code, Address instr) {
-        if( pi.flags & PI_WIDEJUMP ) {
-            return instr + read_int32(code + instr + 1);
-        } else {
-            return instr + read_int16(code + instr + 1);
-        }        
+        return ( pi.flags & PI_WIDEJUMP ) ? instr_get_int32_target(instr, code + instr
+ 1) :
+            instr_get_int16_target(instr, code + instr + 1);
     }
 
     //is this opcode valid?

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/context_x.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/context_x.cpp?rev=650103&r1=650102&r2=650103&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/context_x.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/context_x.cpp Mon Apr 21
04:18:40 2008
@@ -1755,8 +1755,8 @@
             if( !workmap_can_push(1) ) return error(VF_ErrorDataFlow, "operand stack overflow");
 
             //extract JSR target. would be better to do it in dataflow_liner, but it's also
not very good
-            Address target = instr + (opcode == OP_JSR_W ? 
-                read_int32(m_bytecode + instr + 1) : read_int16(m_bytecode + instr + 1));
+            Address target = opcode == OP_JSR_W ? instr_get_int32_target(instr, m_bytecode
+ instr + 1) :
+                instr_get_int16_target(instr, m_bytecode + instr + 1);
 
             //create OUTs
             SmConstant retaddr = SmConstant::getRetAddr(target);

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java5/context_5.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java5/context_5.cpp?rev=650103&r1=650102&r2=650103&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java5/context_5.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java5/context_5.cpp Mon Apr 21
04:18:40 2008
@@ -134,7 +134,7 @@
             Address next_target_adr = (instr & (~3) ) + 4;
 
             //default target
-            Address target = instr + read_int32(m_bytecode + next_target_adr);
+            Address target = instr_get_int32_target(instr, m_bytecode + next_target_adr);
             stack.push(target);
 
             mark_stackmap_point(target);
@@ -147,7 +147,7 @@
                 next_target_adr < instr + instr_len;
                 next_target_adr += shift)
             {
-                target = instr + read_int32(m_bytecode + next_target_adr);
+                target = instr_get_int32_target(instr, m_bytecode + next_target_adr);
                 // jump out of method or to the middle of an instruction
                 if( target >= m_code_length || props.isOperand(target) ) {
                     return error(VF_ErrorBranch, "jump out of method or to the middle of
an instruction");
@@ -373,7 +373,7 @@
             Address next_target_adr = (instr & (~3) ) + 4;
 
             //default target
-            Address target = instr + read_int32(m_bytecode + next_target_adr);
+            Address target = instr_get_int32_target(instr, m_bytecode + next_target_adr);
             processSwitchTarget(target);
 
             // in tableswitch instruction target offsets are stored with shift = 4,
@@ -385,7 +385,7 @@
                 next_target_adr < instr + instr_len;
                 next_target_adr += shift)
             {
-                target = instr + read_int32(m_bytecode + next_target_adr);
+                target = instr_get_int32_target(instr, m_bytecode + next_target_adr);
                 processSwitchTarget(target);
             }
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java6/context_6.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java6/context_6.cpp?rev=650103&r1=650102&r2=650103&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java6/context_6.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java6/context_6.cpp Mon Apr 21
04:18:40 2008
@@ -161,7 +161,7 @@
             Address next_target_adr = (instr & (~3) ) + 4;
 
             //default target
-            Address target = instr + read_int32(m_bytecode + next_target_adr);
+            Address target = instr_get_int32_target(instr, m_bytecode + next_target_adr);
             new_generic_vector_constraint(target);
 
             // in tableswitch instruction target offsets are stored with shift = 4,
@@ -173,7 +173,7 @@
                 next_target_adr < instr + instr_len;
                 next_target_adr += shift)
             {
-                target = instr + read_int32(m_bytecode + next_target_adr);
+                target = instr_get_int32_target(instr, m_bytecode + next_target_adr);
                 new_generic_vector_constraint(target);
             }
         } else {

Modified: harmony/enhanced/drlvm/trunk/vm/vmi/src/vmi.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmi/src/vmi.cpp?rev=650103&r1=650102&r2=650103&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmi/src/vmi.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmi/src/vmi.cpp Mon Apr 21 04:18:40 2008
@@ -20,8 +20,6 @@
 #define LOG_DOMAIN "vmls"
 #include "cxxlog.h"
 
-#include <assert.h>
-
 #include "open/vm_properties.h"
 #include "open/hythread.h"
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmstart/src/compmgr/component_manager_impl.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmstart/src/compmgr/component_manager_impl.cpp?rev=650103&r1=650102&r2=650103&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmstart/src/compmgr/component_manager_impl.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmstart/src/compmgr/component_manager_impl.cpp Mon Apr
21 04:18:40 2008
@@ -14,12 +14,6 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-/** 
- * @author Alexei Fedotov
- * @version $Revision: 1.1.2.2.4.5 $
- */  
-
-#include <apr_atomic.h>
 #include <apr_lib.h>
 #include <apr_strings.h>
 



Mime
View raw message