summaryrefslogtreecommitdiff
path: root/libjava/link.cc
Commit message (Collapse)AuthorAgeFilesLines
* 2006-06-07 Andrew Haley <aph@redhat.com>aph2006-06-081-26/+63
| | | | | | | | | | | | | | | | | | | * include/jvm.h (_Jv_Linker::maybe_adjust_signature): New. (_Jv_Linker::uaddr): New. * link.cc (resolve_pool_entry): Call search_method_in_superclasses instead of an open-coded loop around search_method_in_class. (search_method_in_class): Add a new arg, check_perms. (search_method_in_superclasses): New. (link_symbol_table): Call maybe_adjust_signature() to extract the least significnt bit of the signature pointer. Do this three times, for instace method calls, static methods, and interfaces. Call search_method_in_superclasses() instead of _Jv_LookupDeclaredMethod. (typedef uaddr): Delete. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114486 138bc75d-0d04-0410-961f-82ee72b054a4
* PR libgcj/27860schwab2006-06-051-3/+3
| | | | | | | * link.cc: Check for closure support in libffi with FFI_CLOSURES. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114411 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-05-09 Andrew Haley <aph@redhat.com>aph2006-05-101-1/+2
| | | | | | | | | | | | | | | | | | | | * prims.cc (_Jv_soleIndirectCompiledEngine): New. * include/execution.h (Jv_CompiledEngine::do_allocate_static_fields): Remove body. (_Jv_CompiledEngine::allocate_field_initializers): New. (_Jv_CompiledEngine::_Jv_CompiledEngine): Initialize allocate_field_initializers. (class _Jv_IndirectCompiledClass): New. (struct _Jv_IndirectCompiledEngine): New. * java/lang/Class.h: (IndirectCompiledEngine): New. * java/lang/natClassLoader.cc (_Jv_NewClassFromInitializer): Set engine to _Jv_soleIndirectCompiledEngine * link.cc (ensure_fields_laid_out): Call engine->allocate_field_initializers(). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113674 138bc75d-0d04-0410-961f-82ee72b054a4
* PR libgcj/26861:tromey2006-05-041-15/+0
| | | | | | | | | * interpret.cc (run) <insn_getfield>: Removed 0xffff check. <insn_putfield>: Likewise. (NULLCHECK): Define unconditionally. * link.cc (ensure_class_linked): Removed dead code. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113531 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-04-28 Bryce McKinlay <mckinlay@redhat.com>bryce2006-04-291-6/+1
| | | | | | | | | | | | | | | | | | | * link.cc (_Jv_Linker::resolve_pool_entry): Don't pass vtable_index to resolve_method. * interpret.cc (insn_invokevirtual): Use method->index, not vtable_index. Check accflag FINAL to determine finals. Only do explicit null check if calling a final method. Use throw_null_pointer_exception. (invokevirtual_resolved): Likewise. (null_pointer_exc): Remove static field. (throw_null_pointer_exception): Always define. Throw a new NullPointerException every time. * include/java-interp.h (_Jv_ResolvedMethod): Remove vtable_index field. * include/execution.h (resolve_method): Remove vtable_index argument. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113370 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-04-21 Andrew Haley <aph@redhat.com>aph2006-04-241-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lang.c (java_init): Handle flag_indirect_classes. * jvgenmain.c: Use "class$$" instead of "class$". * mangle.c (java_mangle_decl): Accept RECORD_TYPEs sw well as DECLs. (mangle_class_field): Special case "class$$" as well as "class$". * constants.c (build_ref_from_constant_pool): If flag_indirect_classes, generate a ref into the heap. * decl.c (constants_field_decl_node, constants_data_field_decl_node): New. * class.c (build_static_class_ref): New. (build_classdollar_field): Factor out from build_class_ref(). (make_field_value): Handle static fields in heap. (make_class_data): Make sure we get a static ref to class. Make class initializer const if flag_indirect_classes. (register_class): Build a class_ref for initialization if flag_indirect_classes. (emit_indirect_register_classes): New. 2006-04-21 Andrew Haley <aph@redhat.com> * include/execution.h (struct _Jv_CompiledEngine): Define for compiled classes. * java/lang/natClassLoader.cc (_Jv_RegisterClasses): Call _Jv_RegisterLibForGc. (_Jv_RegisterClasses_Counted): Likewise. (_Jv_NewClassFromInitializer): New. (_Jv_RegisterNewClasses): New. * sources.am: Regenerate. * boehm.cc (_Jv_GC_has_static_roots): new. (_Jv_InitGC): Call GC_register_has_static_roots_callback. (filename_node, find_file, _Jv_print_gc_store, new_node, _Jv_GC_has_static_roots, _Jv_RegisterLibForGc): New. * scripts/makemake.tcl: Add -fno-indirect-classes. * Makefile.in: Regenerate. * link.cc (resolve_pool_entry): Allocate constant pool. Allocate fields. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113224 138bc75d-0d04-0410-961f-82ee72b054a4
* gcc/javatromey2006-03-151-9/+17
| | | | | | | | | | | | | PR java/26390: * class.c (get_interface_method_index): Don't put <clinit> into interface table. libjava PR java/26390: * link.cc (get_interfaces): Skip <clinit>. (append_partial_itable): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@112093 138bc75d-0d04-0410-961f-82ee72b054a4
* * link.cc: Include ffi.h if USE_LIBFFI defined.daney2006-03-071-0/+4
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111815 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-02-21 Robert Schuster <robertschuster@fsfe.org>rschuster2006-02-211-14/+18
| | | | | | | | | | | | | * link.cc: Added variant of create_error_method that will not complain about unused parameter if compiled with USE_LIBFFI not being defined. (_Jv_Linker::find_field_helper): Fixed indentation. (_Jv_Linker::create_error_method): Fixed indentation. (_Jv_Linker::link_symbol_table): Fixed indentation. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111331 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-02-09 Bryce McKinlay <mckinlay@redhat.com>bryce2006-02-091-26/+21
| | | | | | | | | | | | | | | | | * java/lang/Class.h (_Jv_IDispatchTable): Make it a struct. Put 'itable' inline, instead of as a pointer. (java::lang::Class): Put 'idt' in anonymous union with 'ioffsets'. * link.cc (null_idt): Update definition. (_Jv_Linker::prepare_constant_time_tables): Allocate klass->idt as a single struct. Use _Jv_AllocBytes, not _Jv_AllocRawObj. (_Jv_Linker::generate_itable): Update to use 'ioffsets'. (_Jv_Linker::find_iindex): Likewise. Update comment. * java/lang/natClass.cc (_Jv_LookupInterfaceMethodIdx): Update for _Jv_IDispatchTable change. (_Jv_IsAssignableFrom): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110818 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-02-08 Bryce McKinlay <mckinlay@redhat.com>bryce2006-02-081-2/+2
| | | | | | | | | | | | | | | | | | | | * link.cc (_Jv_Linker::print_class_loaded): Declare string constants as "const char *". * verify.cc (verify_fail): Likewise. * gnu/classpath/natSystemProperties.cc (file_encoding): Likewise. * interpret.cc (throw_internal_error, throw_class_format_error): Likewise. * gcj/javaprims.h (_Jv_hashUtf8String, _Jv_Utf8Const::space_needed, _Jv_Utf8Const::init, _Jv_makeUtf8Const): Likewise. * java/lang/Class.h (_Jv_InitPrimClass): Likewise. * include/jvm.h (_Jv_strLengthUtf8, _Jv_makeUtf8Const): Likewise. * defineclass.cc (throw_internal_error, throw_no_class_def_found_error, is_attribute_name): Likewise. * prims.cc (_Jv_strLengthUtf8, _Jv_hashUtf8String, _Jv_Utf8Const::init, _Jv_makeUtf8Const, _Jv_InitPrimClass): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110767 138bc75d-0d04-0410-961f-82ee72b054a4
* PR libgcj/26063, PR libgcj/17978, PR libgcj/10598:tromey2006-02-081-53/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * defineclass.cc (parse): Use _Jv_AllocRawObj. (read_constpool): Likewise. (read_one_code_attribute): Use internal function name. (handleConstantPool): Use _Jv_AllocRawObj. (handleInterfacesBegin): Likewise. (handleFieldsBegin): Likewise. (handleMethodsBegin): Likewise. (handleCodeAttribute): Likewise. (handleMethodsEnd): Likewise. * include/jvm.h (new_vtable): Use _Jv_AllocRawObj. * interpret.cc (do_allocate_static_fields): Use _Jv_AllocRawObj. Allocate reference fields separately. * link.cc (prepare_constant_time_tables): Use _Jv_AllocRawObj. (add_miranda_methods): Likewise. (generate_itable): Use _Jv_AllocBytes. (find_iindex): Likewise. (struct method_closure): New structure. (create_error_method): Use struct method_closure; allocate with _Jv_AllocBytes. (ensure_fields_laid_out): Separate reference fields from non-reference fields. * boehm.cc (_Jv_MarkObj): Mark vtable. Only mark direct fields of Class. (_Jv_MarkArray): Mark vtable. (_Jv_AllocRawObj): Don't allocate objects of size 0. * include/execution.h (_Jv_ExecutionEngine::allocate_static_fields): Added 'int' parameter. (struct _Jv_CompiledEngine): Updated. (class _Jv_InterpreterEngine): Updated. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110763 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-02-03 Robert Schuster <robertschuster@fsfe.org>rschuster2006-02-031-1/+1
| | | | | | | | | * link.cc: (_Jv_Linker::create_error_method): Added missing (void *) cast. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110544 138bc75d-0d04-0410-961f-82ee72b054a4
* Fixes PR #26073.rschuster2006-02-031-45/+54
| | | | | | | | | | | | | | 2006-02-03 Robert Schuster <robertschuster@fsfe.org> * include/jvm.h: (_Jv_Linker::create_error_method): New method declaration. * link.cc: (_Jv_Linker::create_error_method): New method. (_Jv_Linker::link_symbol_table): Use new method above. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110543 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-02-01 Robert Schuster <robertschuster@fsfe.org>rschuster2006-02-011-33/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110474 138bc75d-0d04-0410-961f-82ee72b054a4
* 2005-12-08 Andrew Haley <aph@redhat.com>aph2005-12-081-18/+58
| | | | | | | | | | | | | | | | * java/lang/Object.h (throwNoSuchMethodError): New method. * java/lang/Object.java (throwNoSuchMethodError): New method. * include/jvm.h (_Jv_ThrowNoSuchFieldError): Declare. * link.cc (_Jv_ThrowNoSuchFieldError): New. (link_symbol_table): Don't throw a NoSuchFieldError if a field is missing. Instead, set the otable entry to zero. (link_symbol_table): If we don't find a nonstatic method, insert the vtable offset of Object.throwNoSuchMethodError() into the otable. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108231 138bc75d-0d04-0410-961f-82ee72b054a4
* 2005-10-12 Andrew Haley <aph@redhat.com>aph2005-10-131-2/+3
| | | | | | | | | PR java/24251 * link.cc (ensure_method_table_complete): Install Miranda methods for interfaces too. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@105375 138bc75d-0d04-0410-961f-82ee72b054a4
* PR libgcj/23739:tromey2005-09-061-1/+1
| | | | | | | | | | | | | | | | | | | | | * testsuite/libjava.jni/pr23739.c: New file. * testsuite/libjava.jni/pr23739.java: New file. * testsuite/libjava.jni/pr23739.out: New file. * jni.cc (_Jv_JNI_IsAssignableFrom): Reversed arguments. * java/lang/reflect/natMethod.cc (invoke): Updated. * java/lang/natClass.cc (isAssignableFrom): Updated. (isInstance): Likewise. (_Jv_IsAssignableFrom): Reversed arguments. (_Jv_IsInstanceOf): Updated. (_Jv_CheckCast): Likewise. (_Jv_CheckArrayStore): Likewise. (_Jv_IsAssignableFromSlow): Reversed arguments. (_Jv_InterfaceAssignableFrom): Likewise. * link.cc (verify_type_assertions): Updated. * prims.cc (_Jv_CheckAccess): Updated. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103953 138bc75d-0d04-0410-961f-82ee72b054a4
* gcc/java:tromey2005-08-171-2/+1
| | | | | | | | | | | | | | | | * class.c (make_class_data): Always emit JV_STATE_PRELOADING for class' initial state. libjava: * java/lang/Class.h (_Jv_IsBinaryCompatibilityABI): Declare as friend. * include/jvm.h (_Jv_IsBinaryCompatibilityABI): New function. * testsuite/libjava.lang/bclink.java: New file. * testsuite/libjava.lang/bclink.out: New file. * link.cc (print_class_loaded): Changed ABI test to look at various _syms fields. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103225 138bc75d-0d04-0410-961f-82ee72b054a4
* gcc/java/:tromey2005-06-151-4/+5
| | | | | | | | | | | | | | | | | | | | | | PR libgcj/21906: * class.c (make_method_value): Use soft_abstractmethod_node for abstract method. * java-tree.h (soft_abstractmethod_node): New define. (JTI_SOFT_ABSTRACTMETHOD_NODE): New enum constant. * decl.c (java_init_decl_processing): Initialize soft_abstractmethod_node. libjava/: PR libgcj/21906: * defineclass.cc (handleMethodsEnd): Set ncode for abstract methods. * include/jvm.h (_Jv_ThrowAbstractMethodError): Declare. * link.cc (_Jv_ThrowAbstractMethodError): Renamed. No longer static. (append_partial_itable): Use it. (set_vtable_entries): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100992 138bc75d-0d04-0410-961f-82ee72b054a4
* 2005-05-12 Bryce McKinlay <mckinlay@redhat.com>bryce2005-05-131-4/+2
| | | | | | | | | | | | | | | | | | | | | | * include/jvm.h (gcj::verifyClasses): Declare. * link.cc (gcj::verbose_class_flag): Moved. * prims.cc (gcj::verifyClasses): Define here. (gcj::verbose_class_flag): Move definition here. (_Jv_Linker::wait_for_state): Don't call verify_class if gcj::verifyClasses is not set. * gij.cc (main): Set gcj::verifyClasses when '-noverify' is given. 2005-05-12 Aaron Luchko <aluchko@redhat.com> * gij.cc (main): Recognize '-verify', '-noverify', and '-verifyremote' 2005-05-12 Aaron Luchko <aluchko@redhat.com> * gcj.texi: Add '-verify', '-noverify', and '-verifyremote'. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99646 138bc75d-0d04-0410-961f-82ee72b054a4
* 2005-04-27 Andrew Haley <aph@redhat.com>aph2005-04-291-8/+16
| | | | | | | | | | | | | PR java/19285 * prims.cc (_Jv_ResolvePoolEntry): New function. * include/jvm.h (_Jv_Linker::find_field): New arg: found_class. * link.cc (_Jv_Linker::find_field): New arg: found_class. (resolve_pool_entry): Initialize the class in which a field is found. (link_symbol_table): Pass new arg to found_class. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99006 138bc75d-0d04-0410-961f-82ee72b054a4
* * jni.cc (_Jv_JNI_GetAnyFieldID): Throw ClassNotFoundException.tromey2005-04-051-2/+7
| | | | | | | | | | | | | | * java/lang/reflect/natMethod.cc (_Jv_GetTypesFromSignature): Rewrote to use _Jv_FindClassFromSignature. * verify.cc (resolve): throw NoClassDefFoundError. * link.cc (resolve_field): Throw NoClassDefFoundError. (find_field): Likewise. * prims.cc (_Jv_FindClassFromSignature): Removed recursion. Handle error cases. Added 'endp' argument. * include/jvm.h (_Jv_FindClassFromSignature): Updated prototype. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97660 138bc75d-0d04-0410-961f-82ee72b054a4
* * link.cc (ensure_class_linked): Removed #ifdef.tromey2005-03-171-10/+1
| | | | | | | | | | | (print_class_loaded): Likewise. (wait_for_state): Likewise. * java/lang/Class.h (_Jv_IsInterpretedClass): Always declare. * include/jvm.h (_Jv_IsInterpretedClass): Moved from... * include/java-interp.h: ... here. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96589 138bc75d-0d04-0410-961f-82ee72b054a4
* PR java/20215:tromey2005-03-071-23/+28
| | | | | | | | | * include/jvm.h (_Jv_Linker::find_field_helper): Updated. * link.cc (find_field_helper): Added 'type' argument. (find_field): Updated. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96032 138bc75d-0d04-0410-961f-82ee72b054a4
* * link.cc (make_vtable): Remove abstract method check.tromey2005-02-191-35/+16
| | | | | | | (append_partial_itable): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95268 138bc75d-0d04-0410-961f-82ee72b054a4
* PR java/20056:tromey2005-02-191-0/+12
| | | | | | | | | | | * include/jvm.h (_Jv_Linker::has_field_p): Declare. * link.cc (has_field_p): New function. * verify.cc (check_field_constant): Added 'putfield' argument. (verify_instructions_0): Updated. (type::equals): New method. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95259 138bc75d-0d04-0410-961f-82ee72b054a4
* * java/lang/Class.h (_Jv_GetMethodString): Updated declaration.tromey2005-02-171-17/+23
| | | | | | | | | | | | | * java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Updated. * java/lang/natClass.cc (_Jv_LookupInterfaceMethod): Updated. * link.cc (_Jv_GetMethodString): Added 'derived' argument. Changed type of second argument. Rewrote. (make_vtable): Use it. (append_partial_itable): Updated. (layout_vtable_methods): Updated. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95181 138bc75d-0d04-0410-961f-82ee72b054a4
* * link.cc: Include <stdio.h>hboehm2005-02-021-0/+2
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94623 138bc75d-0d04-0410-961f-82ee72b054a4
* PR libgcj/18868:tromey2005-01-101-153/+119
| | | | | | | | | | | | | * include/jvm.h (_Jv_Linker::find_field): Declare. (_Jv_Linker::find_field_helper): Likewise. * link.cc (find_field_helper): New method. (find_field): Likewise. (resolve_pool_entry): Use it. Throw NoSuchFieldError when field not found. (link_symbol_table): Use find_field. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@93151 138bc75d-0d04-0410-961f-82ee72b054a4
* * include/no-threads.h (_Jv_ThreadDestroyData): Removed argumenttromey2004-12-011-0/+1
| | | | | | | | | | | name. (_Jv_ThreadRegister): Likewise. (_Jv_MutexCheckMonitor): Likewise. * link.cc: Include limits.h. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91581 138bc75d-0d04-0410-961f-82ee72b054a4
* * link.cc (link_symbol_table): Do not use intptr_t.ebotcazou2004-11-291-2/+2
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91472 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-11-27 Andrew Haley <aph@redhat.com>aph2004-11-271-1/+10
| | | | | | | | | | | | | * link.cc (ensure_class_linked): Conditionally compile _Jv_IsInterpretedClass on INTERPRETER. (print_class_loaded): Likewise. (wait_for_state): Likewise. * include/jvm.h (ROUND): Move to here from include/java-interp.h. * include/java-interp.h (ROUND): Remove. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91375 138bc75d-0d04-0410-961f-82ee72b054a4
* * Merged gcj-abi-2-dev-branch to trunk.tromey2004-11-251-0/+1764
(Actual changes too large to list in the commit message; see ChangeLog.) git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91270 138bc75d-0d04-0410-961f-82ee72b054a4