You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by gs...@apache.org on 2007/04/24 21:29:14 UTC
svn commit: r532049 - in /harmony/enhanced/drlvm/trunk:
src/test/regression/H3225/ vm/vmcore/src/verifier/
Author: gshimansky
Date: Tue Apr 24 12:29:13 2007
New Revision: 532049
URL: http://svn.apache.org/viewvc?view=rev&rev=532049
Log:
Applied additional patch for HARMONY-3725 ([drlvm][verifier] Eclipse help doesn't work) and patch that fixes bug in HARMONY-2281 [drlvm][verifier] Remove assignment compatible check for aastore instruction
Modified:
harmony/enhanced/drlvm/trunk/src/test/regression/H3225/NegativeJsrTest.java
harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/Graph.cpp
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_real.h
harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_subroutine.cpp
Modified: harmony/enhanced/drlvm/trunk/src/test/regression/H3225/NegativeJsrTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/src/test/regression/H3225/NegativeJsrTest.java?view=diff&rev=532049&r1=532048&r2=532049
==============================================================================
--- harmony/enhanced/drlvm/trunk/src/test/regression/H3225/NegativeJsrTest.java (original)
+++ harmony/enhanced/drlvm/trunk/src/test/regression/H3225/NegativeJsrTest.java Tue Apr 24 12:29:13 2007
@@ -1,8 +1,8 @@
package org.apache.harmony.drlvm.tests.regression.h3225;
/**
- * The class launches methods which contain invalid <code>jsr</code>
- * usage and should be rejected by a verifier.
+ * The class launches methods which contain invalid <code>jsr</code> usage and
+ * should be rejected by a verifier.
*/
public class NegativeJsrTest extends junit.framework.TestCase {
public static void main(String args[]) {
@@ -49,4 +49,3 @@
fail("The test should throw java.lang.VerifyError");
}
}
-
Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/Graph.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/Graph.cpp?view=diff&rev=532049&r1=532048&r2=532049
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/Graph.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/Graph.cpp Tue Apr 24 12:29:13 2007
@@ -656,6 +656,7 @@
vf_remove_inedge( edge );
}
node->m_inedge = node->m_outedge = NULL;
+ node->m_sub = NULL;
node->m_outnum = 0;
}
}
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=532049&r1=532048&r2=532049
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/Verifier.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/Verifier.cpp Tue Apr 24 12:29:13 2007
@@ -2399,11 +2399,7 @@
vf_set_in_vector_stack_entry_ref( instr, 0, NULL );
vf_set_in_vector_check( instr, 0, VF_CHECK_REF_ARRAY );
vf_set_in_vector_stack_entry_int( instr, 1 );
- if( vf_is_class_version_14( ctx ) ) {
- vf_set_in_vector_type( instr, 2, SM_UP_ARRAY );
- } else {
- vf_set_in_vector_stack_entry_ref( instr, 2, NULL );
- }
+ vf_set_in_vector_stack_entry_ref( instr, 2, NULL );
} // vf_opcode_aastore
/**
@@ -4709,8 +4705,8 @@
index += 2;
// zero number of opcode new is reserved for "uninitialized this"
result =
- vf_opcode_new( instr, const_index, instr - ctx->m_instr + 1,
- ctx );
+ vf_opcode_new( instr, const_index,
+ vf_get_instr_index( instr, ctx ) + 1, ctx );
if( VER_OK != result ) {
return result;
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=532049&r1=532048&r2=532049
==============================================================================
--- 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 12:29:13 2007
@@ -1018,28 +1018,23 @@
// set OUT vector for a handler node
return vf_get_handler_out_vector( invector, &node->m_outmap );
}
- // get first instruction
- vf_InstrHandle instr = node->m_start;
- unsigned instruction = node->m_end - node->m_start + 1;
-
// set out vector for each instruction
- for( unsigned index = 0; index < instruction; index++ ) {
- if( ( 0 == instr[index].m_inlen + instr[index].m_outlen )
- && ( VF_INSTR_NONE == instr[index].m_type ) ) {
+ for( vf_InstrHandle instr = node->m_start; instr <= node->m_end; instr++ ) {
+ if( ( 0 == instr->m_inlen + instr->m_outlen )
+ && ( VF_INSTR_NONE == instr->m_type ) ) {
continue;
- } else {
- result = vf_get_instruction_out_vector( node, &instr[index],
- invector, ctx );
}
+ result = vf_get_instruction_out_vector( node, instr, invector, ctx );
if( VER_OK != result ) {
return result;
}
VF_DUMP( DUMP_INSTR_MAP, {
// dump instruction OUT vector
- cerr << "-------------- instruction #" << index << ", node #"
- << node->m_nodecount << " out: " << endl;
- vf_dump_vector( invector, &instr[index], &cerr );
- }
+ cerr << "-------------- instruction #" << ( instr -
+ node->
+ m_start ) <<
+ ", node #" << node->m_nodecount << " out: " << endl;
+ vf_dump_vector( invector, instr, &cerr );}
);
}
return VER_OK;
@@ -1077,8 +1072,7 @@
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 );
@@ -1103,8 +1097,7 @@
// 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
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=532049&r1=532048&r2=532049
==============================================================================
--- 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 12:29:13 2007
@@ -1155,6 +1155,18 @@
} // vf_set_vector_stack_entry_ref
/**
+ * Gets an instruction index.
+ * @param[in] instr an instruction handle
+ * @param[in] ctx a verification context
+ * @return an instruction index
+ */
+static inline unsigned
+vf_get_instr_index( vf_InstrHandle instr, vf_ContextHandle ctx )
+{
+ return ( unsigned )( instr - ctx->m_instr );
+}
+
+/**
* Calculates an index of instruction.
* @param[in] pc a bytecode index at instruction start
* @param[in] ctx a verification context
@@ -1165,7 +1177,7 @@
{
vf_InstrHandle instr = ctx->m_bc[pc].m_instr;
assert( instr );
- return instr - ctx->m_instr;
+ return vf_get_instr_index( instr, ctx );
}
/**
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=532049&r1=532048&r2=532049
==============================================================================
--- 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 12:29:13 2007
@@ -142,7 +142,7 @@
}
map->m_stack[index].m_type = SM_RETURN_ADDR;
map->m_stack[index].m_pc =
- p_element->m_node->m_start->m_addr - ctx->m_bytes;
+ (unsigned) (p_element->m_node->m_start->m_addr - ctx->m_bytes);
}
VF_DUMP(DUMP_NODESTACK, DumpNodeStack(ctx));