harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r531852 - in /harmony/enhanced/drlvm/trunk: src/test/regression/H3225/ vm/vmcore/src/verifier/
Date Tue, 24 Apr 2007 09:46:43 GMT
Author: gshimansky
Date: Tue Apr 24 02:46:42 2007
New Revision: 531852

URL: http://svn.apache.org/viewvc?view=rev&rev=531852
Log:
Applied HARMONY-3725 [drlvm][verifier] Eclipse help doesn't work


Modified:
    harmony/enhanced/drlvm/trunk/src/test/regression/H3225/PositiveJsrTest.j
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/Verifier.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_dataflow.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_graph.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_real.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_subroutine.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_utils.cpp

Modified: harmony/enhanced/drlvm/trunk/src/test/regression/H3225/PositiveJsrTest.j
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/regression/H3225/PositiveJsrTest.j?view=diff&rev=531852&r1=531851&r2=531852
==============================================================================
--- harmony/enhanced/drlvm/trunk/src/test/regression/H3225/PositiveJsrTest.j (original)
+++ harmony/enhanced/drlvm/trunk/src/test/regression/H3225/PositiveJsrTest.j Tue Apr 24 02:46:42
2007
@@ -36,6 +36,9 @@
     aload_0
     invokevirtual org/apache/harmony/drlvm/tests/regression/h3225/PositiveJsrTest/testCallFromHandler()V
 
+    aload_0
+    invokevirtual org/apache/harmony/drlvm/tests/regression/h3225/PositiveJsrTest/testBranches()V
+
     return
 .end method
 
@@ -114,7 +117,7 @@
 .end method
 
 ;
-; Subroutine is called from another subroutine twice.
+; A subroutine is called from another subroutine twice.
 ;
 .method public testNestedSubs()V
     .limit stack 1
@@ -136,7 +139,7 @@
 .end method
 
 ;
-; Subroutine is called from the exception handler of
+; A subroutine is called from the exception handler of
 ; the other subroutine.
 ;
 .method public testCallFromHandler()V
@@ -165,5 +168,37 @@
     return
 
 .catch all from LabelStartHandler to LabelEndHandler using LabelHandler
+.end method
+
+
+;
+; Subroutine contains different branches.
+;
+.method public testBranches()V
+    .limit stack 1
+    .limit locals 2
+
+    aconst_null
+    astore_0
+    jsr LabelSub
+    aload_0
+    pop
+    iconst_0
+    istore_0
+    jsr LabelSub
+    iload_0
+    return
+
+LabelSub:
+    astore 1
+LabelBranch:
+    aconst_null
+    ifnonnull LabelBranch
+    aconst_null
+    ifnull LabelRet
+    goto LabelBranch
+LabelRet:
+    ret 1
+
 .end method
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/Verifier.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/Verifier.cpp?view=diff&rev=531852&r1=531851&r2=531852
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/Verifier.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/Verifier.cpp Tue Apr 24 02:46:42 2007
@@ -3290,7 +3290,8 @@
     // create in vector
     vf_new_in_vector( instr, 1, ctx->m_pool );
     vf_set_in_vector_stack_entry_ref( instr, 0,
-                                      ctx->m_method_outvector->m_vtype );
+                                      ( ctx->m_method_outlen ) ? ctx->
+                                      m_method_outvector->m_vtype : 0 );
 
     // set flag and make checks
     vf_opcode_return( instr, next_pc, ctx );
@@ -4979,7 +4980,7 @@
     /**
      * Create type pool
      */
-    ctx.m_type = new vf_TypePool();
+    ctx.m_type = new vf_TypePool ();
 
     /**
      * Create memory pool

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_dataflow.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_dataflow.cpp?view=diff&rev=531852&r1=531851&r2=531852
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_dataflow.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_dataflow.cpp Tue Apr 24 02:46:42
2007
@@ -1038,7 +1038,8 @@
                  // dump instruction OUT vector
                  cerr << "-------------- instruction #" << index << ",
node #"
                  << node->m_nodecount << " out: " << endl;
-                 vf_dump_vector( invector, &instr[index], &cerr );}
+                 vf_dump_vector( invector, &instr[index], &cerr );
+                 }
          );
     }
     return VER_OK;
@@ -1076,7 +1077,8 @@
              m_nodecount << endl;
              // dump in vector
              cerr << "IN vector :" << endl;
-             vf_dump_vector( incoming, NULL, &cerr );} );
+             vf_dump_vector( incoming, NULL, &cerr );
+             } );
 
     // calculate OUT node vector
     vf_Result result = vf_set_node_out_vector( node, incoming, ctx );
@@ -1101,7 +1103,8 @@
              // dump out vector
              cerr << "-------------- Node #" << node->m_nodecount
              << endl << "OUT vector:" << endl;
-             vf_dump_vector( outcoming, NULL, &cerr );}
+             vf_dump_vector( outcoming, NULL, &cerr );
+             }
      );
 
     // check stack modifier
@@ -1219,7 +1222,7 @@
  * Creates a map for a start node.
  */
 static void
-vf_create_start_map( vf_Context *ctx )      // verification context
+vf_create_start_map( vf_Context *ctx )  // verification context
 {
     vf_Graph *graph = ctx->m_graph;
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_graph.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_graph.h?view=diff&rev=531852&r1=531851&r2=531852
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_graph.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_graph.h Tue Apr 24 02:46:42 2007
@@ -232,7 +232,7 @@
         }
         SkipContainer();
     }
-public:
+  public:
     /**
      * Empty constructor.
      */
@@ -361,7 +361,7 @@
      */
     void DumpDotEnd(ofstream &fout);
 
-public:
+  public:
     /**
      * Constructs a control flow graph and allocates memory for
      * graph structure, nodes and edges.
@@ -369,6 +369,8 @@
      * @param edgenum a number of graph edges
      * @param ctx     a verification context
      */
+
+
     vf_Graph(unsigned nodenum, unsigned edgenum,
         vf_ContextHandle ctx):m_nodes(NULL), m_edges(NULL),
         m_pool(ctx->m_pool), m_enum(NULL), m_nodenum(0), m_edgenum(0),
@@ -453,6 +455,10 @@
     {
         vf_InstrHandle instr = m_ctx->m_bc[pc].m_instr;
         assert(instr);
+
+
+
+
         assert(m_ctx->m_bc[pc].m_instr->m_addr - m_ctx->m_bytes == pc);
         vf_NodeHandle node = instr->m_node;
         assert(GetNodeNum(node) > m_ctx->m_handlers);

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_real.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_real.h?view=diff&rev=531852&r1=531851&r2=531852
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_real.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_real.h Tue Apr 24 02:46:42 2007
@@ -574,7 +574,7 @@
  */
 struct vf_Hash
 {
-public:
+  public:
     /**
      * Hash table constructor.
      * @note Function allocates memory for hash pool and hash table.
@@ -695,18 +695,18 @@
  */
 struct vf_TypePool
 {
-public:
+  public:
     /**
      * Type constraint collection constructor.
      * @note Function allocates memory for collection memory pool and hash table.
      */
-    vf_TypePool();
+    vf_TypePool ();
 
     /**
      * Type constraint collection destructor.
      * @note Function release memory for collection memory pool and hash table.
      */
-    ~vf_TypePool();
+               ~vf_TypePool ();
 
     /**
      * Function creates valid type which is identical to given class.
@@ -802,7 +802,7 @@
  */
 struct vf_Context
 {
-public:
+  public:
     /**
      * Verifier context constructor
      */
@@ -860,7 +860,7 @@
         vf_clean_pool( m_pool );
     }                           // vf_ClearContext
 
-public:
+  public:
     vf_TypePool *m_type;        ///< context type constraint collection
     char *m_error;              ///< context error message
     vf_Graph *m_graph;          ///< control flow graph

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_subroutine.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_subroutine.cpp?view=diff&rev=531852&r1=531851&r2=531852
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_subroutine.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_subroutine.cpp Tue Apr 24 02:46:42
2007
@@ -105,20 +105,20 @@
     return sub;
 }                               // AddNewSub
 
+
 /**
  * Adds a node to the subroutine.
- * @param[in] sub a subroutine
  * @param[in] node a node which is a part of this subroutine
  */
-static void AddSubNode(vf_Sub *sub, vf_Node *node)
+static inline void AddSubNode(vf_Node *node)
 {
-    assert(!node->m_sub);       // node is added once
-    node->m_sub = sub;
+    assert(node->m_mark);       // node is reachable
+    vf_Sub *sub = (vf_Sub *) node->m_sub;
     sub->m_nodenum++;
     // a number of out edges for reachable node won't
     // change while removing a dead code
     sub->m_out_edgenum += node->m_outnum;
-}                               // AddNewSub
+}                               // AddSubNode
 
 static inline vf_Result ResolveSubroutineEntryPoint(vf_Node *node,
     vf_Context *ctx)
@@ -168,49 +168,55 @@
 static vf_Result MarkNode(vf_NodeStack &stack, vf_Context *ctx);
 
 /**
- * Fills <code>m_sub</code> field of the node using <code>m_sub</code>
field of
- * the next node using the following rules:
- * <ul>
- * <li>If the mark of the next node is empty, it doesn't count.</li>
- * <li>If the mark of this node is empty, it is set to the following node
- * mark.</li>
- * <li>Otherwise node marks should be equal, or an error should be reported.</li>
- * </ul>
+ * Set a subroutine mark for the node and its predecessors. Stop recursive
+ * processing if the node subroutine mark is already set.
+ * @param[in] sub  the subroutine handle
+ * @param[in] node a node which is a part of a subroutine
+ * @param[in,out] ctx a verification context
+ * @return if the mark of this node is already set and is not equal to 
+ * <code>sub</code>, <code>VER_ErrorJsrMultipleRet</code> is reported
  */
 static inline vf_Result
-MergeSubMarks(vf_Node *node, vf_NodeHandle next_node, vf_Context *ctx)
+SetSubMarks(vf_SubHandle sub, vf_Node *node, vf_Context *ctx)
 {
-    if (next_node->m_sub) {
-        VF_TRACE("sub.mark", "sub[" << ctx->m_graph->GetNodeNum(node)
-            << "] := sub[" << ctx->m_graph->GetNodeNum(next_node->
-                m_sub->m_ret)
-            << "] (" << vf_get_sub_num(next_node->m_sub, ctx) << ")");
-        if (node->m_sub == NULL) {
-            AddSubNode((vf_Sub *) next_node->m_sub, node);
-        } else if (node->m_sub != next_node->m_sub) {
-            VF_REPORT(ctx,
-                "A subroutine splits execution into "
-                "several ret instructions");
-            return VER_ErrorJsrMultipleRet;
-        }
+    assert(sub);
+    VF_TRACE("sub.mark", "sub[" << ctx->m_graph->GetNodeNum(node)
+        << "] := sub[" << ctx->m_graph->GetNodeNum(sub->m_ret)
+        << "] (" << vf_get_sub_num(sub, ctx) << ")");
+    if (node->m_sub == sub) {
+        return VER_OK;          // already marked
     }
-    return VER_OK;
-}                               // MergeSubMarks
 
+    if (NULL == node->m_sub) {
+        if (node == ctx->m_graph->GetStartNode()) {
+            VF_REPORT(ctx, "Reached ret not using jsr branches");
+            return VER_ErrorJsrOther;
+        }
 
-/**
- * Marks an edge end node.
- */
-static inline vf_Result
-FollowEdge(vf_Node *node, vf_NodeStack &stack, vf_Context *ctx)
-{
-    vf_Result r = MarkNode(stack, ctx);
-    if (VER_OK != r) {
-        return r;
+        node->m_sub = sub;
+        if (node->m_mark) {
+            // add marked nodes now, others later
+            AddSubNode(node);
+        }
+        for (vf_EdgeHandle inedge = node->m_inedge;
+            inedge; inedge = inedge->m_innext) {
+            if (vf_is_jsr_branch(inedge, ctx)) {
+                continue;
+            }
+            vf_Result result =
+                SetSubMarks(sub, (vf_Node *) inedge->m_start, ctx);
+            if (result != VER_OK) {
+                return result;
+            }
+        }
+        return VER_OK;
     }
 
-    return MergeSubMarks(node, stack.m_node, ctx);
-}                               // FollowEdge
+    assert(node->m_sub != sub);
+    VF_REPORT(ctx,
+        "A subroutine splits execution into several ret instructions");
+    return VER_ErrorJsrMultipleRet;
+}                               // SetSubMarks
 
 /**
  * Marks a <code>jsr</code> edge end node. If the subroutine returns, marks a
node, which
@@ -219,25 +225,20 @@
 static inline vf_Result
 FollowJsrEdge(vf_Node *node, vf_NodeStack &stack, vf_Context *ctx)
 {
-    bool set_start = !ctx->m_sub_ctx->m_path_start;
-    if (set_start) {
+    vf_NodeStackHandle path_start = ctx->m_sub_ctx->m_path_start;
+    if (!path_start) {
         ctx->m_sub_ctx->m_path_start = &stack;
     }
+
     vf_Result r = MarkNode(stack, ctx);
     if (VER_OK != r) {
         return r;
     }
 
-    if (stack.m_node->m_sub) {
-        // if this jsr returns we need to process a node which
+    if (stack.m_node->m_sub->m_entry == stack.m_node) {
+        // this jsr returns, and we need to process a node which
         // follows after edge start node
-        if (stack.m_node->m_sub->m_entry != stack.m_node) {
-            VF_REPORT(ctx, "Subroutines merge their execution");
-            return VER_ErrorDataFlow;
-        }
-
         ctx->m_sub_ctx->m_path_fork = &stack;
-
         // select and check the following node
         stack.Set(node + 1, stack.m_node->m_sub->m_ret->m_outmap.m_depth);
         if (VF_NODE_END_ENTRY == stack.m_node->m_type) {
@@ -245,18 +246,22 @@
             return VER_ErrorBranch;
         }
         assert(VF_NODE_CODE_RANGE == stack.m_node->m_type);
-
         r = MarkNode(stack, ctx);
-        ctx->m_sub_ctx->m_path_fork = NULL;
         if (VER_OK != r) {
             return r;
         }
+        ctx->m_sub_ctx->m_path_fork = NULL;
     }
 
-    if (set_start) {
-        ctx->m_sub_ctx->m_path_start = NULL;
+    if (stack.m_node->m_sub) {
+        r = SetSubMarks(stack.m_node->m_sub, node, ctx);
+        if (VER_OK != r) {
+            return r;
+        }
     }
-    return MergeSubMarks(node, stack.m_node, ctx);
+
+    ctx->m_sub_ctx->m_path_start = path_start;
+    return r;
 }                               // FollowJsrEdge
 
 /**
@@ -269,7 +274,6 @@
 {
     vf_Graph *graph = ctx->m_graph;
     vf_Result r;
-
     vf_Result result =
         vf_check_node_stack_depth(stack.m_node, stack.m_depth, ctx);
     if (result != VER_Continue) {
@@ -277,21 +281,20 @@
     }
     VF_TRACE("sub.mark",
         "Processing node " << graph->GetNodeNum(stack.m_node));
+    if (stack.m_node->m_sub) {
+        AddSubNode(stack.m_node);
+    }
 
-    if (VF_NODE_CODE_RANGE == stack.m_node->m_type) {
-        vf_InstrType last_instr_type = stack.m_node->m_end->m_type;
-
-        if (VF_INSTR_RET == last_instr_type) {
-            if (!ctx->m_sub_ctx->m_path_start) {
-                VF_REPORT(ctx, "Reached ret not using jsr branches");
-                return VER_ErrorJsrOther;
-            }
-            vf_Sub *sub = AddNewSub(stack.m_node, ctx->m_sub_ctx);
-            AddSubNode(sub, stack.m_node);
-            r = ResolveSubroutineEntryPoint(stack.m_node, ctx);
-            if (VER_OK != r) {
-                return r;
-            }
+    if ((VF_NODE_CODE_RANGE == stack.m_node->m_type)
+        && (VF_INSTR_RET == stack.m_node->m_end->m_type)) {
+        vf_Sub *sub = AddNewSub(stack.m_node, ctx->m_sub_ctx);
+        r = SetSubMarks(sub, stack.m_node, ctx);
+        if (VER_OK != r) {
+            return r;
+        }
+        r = ResolveSubroutineEntryPoint(stack.m_node, ctx);
+        if (VER_OK != r) {
+            return r;
         }
     }
 
@@ -301,7 +304,7 @@
         outedge; outedge = outedge->m_outnext) {
         next_stack.Set(outedge->m_end, stack.m_depth);
         if (!vf_is_jsr_branch(outedge, ctx)) {
-            r = FollowEdge(stack.m_node, next_stack, ctx);
+            r = MarkNode(next_stack, ctx);
         } else {
             assert(VF_NODE_CODE_RANGE == outedge->m_end->m_type);
             assert(!outedge->m_outnext);
@@ -311,7 +314,6 @@
             return r;
         }
     }
-
     return VER_OK;
 }                               // MarkNode
 
@@ -320,17 +322,18 @@
 {
     vf_Graph *graph = ctx->m_graph;
     AllocateSubContext(ctx);
-
-    vf_NodeStack bottom =
-        { (vf_Node *) ctx->m_graph->GetStartNode(), 0, NULL };
+    vf_NodeStack bottom = {
+        (vf_Node *) ctx->m_graph->GetStartNode(), 0, NULL
+    };
     vf_Result r = MarkNode(bottom, ctx);
     return r;
 }                               // vf_mark_subroutines
 
 static vf_Result AddDupCount(vf_Sub *sub, unsigned &count, vf_Context *ctx)
 {
-    VF_TRACE("dupcount", "Calculating a duplication count for a subroutine #"
-        << vf_get_sub_num(sub, ctx));
+    VF_TRACE("dupcount",
+        "Calculating a duplication count for a subroutine #" <<
+        vf_get_sub_num(sub, ctx));
     if (ALL_BITS_SET == sub->m_dupcount) {
         VF_REPORT(ctx, "Found a recursive subroutine call sequence");
         return VER_ErrorJsrRecursive;
@@ -338,12 +341,10 @@
 
     if (!sub->m_dupcount) {
         sub->m_dupcount = ALL_BITS_SET;
-
         unsigned sum = 0;
         for (vf_EdgeHandle inedge = sub->m_entry->m_inedge;
             inedge; inedge = inedge->m_innext) {
             vf_NodeHandle node = inedge->m_start;
-
             if (vf_is_jsr_branch(inedge, ctx)) {
                 assert(!inedge->m_outnext);
                 if (node->m_sub == NULL) {
@@ -361,8 +362,9 @@
         sub->m_dupcount = sum;
     }
 
-    VF_TRACE("dupcount", "A duplication count for a subroutine #"
-        << vf_get_sub_num(sub, ctx) << " is " << sub->m_dupcount);
+    VF_TRACE("dupcount",
+        "A duplication count for a subroutine #" << vf_get_sub_num(sub,
+            ctx) << " is " << sub->m_dupcount);
     count += sub->m_dupcount;
     return VER_OK;
 }                               // AddSubDupCount
@@ -371,7 +373,6 @@
 {
     vf_Graph *graph = ctx->m_graph;
     vf_Sub *sub;
-
     for (sub = ctx->m_sub_ctx->m_sub; sub; sub = sub->m_next) {
         sub->m_nodes =
             (vf_NodeHandle *) vf_palloc(ctx->m_sub_ctx->m_pool,
@@ -415,7 +416,6 @@
         }
     }
     assert(0 == ctx->m_graph->HasMoreNodeSpace());
-
 }                               // InlineSubNodes
 
 /**
@@ -424,7 +424,6 @@
 static void InlineInEdges(vf_ContextHandle ctx)
 {
     vf_Graph *graph = ctx->m_graph;
-
     for (vf_SubHandle sub = ctx->m_sub_ctx->m_sub; sub; sub = sub->m_next) {
         ((vf_Sub *) sub)->m_following_nodes =
             (vf_Node **) vf_palloc(ctx->m_sub_ctx->m_pool,
@@ -465,7 +464,6 @@
 static void InlineOutEdges(vf_ContextHandle ctx)
 {
     vf_Graph *graph = ctx->m_graph;
-
     for (vf_SubHandle sub = ctx->m_sub_ctx->m_sub; sub; sub = sub->m_next) {
         if (!sub->m_copies) {
             continue;
@@ -474,12 +472,10 @@
         for (unsigned node_index = 0; node_index < sub->m_nodenum;
             node_index++, copy += sub->m_dupcount - 1) {
             vf_NodeHandle node = sub->m_nodes[node_index];
-
             for (vf_EdgeHandle outedge = node->m_outedge; outedge;
                 outedge = outedge->m_outnext) {
                 vf_NodeHandle end_node = outedge->m_end;
                 vf_SubHandle end_sub = end_node->m_sub;
-
                 vf_Node *c = copy;
                 if (NULL == end_sub) {
                     for (unsigned index = 1; index < sub->m_dupcount; index++) {
@@ -527,7 +523,6 @@
         vf_Node *ret_node = (vf_Node *) sub->m_ret;
         vf_Node **next_node = sub->m_following_nodes;
         graph->NewEdge(ret_node, *(next_node++));
-
         vf_Node *ret_node_copy =
             sub->m_copies + ret_node->m_nodecount * (sub->m_dupcount - 1);
         for (unsigned index = 1; index < sub->m_dupcount; index++) {
@@ -576,13 +571,11 @@
         edges += sub->m_dupcount;
     }
     ctx->m_graph->CreateEdges(edges);
-
     if (nodes) {
         ctx->m_graph->CreateNodes(nodes);
         InlineSubNodes(ctx);
     }
     InlineInEdges(ctx);
-
     if (nodes) {
         InlineOutEdges(ctx);
     }

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_utils.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_utils.cpp?view=diff&rev=531852&r1=531851&r2=531852
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_utils.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_utils.cpp Tue Apr 24 02:46:42
2007
@@ -230,7 +230,8 @@
 /**
  * Type constraint collection constructor.
  */
-vf_TypePool::vf_TypePool():m_method( NULL ), m_restriction( NULL )
+vf_TypePool::vf_TypePool ():m_method( NULL ),
+m_restriction( NULL )
 {
     m_pool = vf_create_pool();
     m_Hash = new vf_Hash ( m_pool );
@@ -239,7 +240,7 @@
 /**
  * Type constraint collection destructor.
  */
-vf_TypePool::~vf_TypePool()
+vf_TypePool::~vf_TypePool ()
 {
     delete m_Hash;
     vf_delete_pool( m_pool );
@@ -248,9 +249,8 @@
 /**
  * Function creates valid type which is identical to current class.
  */
-vf_ValidType *
-vf_TypePool::NewType( const char *type, // class name
-                      size_t len )      // name length
+vf_ValidType *vf_TypePool::NewType( const char *type,   // class name
+                                    size_t len )        // name length
 {
     vf_ValidType *result;
     vf_HashEntry *hash;
@@ -287,8 +287,7 @@
 /**
  * Function creates valid type which is identical to an element of a given array type.
  */
-vf_ValidType *
-vf_TypePool::NewArrayElemType( vf_ValidType *array )    // array type
+vf_ValidType *vf_TypePool::NewArrayElemType( vf_ValidType *array )      // array type
 {
     vf_ValidType *result;
     vf_HashEntry *hash;
@@ -327,8 +326,7 @@
 /**
  * Dumps constraint collection in stream.
  */
-void
-vf_TypePool::DumpTypeConstraints( ostream *out )        // output stream
+void vf_TypePool::DumpTypeConstraints( ostream *out )   // output stream
 {
     if( out == NULL ) {
         out = &cerr;
@@ -347,8 +345,7 @@
 /**
  * Function returns the methods constraints array.
  */
-inline vf_TypeConstraint *
-vf_TypePool::GetClassConstraint()
+inline vf_TypeConstraint *vf_TypePool::GetClassConstraint()
 {
     return m_restriction;
 }                               // vf_TypePool::GetClassConstraint
@@ -356,8 +353,7 @@
 /**
  * Sets current context method.
  */
-void
-vf_TypePool::SetMethod( method_handler method )
+void vf_TypePool::SetMethod( method_handler method )
 {
     // set method
     m_method = method;
@@ -366,11 +362,10 @@
 /**
  * Sets restriction from target class to source class.
  */
-void
-vf_TypePool::SetRestriction( const char *target,        // target class name
-                             const char *source,        // source class name
-                             unsigned short index,      // constant pool index
-                             vf_CheckConstraint check_type )    // constraint check type
+void vf_TypePool::SetRestriction( const char *target,   // target class name
+                                  const char *source,   // source class name
+                                  unsigned short index, // constant pool index
+                                  vf_CheckConstraint check_type )       // constraint check
type
 {
     vf_TypeConstraint *restriction;
 
@@ -419,11 +414,10 @@
 /**
  * Checks types and create constraints if it's necessarily.
  */
-bool
-vf_TypePool::CheckTypes( vf_ValidType *required,        // required type
-                         vf_ValidType *available,       // available type
-                         unsigned short index,  // constant pool index
-                         vf_CheckConstraint check_type )        // constraint check type
+bool vf_TypePool::CheckTypes( vf_ValidType *required,   // required type
+                              vf_ValidType *available,  // available type
+                              unsigned short index,     // constant pool index
+                              vf_CheckConstraint check_type )   // constraint check type
 {
     unsigned index1, index2;
 
@@ -530,9 +524,8 @@
  * Function merges two valid types.
  * Function returns NULL if vector wasn't merged.
  */
-vf_ValidType *
-vf_TypePool::MergeTypes( vf_ValidType *first,   // first merged type
-                         vf_ValidType *second ) // second merged type
+vf_ValidType *vf_TypePool::MergeTypes( vf_ValidType *first,     // first merged type
+                                       vf_ValidType *second )   // second merged type
 {
     // check null reference
     if( first == NULL ) {



Mime
View raw message