harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r593446 - in /harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363: base/context_x.cpp base/context_x.h base/tpool.cpp java5/context_5.cpp java5/context_5.h java6/context_6.cpp java6/context_6.h
Date Fri, 09 Nov 2007 08:18:24 GMT
Author: mloenko
Date: Fri Nov  9 00:18:23 2007
New Revision: 593446

URL: http://svn.apache.org/viewvc?rev=593446&view=rev
Log:
improved processing of 'uninitialized'

Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/context_x.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/context_x.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/tpool.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java5/context_5.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java5/context_5.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java6/context_6.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java6/context_6.h

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=593446&r1=593445&r2=593446&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 Fri Nov  9
00:18:23 2007
@@ -34,6 +34,7 @@
 #define add_incoming_value              (((ActualClass*)this)->add_incoming_value)
 #define new_scalar_constraint           (((ActualClass*)this)->new_scalar_constraint)
 #define new_scalar_array2ref_constraint (((ActualClass*)this)->new_scalar_array2ref_constraint)
+#define new_bogus_propagation_constraint (((ActualClass*)this)->new_bogus_propagation_constraint)
 #define new_ret_vector_constraint       (((ActualClass*)this)->new_ret_vector_constraint)
 #define push_handler                    (((ActualClass*)this)->push_handler)
 
@@ -1575,12 +1576,18 @@
                 return error(VF_ErrorUnknown, "unable to pop from the empty stack");
             }
 
-            if( workmap_stackview(0).getAnyPossibleValue() != SM_THISUNINIT ) {
+            WorkmapElement &w0 = workmap_stackview(0);
+            if( w0.getAnyPossibleValue() != SM_THISUNINIT ) {
                 vf_Result result;
+
                 if( (result = popFieldRef(expected_ref, cp_idx)) != VF_OK ) {
                     return result;
                 }
             } else if( expected_ref == tpool.sm_get_const_this() ) {
+                if( !workmap_expect_strict(w0, SM_THISUNINIT) ) {
+                    return error(VF_ErrorUnknown, "Incompatible argument");
+                }
+
                 workmap_pop();
             } else {
                 return error(VF_ErrorUnknown, "incorrect uninitialized type");
@@ -1682,7 +1689,7 @@
                 }
 
                 assert( uninit_value != SM_NONE );
-                WorkmapElement wm_init = _WorkmapElement( sm_convert_to_initialized( uninit_value
) );
+                SmConstant init_val = sm_convert_to_initialized( uninit_value );
 
                 //exception might be thrown from the constructor, all uninit values will
be invalid
                 //BUT if try block contains both this and the next instruction then no extra
actions is necessary:
@@ -1694,14 +1701,14 @@
                     WorkmapElement &wm_el = workmap->elements[i];
 
                     if( wm_el.getAnyPossibleValue() == uninit_value ) {
-                        wm_el = wm_init;
+
+                        new_bogus_propagation_constraint(wm_el, init_val);
 
                         //respect changed_locals
                         if( i < m_stack_start ) {
                             changed_locals[ i ] = 1;
 
-                            //don't need to set "jsr modified" flag for constant
-                            assert(wm_el.isJsrModified());
+                            wm_el.setJsrModified();
 
                             //will be set later
                             //locals_changed = true;
@@ -1724,7 +1731,7 @@
                     }
 
                 } else {
-                    if( expected_ref != wm_init.getConst() ) return error(VF_ErrorUnknown,
"incorrect uninitialized type");
+                    if( expected_ref != init_val ) return error(VF_ErrorUnknown, "incorrect
uninitialized type");
                 }
             } else if( opcode == OP_INVOKESPECIAL ) {
                 //pop object ref (it must extend be either 'this' or a sub class of 'this')

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/context_x.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/context_x.h?rev=593446&r1=593445&r2=593446&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/context_x.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/context_x.h Fri Nov  9 00:18:23
2007
@@ -90,7 +90,7 @@
         }
 
         //looking the operand stack
-        WorkmapElement workmap_stackview(int depth) {
+        WorkmapElement &workmap_stackview(int depth) {
             assert( depth >= 0 && workmap_can_pop(depth+1) );
             return workmap->elements[ workmap->depth + m_stack_start - depth - 1];
         }

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/tpool.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/tpool.cpp?rev=593446&r1=593445&r2=593446&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/tpool.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/tpool.cpp Fri Nov  9 00:18:23
2007
@@ -165,10 +165,10 @@
             return from == SM_NULL || from.isReference() && sm_get_refname(from)[0]
== '[';
 
         case SM_NULL:
-        case SM_THISUNINIT:
             assert(0);
             return false;
 
+        case SM_THISUNINIT:
         case SM_HIGH_WORD:
         case SM_INTEGER:
         case SM_FLOAT:

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=593446&r1=593445&r2=593446&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 Fri Nov 
9 00:18:23 2007
@@ -290,14 +290,6 @@
                     //goto, goto_w
                     if( !props.isDataflowPassed(target) ) {
                         if( target < instr ) next_start_pc = 0;
-
-                        //if we like to flush StackMapTable attribute from this method
-                        if( stackmapattr_calculation && !props.isMultiway(target)
) {
-                            //store workmap to flush it further
-                            assert(!props.getInstrProps(target));
-                            storeWorkmapCopy(target);
-                        }
-
                         instr = target;
                         continue;
                     } else {

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java5/context_5.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java5/context_5.h?rev=593446&r1=593445&r2=593446&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java5/context_5.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java5/context_5.h Fri Nov  9
00:18:23 2007
@@ -320,6 +320,18 @@
             }
             return VF_OK;
         }
+
+        void new_bogus_propagation_constraint(WorkmapElement &wm_el, SmConstant init_val)
{
+            if( !wm_el.isVariable() ) {
+                wm_el = _WorkmapElement (init_val);
+            } else {
+
+                WorkmapElement wm_init = _WorkmapElement (new_variable());
+                wm_init.var_ptr->newIncomingType(&mem, init_val);
+                wm_el.getVariable()->newGenericConstraint(&mem, wm_init.getVariable());
+                wm_el = wm_init;
+            }
+        }
     };
 
 } // namespace CPVerifier

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=593446&r1=593445&r2=593446&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 Fri Nov 
9 00:18:23 2007
@@ -353,7 +353,7 @@
 
             //skip copying workmap->elements[m_max_locals] that in case of constructor
contains flags
 
-            for( ; i < m_stack_start + lastWorkmap->depth; i++ ) {
+            for( i = m_stack_start; i < m_stack_start + lastWorkmap->depth; i++ ) {
                 sm->elements[i].const_val = lastWorkmap->elements[i].const_val;
                 if( sm->elements[i].const_val == SM_THISUNINIT ) flag_element = SmConstant(SM_THISUNINIT);
             }

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java6/context_6.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java6/context_6.h?rev=593446&r1=593445&r2=593446&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java6/context_6.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/java6/context_6.h Fri Nov  9
00:18:23 2007
@@ -139,6 +139,10 @@
             *to = _WorkmapElement( tpool.get_ref_from_array(from->const_val) );
             return VF_OK;
         }
+
+        void new_bogus_propagation_constraint(WorkmapElement &wm_el, SmConstant init_val)
{
+            wm_el = _WorkmapElement (init_val);
+        }
     };
 
 } // namespace CPVerifier



Mime
View raw message