summaryrefslogtreecommitdiff
path: root/libjava/verify.cc
Commit message (Collapse)AuthorAgeFilesLines
* * verify.cc: Undef PC.ro2004-03-191-0/+5
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@79690 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-02-01 Michael Koch <konqueror@gmx.de>mkoch2004-02-011-1/+1
| | | | | | | | | | * include/jvm.h (MAYBE_UNUSED): New macro tp mark probably unused arguments. * jni.cc (_Jv_LookupJNIMethod): Mark 'args_size' unused. * verify.cc (debug_print): Mark 'fmt' unused. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@77079 138bc75d-0d04-0410-961f-82ee72b054a4
* PR libgcj/13107:tromey2004-01-231-616/+340
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * testsuite/libjava.lang/pr13107_2.xfail: New file. * testsuite/libjava.lang/pr13107_3.xfail: New file. * testsuite/libjava.lang/pr13107_3.java: New file. * testsuite/libjava.lang/pr13107_3.out: New file. * testsuite/libjava.lang/pr13107_2.java: New file. * testsuite/libjava.lang/pr13107_2.out: New file. * testsuite/libjava.lang/pr13107.java: New file. * testsuite/libjava.lang/pr13107.out: New file. * verify.cc (jsr_ptrs): Removed. (entry_points): Likewise. (struct subr_info): Likewise. (struct subr_entry_info): Likewise. (type_val::unused_by_subroutine_type): Likewise. (type::merge): Don't handle unused_by_subroutine_type. (type::print): Likewise. (state::flags): Removed. (state::subroutine): Likewise. (state::seen_subrs): Likewise. (state::NO_STACK): Likewise. (state::FLAG_CHANGED, state::FLAG_UNUSED): Likewise. (state): Updated all methods. (state::clean_subrs): Removed. (state::state): Removed `ret_semantics' flag. (state::copy): Likewise. (state::add_subr): Removed. (state::enter_subroutine): Likewise. (type::set_return_address): New method. (handle_jsr_insn): Set return address on the type. Always invalidate PC after call. (check_nonrecursive_call): Removed. (~_Jv_BytecodeVerifier): Updated. (branch_prepass): Removed special handling of jsr. (note_branch_target): Likewise. (get_subroutine): Removed. (state::merge): Don't merge subroutines and don't handle NO_STACK. Removed ret_semantics and jsr_semantics arguments. (state::note_variable): Removed. (state::is_unmerged_ret_state): Likewise. (state::print): Updated. (set_variable): Likewise. (merge_into): Renamed from push_jump_merge. Removed ret_semantics and jsr_semantics arguments. Updated for new reverification list. (pop_jump): Rewrote. (construct_primitive_array_type): Updated. (state::next): Removed. (INVALID_STATE): New define. (state::INVALID): Removed. (state::NO_NEXT): New value. (state::pc, state::next): New fields. (state::get_pc): New method. (next_verify_pc): Removed. (next_verify_state): New field. (verify_instructions_0): Always check for falling off end. (linked): New type. (linked_utf8): Removed. (states): Changed type. (type::state_mergeable_p): New method. (state::state_mergeable_p): Likewise. (handle_ret_insn): Removed most code. (state::reverify): New method. (add_new_state): Likewise. (state::set_pc): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@76395 138bc75d-0d04-0410-961f-82ee72b054a4
* PR libgcj/13439:tromey2004-01-081-26/+107
| | | | | | | | | | | | | | | | * verify.cc (state::merge): Copy changed locals out of subroutine in NO_STACK case. (state::FLAG_CHANGED): New const. (state::FLAG_UNUSED): Likewise. (state::local_changed): Removed. Updated all users. (state::flags): New field. (state::merge): Added jsr_semantics argument, more logic. (push_jump_merge): Added jsr_semantics argument. (handle_jsr_insn): Set jsr_semantics on push_jump_merge when merging through the jsr instruction. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@75533 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (state::clean_subrs): Clear seen_subrs.jsturm2003-12-021-3/+3
| | | | | | | | (state::copy): Walk seen_subrs from copy, not `this'. Don't clear seen_subrs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74152 138bc75d-0d04-0410-961f-82ee72b054a4
* PR libgcj/13026:tromey2003-11-191-3/+4
| | | | | | | | | | * verify.cc (state::copy): Only set local_changed if we're in a subroutine. Correctly copy local variables which were modified by the subroutine. (push_jump_merge): Added more debugging output. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73722 138bc75d-0d04-0410-961f-82ee72b054a4
* For PR libgcj/7482:tromey2003-07-241-232/+310
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * verify.cc (ref_intersection): New class. (type_val): Removed unresolved_reference_type, uninitialized_unresolved_reference_type. (is_assignable_from_slow): Rewrote. (type::data): Removed. (type::klass): New field. (type::type): Added verifier argument. (type::resolve): Removed. (type::set_uninitialized): Updated for change to type_val. (type::set_initialized): Likewise. (type::isinitialized): Likewise. (type::print): Likewise. (construct_primitive_array_type): Likewise. (type::compatible): Updated for change to type_val and to use ref_intersection. (type::isarray): Updated to use ref_intersection. (type::isinterface): Likewise. (type::element_type): Likewise. (type::to_array): Likewise. (type::verify_dimensions): Rewrote. (type::merge): Likewise. (check_class_constant): Updated for type constructor change. (check_constant): Likewise. (check_field_constant): Likewise. (get_one_type): Likewise. (initialize_stack): Likewise. (verify_instructions_0): Likewise. (verify_instructions_0) [op_invokeinterface]: Removed special case. (isect_list): New field. (_Jv_BytecodeVerifier): Initialize it. (~_Jv_BytecodeVerifier): Destroy ref_intersection objects. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69751 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc: Reverted previous patch.tromey2003-05-071-2/+60
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66548 138bc75d-0d04-0410-961f-82ee72b054a4
* PR libgcj/10582:tromey2003-05-011-60/+2
| | | | | | | | | | | | * verify.cc (_Jv_BytecodeVerifier::is_assignable_from_slow): Removed. (type::compatible): Use _Jv_IsAssignableFrom. * java/lang/natClass.cc (iindex_mutex_initialized): Now static. (_Jv_IsAssignableFrom): Work even when source or target class is not prepared. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66348 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (pop64): Removed.tromey2003-04-111-11/+17
| | | | | | | | | | (verify_instructions_0) <op_pop2>: Inline code. Don't throw exception if top-of-stack is narrow. (initialize_stack): Check to ensure that <init> is not static and <clinit> is. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@65453 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (handle_jsr_insn): Don't fail if `jsr' appears at endtromey2003-03-031-10/+15
| | | | | | | | | of bytecode. (handle_ret_insn): Fail if returning to jsr that appears at end of bytecode. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@63744 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (_Jv_BytecodeVerifier::pop_jump): Removed unusedtromey2003-02-161-2/+0
| | | | | | | variable. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@62980 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (state::seen_subrs): New field.tromey2003-02-131-5/+58
| | | | | | | | | | | | | (state::state): Initialize it. (state::clean_subrs): New method. (state::~state): Call it. (state::copy): Copy subroutine list. (state::add_subr): New method. (state::merge): Only register a change if the current subroutine hasn't yet been noted. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@62878 138bc75d-0d04-0410-961f-82ee72b054a4
* * boehm.cc: Remove stray semicolon.mmitchel2002-12-281-28/+28
| | | | | | | | | | | | | | | | | * interpret.cc: Likewise. * prims.cc: Likewise. * verify.cc (_Jv_BytecodeVerifier::verify_fail): Move definition earlier to ensure default arguments are processed. * gcj/array.h (JArray): Add forward declaration. (elements): Likewise. * gcj/javaprim.h: Remove stray semicolons. * include/bohm-gc.h: Likewise. * include/jni.h: Likewise. * include/jvm.h: Likewise. * java/lang/Class.h (_Jv_GetArrayClass): Declare _Jv_NewArrayClass. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@60556 138bc75d-0d04-0410-961f-82ee72b054a4
* Fixed snafu caused when fixing previous snafu.tromey2002-12-051-2/+2
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59846 138bc75d-0d04-0410-961f-82ee72b054a4
* Fixed ChangeLog patch snafutromey2002-12-051-2/+2
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59844 138bc75d-0d04-0410-961f-82ee72b054a4
* 2002-12-03 Andrew Haley <aph@redhat.com>aph2002-12-031-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * java/lang/natClassLoader.cc (_Jv_PrepareCompiledClass): Call _Jv_PushClass. (_Jv_InitNewClassFields): Set protectionDomain and chain = NULL. (_Jv_PopClass): New. (_Jv_PushClass): New. * java/lang/natClass.cc (forName (jstring)): Use a StackTrace to discover the ClassLoader of our caller. (_Jv_CheckArrayStore): Don't check that a class is assignment compatible with Object. * java/lang/natVMTHrowable.cc: Delete. * gnu/gcj/runtime/StackTrace.java: New, partly copied from java.lang.VMThrowable. (StackTrace(), StackTrace(int)): New constructors. (classAt, methodAt, update, methodAtAddress): New methods. (map): New field. * java/lang/VMThrowable.java: Use StackTrace instead of natVMTHrowable. * java/lang/Class.h (getClassLoaderInternal): New. (class Class): Be friendly with _Jv_PopClass and _Jv_PushClass. Be friendly with gnu::gcj::runtime::StackTrace. (Object.chain): New field. * include/java-interp.h (class _Jv_InterpMethod): Be friendly with gnu::gcj::runtime::StackTrace. * prims.cc (_Jv_NewObjectArray): Use getClassLoaderInternal() instead of getClassLoader(). * verify.cc (class _Jv_BytecodeVerifier): Likewise. java::lang::VMThrowable. * Makefile.am (core_java_source_files): Add MethodRef.java, StackTrace.java. (nat_source_files): Remove natVMThrowable.cc; add natStackTrace.cc. * Makefile.in: Rebuild. 2002-12-03 Andrew Haley <aph@redhat.com> * class.c (make_class_data): New field, "chain". * decl.c (java_init_decl_processing): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59769 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (pop_init_ref): New method.tromey2002-11-271-26/+48
| | | | | | | | | | | | | | | (verify_instructions_0) [op_iaload, op_laload, op_faload, op_daload, op_aaload, op_baload, op_caload, op_saload, op_iastore, op_lastore, op_fastore, op_dastore, op_aastore, op_bastore, op_castore, op_sastore, op_areturn, op_arraylength, op_checkcast, op_instanceof, op_monitorenter, op_monitorexit]: Use it. (verify_instructions_0) [op_invokevirtual, op_invokespecial, op_invokestatic, op_invokeinterface]: Use pop_init_ref. Don't let `this' argument be uninitialized. Don't let `null' be passed as `this' to construtor. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59558 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (type::compatible): Backed out broken change.tromey2002-11-261-5/+5
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59496 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (type::compatible): Check initialization statustromey2002-11-261-6/+5
| | | | | | | | | first. * interpret.cc (run) [insn_invokespecial, invokespecial_resolved]: Don't use NULLCHECK. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59494 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (branch_prepass): Updated for change to exceptiontromey2002-06-241-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | handler type. (verify_instructions_0): Likewise. * defineclass.cc (handleCodeAttribute): Initialize `prepared'. (handleExceptionTableEntry): Updated for change to exception handler type. * java/lang/Class.h (Class): Removed _Jv_InterpMethodInvocation. * include/java-interp.h (_Jv_InterpMethodInvocation): Removed. (union _Jv_InterpPC): New. (class _Jv_InterpException): Changed types to _Jv_InterpPC. (class _Jv_InterpMethod): Added new `prepared' field. (class _Jv_InterpMethod): Added `compile' method. Removed `continue1' and `find_exception'. Changed arguments to `run'. * interpret.cc (union insn_slot): New. (find_exception): Removed. (run_normal): Removed most logic. (run_synch_object): Likewise; also, use JvSynchronize. (run_synch_class): Likewise. (run): Removed. (continue1): Renamed as `run'. Compile bytecode if required. Add new code to allow refinement of direct-threaded code at runtime. Handle exceptions. (SAVE_PC): Removed. (compile): New method. (SET_ONE, SET_INSN, SET_INT, SET_DATUM): New defines. (NULLARRAYCHECK): Don't use SAVE_PC. (pc_t): New typedef. (TAKE_GOTO, GET1S, GET1U, GET2U, AVAL1U, AVAL2U, AVAL2UP, SKIP_GOTO, GOTO_VAL, PCVAL, AMPAMP): New macros. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54968 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (construct_primitive_array_type) [void_type]: Newtromey2002-04-261-0/+61
| | | | | | | | | | | | | | case. (branch_prepass): Added dummy entries for unused instruction values. (verify_instructions_0): Likewise. * interpret.cc (continue1): Comment fix. * include/java-insns.h (op_xxxunusedxxx1): Removed. * Makefile.in: Rebuilt. * Makefile.am: Added -Wswitch-enum. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@52814 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (state::NO_STACK): New constant.tromey2002-03-101-22/+53
| | | | | | | | | | | | | (state::is_unmerged_ret_state): Handle case where stacktop is NO_STACK. (state::merge): Handle NO_STACK merges. (handle_jsr_insn): Invalidate PC, and use special NO_STACK state for instruction following jsr. (stacktop, stackdepth): Removed unused variables. (pop_jump): Ignore case where all remaining states are skipped. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@50526 138bc75d-0d04-0410-961f-82ee72b054a4
* Fix for PR libgcj/5696:tromey2002-02-201-12/+12
| | | | | | | | | | | | | * verify.cc (is_assignable_from_slow): Never call _Jv_IsAssignableFrom. (verify_instructions_0): Added new debug statement. (state::print): Print information about whether local has changed. (state::merge): Don't call note_variable when merging locals. (state::set_exception): Removed old FIXME comment. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49886 138bc75d-0d04-0410-961f-82ee72b054a4
* Fix for PR libgcj/5695:tromey2002-02-151-4/+26
| | | | | | | | | | * verify.cc (is_assignable_from_slow): Check to see if target is an Object before checking to see if source is an interface. (verify_instructions_0) [op_invokeinterface]: Handle case where we're making an interface call on Object. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49783 138bc75d-0d04-0410-961f-82ee72b054a4
* 2002-02-13 Todd Stock <toddastock@yahoo.com>tromey2002-02-141-2/+14
| | | | | | | | | Fix for PR libgcj/5670: * verify.cc (is_assignable_from_slow): If `source' is interface, recursively look for merge with `target'. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49769 138bc75d-0d04-0410-961f-82ee72b054a4
* 2002-02-13 Todd Stock <toddastock@yahoo.com>tromey2002-02-131-2/+7
| | | | | | | | | Fix for PR libgcj/5671: * verify.cc (state::merge): Handle case where we're merging against an interface. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49735 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (require_array_type): If argument is a null array oftromey2002-02-071-2/+4
| | | | | | | references, return null as the element type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49561 138bc75d-0d04-0410-961f-82ee72b054a4
* 2002-02-06 Mark Wielaard <mark@klomp.org>tromey2002-02-071-0/+2
| | | | | | | | * verify.cc (verify_instructions_0) [op_dup2]: Actually push the duplicate of a wide type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49559 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (type::isnull): New method.tromey2002-02-061-1/+10
| | | | | | | | (require_array_type): Handle case where array is null. (verify_instructions_0) [op_arraylength]: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49555 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (state::enter_subroutine): New method.tromey2002-02-011-10/+30
| | | | | | | | | | | (handle_jsr_insn): Use it. (state::merge): When processing a `ret', correctly use subroutine's state to determine which local variables have changed. (push_exception_jump): Don't let stack overflow. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49388 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (handle_ret_insn): Check for subroutine merge here...tromey2002-01-301-9/+72
| | | | | | | | | | | (state::merge): ... not here. (subr_entry_info): New structure. (entry_points): New field. (~_Jv_BytecodeVerifier): Correctly free jsr_ptrs. Free entry_points. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49344 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (class _Jv_BytecodeVerifier) [op_invokeinterface]:tromey2002-01-281-7/+16
| | | | | | | `nargs' byte is number of words, not number of arguments. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49292 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (class _Jv_BytecodeVerifier): Removed `FIXME' commenttromey2002-01-281-13/+14
| | | | | | | | | | and to-do list. (state::merge): Use current class' class loader. (state::print): Print subroutine. (state::merge): Don't look at subroutine of unmerged `ret'. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49274 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (verify_fail): Change from being a top-level functionbothner2002-01-261-106/+107
| | | | | | | | | | | | | | to e method of _Jv_BytecodeVerifier. Emit current method name. Pass the current verifier to type: and state: methods as needed, for better error messages, and for resolve. (resolve): Pass current class's loader for Class.forName and _Jv_FindClassFromSignature, rather than using the default loader. (various type: and state: methods): Take _Jv_BytecodeVerifier* arg. (get_type_val_for_signature): Make non-static. (various methods): Pass start_PC implicitly, not explicitly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49240 138bc75d-0d04-0410-961f-82ee72b054a4
* Updated copyright datetromey2002-01-251-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49207 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (is_assignable_from_slow): If source is an interface,bothner2002-01-241-1/+3
| | | | | | | we must also check the superclass. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49189 138bc75d-0d04-0410-961f-82ee72b054a4
* * resolve.cc (_Jv_PrepareClass): Verify method here...tromey2001-12-101-28/+83
| | | | | | | | | | | | | | | | | | | | | | * defineclass.cc (handleMethodsEnd): ... not here. * verify.cc (_Jv_BytecodeVerifier::initialize_stack): New method. (_Jv_BytecodeVerifier::verify_instructions_0) [op_return]: Ensure there are no uninitialized objects. (_Jv_BytecodeVerifier::state::this_type): New field. (_Jv_BytecodeVerifier::state::state): Initialize this_type. (_Jv_BytecodeVerifier::state::copy): Copy this_type. (_Jv_BytecodeVerifier::state::merge): Merge this_type. (_Jv_BytecodeVerifier::state::check_no_uninitialized_objects): Handle this_type. (_Jv_BytecodeVerifier::state::check_this_initialized): New method. (_Jv_BytecodeVerifier::state::set_initialized): Handle this_type. (_Jv_BytecodeVerifier::state::set_this_type): New method. (_Jv_BytecodeVerifier::verify_instructions_0) [op_putfield]: Allow assignment to fields of `this' before another initializer is run. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47826 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (_Jv_BytecodeVerifier::is_assignable_from_slow):tromey2001-12-091-6/+8
| | | | | | | Handle case of array whose component type is not prepared. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47799 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (_Jv_BytecodeVerifier::branch_prepass): Set start_PCtromey2001-12-071-3/+8
| | | | | | | | | earlier, for error handling. (_Jv_BytecodeVerifier::note_branch_target): Fixed branch target check. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47769 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (_Jv_BytecodeVerifier::FLAG_JSR_TARGET): Removed.tromey2001-12-071-2/+0
| | | | | | | (_Jv_BytecodeVerifier::note_branch_target): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47745 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (_Jv_BytecodeVerifier::type_val): Addedtromey2001-12-061-19/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | unused_by_subroutine_type. (_Jv_BytecodeVerifier::type::merge): Handle unused_by_subroutine_type. (_Jv_BytecodeVerifier::state::state): Added `ret_semantics' argument. (_Jv_BytecodeVerifier::state::copy): Likewise. (_Jv_BytecodeVerifier::push_jump_merge): Pass `ret_semantics' to state constructor. (_Jv_BytecodeVerifier::state::is_unmerged_ret_state): New method. (_Jv_BytecodeVerifier::pop_jump): Don't accept a jump which is from an unmerged ret. (_Jv_BytecodeVerifier::verify_instructions_0): Don't let an unmerged ret state skip verification in the fall-through case. (debug_print): New function. (_Jv_BytecodeVerifier::type::print): New method. (_Jv_BytecodeVerifier::state::print): New method. (_Jv_BytecodeVerifier::push_jump_merge): Print state. (_Jv_BytecodeVerifier::verify_instructions_0): Likewise. (_Jv_BytecodeVerifier::get_variable): Don't call note_variable. (_Jv_BytecodeVerifier::_Jv_BytecodeVerifier): Print debug information. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47734 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (_Jv_BytecodeVerifier::linked_utf8): New structure.tromey2001-12-041-4/+45
| | | | | | | | | | | | | | (_Jv_BytecodeVerifier::utf8_list): New field. (_Jv_BytecodeVerifier::_Jv_BytecodeVerifier): Initialize it. (_Jv_BytecodeVerifier::~_Jv_BytecodeVerifier): Free it. (_Jv_BytecodeVerifier::make_utf8_const): New method. (_Jv_BytecodeVerifier::get_one_type): Use it. (_Jv_BytecodeVerifier::type::merge): When using local semantics, if the destination type is already unsuitable then we didn't change. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47634 138bc75d-0d04-0410-961f-82ee72b054a4
* * defineclass.cc (read_one_method_attribute): `end_pc' for antromey2001-12-041-33/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | exception can be equal to code length. * verify.cc (_Jv_BytecodeVerifier::verify_instructions_0): Removed `start_PC' from error invocation where it didn't make sense, and updated error message. Use `copy' to copy a state. Only try to merge current state with saved state when we've fallen through from the previous instruction. (_Jv_BytecodeVerifier::pop_ref_or_return): New method. (_Jv_BytecodeVerifier::verify_instructions_0) [op_astore_0]: Use pop_ref_or_return. (_Jv_BytecodeVerifier::verify_instructions_0) [op_astore]: Likewise. (_Jv_BytecodeVerifier::push_jump_merge): Pass max_locals, not max_stack, to merge. (_Jv_BytecodeVerifier::verify_instructions_0): Likewise. (_Jv_BytecodeVerifier::push_jump_merge): Merge from new state into state at branch target, not vice versa. (_Jv_BytecodeVerifier::branch_prepass): Allow end of exception to be equal to code length. Removed redundant test to see if exception start is after exception end. (_Jv_BytecodeVerifier::verify_instructions_0): Type of argument to `finally' is Throwable. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47623 138bc75d-0d04-0410-961f-82ee72b054a4
* * defineclass.cc (handleMethodsEnd): Invoke verifier here...tromey2001-12-041-2/+2
| | | | | | | | | (handleCodeAttribute): ... not here. * verify.cc (_Jv_BytecodeVerifier::state::state): Use `copy', not structure assignment. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47591 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (_Jv_BytecodeVerifier::branch_prepass): Usetromey2001-11-251-8/+8
| | | | | | | | | | | java_opcode as type for switch. [op_wide]: Likewise. (_Jv_BytecodeVerifier::verify_instructions_0): Likewise. [op_invokevirtual]: Likewise. * include/java-insns.h (java_opcode): Give enum a name. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47330 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (_Jv_BytecodeVerifier::branch_prepass) [op_iinc]:tromey2001-11-201-6/+6
| | | | | | | | | | | | | Uses two operand bytes, not one. [op_arraylength]: Has no operands in bytecode. (_Jv_BytecodeVerifier::push_jump): Fixed call to check_no_uninitialized_objects. (_Jv_BytecodeVerifier::push_exception_jump): Likewise. (_Jv_BytecodeVerifier::handle_ret_insn): Likewise. (_Jv_BytecodeVerifier::handle_jsr_insn): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47202 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (_Jv_BytecodeVerifier::require_array_type): Specialtromey2001-11-201-3/+13
| | | | | | | | | | case for boolean arrays. * verify.cc (_Jv_BytecodeVerifier::compute_jump): Put PC into error message. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47190 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (_Jv_BytecodeVerifier::verify_instructions_0)tromey2001-11-191-3/+6
| | | | | | | | [op_lshl, op_lshr, op_lushr]: Shift argument is an int, not a long. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47177 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (type::to_array): New method.tromey2001-11-191-1/+18
| | | | | | | | (_Jv_BytecodeVerifier::verify_instructions_0) [op_anewarray]: Construct new array type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47165 138bc75d-0d04-0410-961f-82ee72b054a4