summaryrefslogtreecommitdiffstats
path: root/libjava/verify.cc
Commit message (Collapse)AuthorAgeFilesLines
...
* * 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
* * verify.cc (_Jv_BytecodeVerifier::branch_prepass) [op_sipush]:tromey2001-11-191-2/+2
| | | | | | | | Skip a short, not a byte. [op_newarray]: Skip a byte, not a short. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47163 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (_Jv_BytecodeVerifier::get_type_val_for_signature):tromey2001-11-191-0/+3
| | | | | | | Added `B' case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47162 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (_Jv_BytecodeVerifier::get_ushort): Use `jint' fortromey2001-11-191-10/+10
| | | | | | | | | | | temporary values. (_Jv_BytecodeVerifier::get_short): Likewise. (_Jv_BytecodeVerifier::get_int): Likewise. (_Jv_BytecodeVerifier::check_return_type): Reverse ordering of `compatible' call. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47161 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (_Jv_BytecodeVerifier::pop_type): Put PC into errortromey2001-11-191-12/+16
| | | | | | | | | | | | | message. (_Jv_BytecodeVerifier::pop64): Likewise. (_Jv_BytecodeVerifier::pop32): Likewise. (_Jv_BytecodeVerifier::pop_raw): Likewise. (_Jv_BytecodeVerifier::pop_type): Promote the match type. (type::set_initialized): Only modify uninitialized types. (type::set_uninitialized): Fix shadowing bug. Simplify code. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47158 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc: Include StringBuffer.h.tromey2001-11-181-41/+80
| | | | | | | | | | | | | | | | | | | | | | | (verify_fail): Added pc argument. Use StringBuffer to construct exception message. (_Jv_BytecodeVerifier::verify_instructions_0): Put PC into error message. (_Jv_BytecodeVerifier::check_return_type): Likewise. (_Jv_BytecodeVerifier::handle_field_or_method): Likewise. (_Jv_BytecodeVerifier::check_constant): Likewise. (_Jv_BytecodeVerifier::check_class_constant): Likewise. (_Jv_BytecodeVerifier::check_pool_index): Likewise. (_Jv_BytecodeVerifier::get_variable): Likewise. (_Jv_BytecodeVerifier::branch_prepass): Likewise. Also, correctly check exception handler endpoint. (_Jv_BytecodeVerifier::verify_instructions_0): Correctly handle wide arguments to current method. (_Jv_BytecodeVerifier::check_wide_constant): New method. (_Jv_BytecodeVerifier::verify_instructions_0) [op_ldc2_w]: Use it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47155 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (_Jv_BytecodeVerifier::check_field_constant): Handletromey2001-11-161-1/+3
| | | | | | | case where field has primitive type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47112 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (_Jv_BytecodeVerifier::is_assignable_from_slow): Newtromey2001-11-161-8/+56
| | | | | | | | | | | method. (type::compatible): Use it. (type::merge): Likewise. (type::promote): Return a `type&'. (get_one_type): Promote return value. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47097 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (type::compatible): Use _Jv_IsAssignableFrom.tromey2001-11-161-2/+6
| | | | | | | (type::merge): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47077 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (class _Jv_BytecodeVerifier) [op_dup2]: Fixed logic.tromey2001-11-151-18/+70
| | | | | | | | | | | | [op_dup_x2]: Likewise. [op_dup2_x1]: Likewise. [op_dup2_x2]: Likewise. (branch_prepass): Added `op_newarray' case. Updated unrecognized instruction error. (verify_instructions_0): Updated unrecognized instruction error. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47033 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc: Wrap in #ifdef INTERPRETER...#endif.jsturm2001-11-091-0/+4
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46882 138bc75d-0d04-0410-961f-82ee72b054a4
* * verify.cc (skip_padding): Fail if padding byte is nonzero.tromey2001-11-071-1/+2
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46830 138bc75d-0d04-0410-961f-82ee72b054a4
* * java/lang/Class.h (Class): Made _Jv_BytecodeVerifier a friend.tromey2001-11-051-0/+2436
* Makefile.in: Rebuilt. * Makefile.am (libgcj_la_SOURCES): Added verify.cc. * verify.cc: New file. * include/java-interp.h (_Jv_count_arguments): Declare. (_Jv_VerifyMethod): Likewise. (class _Jv_InterpMethod): Made _Jv_BytecodeVerifier a friend. (class _Jv_InterpException): Likewise. * resolve.cc (_Jv_count_arguments): Renamed from count_arguments. No longer static. Updated callers. * defineclass.cc (int_bits_to_float): Removed. (long_bits_to_double): Likewise. (prepare_pool_entry): Updated. (handleCodeAttribute): Verify method (commented out for now). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46796 138bc75d-0d04-0410-961f-82ee72b054a4
OpenPOWER on IntegriCloud