* link.cc:
(_Jv_Linker::find_field_helper): Added checks.
(_Jv_Linker::find_field): Use exception swallowing class resolution
and added early return.
(_Jv_ThrowNoClassDefFoundErrorTrampoline): New function.
(_Jv_Linker::link_symbol_table): Use exception swallowing class
resolution, added ffi_closure installation routine, use
_Jv_ThrowNoClassDefFoundError for missing static method.
(_Jv_Linker::ensure_class_linked): Added string check which does
not trigger class resolution.
* java/lang/natClassLoader.cc:
(_Jv_FindClassNoException): New method.
* java/lang/Class.h:
(_Jv_FindClassNoException): New method declaration.
* include/jvm.h:
(_Jv_FindClassNoException): New method declaration.
(_Jv_FindClassFromSignatureNoException): New method declaration.
* prims.cc:
(_Jv_FindClassFromSignatureNoException): New method.
* gcj/javaprims.h:
(_Jv_equalsUtf8Classname): New method declaration.
(_Jv_isPrimitiveOrDerived): Dito.
* prims.cc:
(_Jv_equalsUtf8Classnames): New method.
(_Jv_isPrimitiveOrDerived): New method.
* verify.cc:
(ref_intersection::equals): Use new classname comparison method.
(type::compatible): Use new classname comparison method. Added
check whether LHS' type is java.lang.Object .
(type::resolve): Added new optional debug message and simplified
if-expression.
(type::to_array): Added codepath that generates an array type
without resolving the element type.
From-SVN: r110474
2005-07-06 Colin Walters <walters@verbum.org>
* verify.cc (class _Jv_BytecodeVerifier) <op_new>: Don't
check for abstract classes or interfaces here; JVM spec
says it should throw an exception, so we'll do so later.
* interpret.cc (run): Throw an InstantiationException for
abstract classes and interfaces.
From-SVN: r101788
gcc/java/:
* verify-impl.c (verify_instructions_0): Correctly handle
situation where PC falls off end.
libjava/:
* verify.cc (verify_instructions_0): Correctly handle situation
where PC falls off end.
From-SVN: r101299
PR libgcj/13439:
* 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.
From-SVN: r75533
PR libgcj/13026:
* 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.
From-SVN: r73722
PR libgcj/10582:
* 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.
From-SVN: r66348
* verify.cc (pop64): Removed.
(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.
From-SVN: r65453
* verify.cc (handle_jsr_insn): Don't fail if `jsr' appears at end
of bytecode.
(handle_ret_insn): Fail if returning to jsr that appears at end of
bytecode.
From-SVN: r63744
* verify.cc (state::seen_subrs): New field.
(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.
From-SVN: r62878
2002-12-03 Andrew Haley <aph@redhat.com>
* 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.
From-SVN: r59769
* verify.cc (state::NO_STACK): New constant.
(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.
From-SVN: r50526
Fix for PR libgcj/5696:
* 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.
From-SVN: r49886
Fix for PR libgcj/5695:
* 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.
From-SVN: r49783
2002-02-13 Todd Stock <toddastock@yahoo.com>
Fix for PR libgcj/5670:
* verify.cc (is_assignable_from_slow): If `source' is interface,
recursively look for merge with `target'.
From-SVN: r49769
2002-02-13 Todd Stock <toddastock@yahoo.com>
Fix for PR libgcj/5671:
* verify.cc (state::merge): Handle case where we're merging
against an interface.
From-SVN: r49735
* verify.cc (type::isnull): New method.
(require_array_type): Handle case where array is null.
(verify_instructions_0) [op_arraylength]: Likewise.
From-SVN: r49555
* verify.cc (state::enter_subroutine): New method.
(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.
From-SVN: r49388
* verify.cc (class _Jv_BytecodeVerifier): Removed `FIXME' comment
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'.
From-SVN: r49274
* verify.cc (verify_fail): Change from being a top-level function
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.
From-SVN: r49240