Commit Graph

109 Commits

Author SHA1 Message Date
Andreas Tobler bd28f224b1 Class.h: Remove redundant 'class java::*::* declarations.
2007-07-03  Andreas Tobler  <a.tobler@schweiz.org>

	* java/lang/Class.h: Remove redundant 'class java::*::* declarations.

From-SVN: r126274
2007-07-03 22:41:00 +02:00
Andrew Haley 0df38d45e1 natVMProxy.cc (ncode_closure): Add method_index.
2007-04-18  Andrew Haley  <aph@redhat.com>

        * java/lang/reflect/natVMProxy.cc (ncode_closure): Add
        method_index.
        (generateProxyClass): Add field $Proxy0.m.  Store methods array in
        it.
        (run_proxy): Retrieve the method to invoke from in $Proxy0.m.
        * java/lang/Class.h: Remove _Jv_LookupProxyMethod.
        * java/lang/natClass.cc: Likewise.
        * headers.txt: Likewise.

From-SVN: r123953
2007-04-18 17:10:32 +00:00
Andrew Haley a0036853d2 natVMProxy.cc (run_proxy): Use _Jv_LookupProxyMethod to find the Method.
2007-04-02  Andrew Haley  <aph@redhat.com>

        * java/lang/reflect/natVMProxy.cc (run_proxy): Use
        _Jv_LookupProxyMethod to find the Method.
        If parameter_types->length == 0, pass a null paramameter list,
        not a zero-length parameter list.
        * java/lang/natClass.cc (_Jv_LookupProxyMethod): New function.
        * java/lang/Class.h (_Jv_LookupProxyMethod): Declare.

From-SVN: r123431
2007-04-02 16:36:52 +00:00
Keith Seitz bde6c7a990 java-interp.h (_Jv_InterpClass): Declare friend function _Jv_GetInterpClassSourceFile.
* include/java-interp.h (_Jv_InterpClass): Declare
        friend function _Jv_GetInterpClassSourceFile.
        * java/lang/Class.h (Class): Likewise.
        * java/lang/natClass.cc (_Jv_GetInterpClassSourceFile):
        New function.
        * gnu/classpath/jdwp/natVMVirtualMachine.cc
        (getSourceFile): Implement.

From-SVN: r122882
2007-03-13 19:27:13 +00:00
Alexandre Oliva 18fa3240db ffi.h.in (ffi_closure_alloc, [...]): New.
libffi/ChangeLog:
* include/ffi.h.in (ffi_closure_alloc, ffi_closure_free): New.
(ffi_prep_closure_loc): New.
(ffi_prep_raw_closure_loc): New.
(ffi_prep_java_raw_closure_loc): New.
* src/closures.c: New file.
* src/dlmalloc.c [FFI_MMAP_EXEC_WRIT] (struct malloc_segment):
Replace sflags with exec_offset.
[FFI_MMAP_EXEC_WRIT] (mmap_exec_offset, add_segment_exec_offset,
sub_segment_exec_offset): New macros.
(get_segment_flags, set_segment_flags, check_segment_merge): New
macros.
(is_mmapped_segment, is_extern_segment): Use get_segment_flags.
(add_segment, sys_alloc, create_mspace, create_mspace_with_base,
destroy_mspace): Use new macros.
(sys_alloc): Silence warning.
* Makefile.am (libffi_la_SOURCES): Add src/closures.c.
* Makefile.in: Rebuilt.
* src/prep_cif [FFI_CLOSURES] (ffi_prep_closure): Implement in
terms of ffi_prep_closure_loc.
* src/raw_api.c (ffi_prep_raw_closure_loc): Renamed and adjusted
from...
(ffi_prep_raw_closure): ... this.  Re-implement in terms of the
renamed version.
* src/java_raw_api (ffi_prep_java_raw_closure_loc): Renamed and
adjusted from...
(ffi_prep_java_raw_closure): ... this.  Re-implement in terms of
the renamed version.
* src/alpha/ffi.c (ffi_prep_closure_loc): Renamed from
(ffi_prep_closure): ... this.
* src/pa/ffi.c: Likewise.
* src/cris/ffi.c: Likewise.  Adjust.
* src/frv/ffi.c: Likewise.
* src/ia64/ffi.c: Likewise.
* src/mips/ffi.c: Likewise.
* src/powerpc/ffi_darwin.c: Likewise.
* src/s390/ffi.c: Likewise.
* src/sh/ffi.c: Likewise.
* src/sh64/ffi.c: Likewise.
* src/sparc/ffi.c: Likewise.
* src/x86/ffi64.c: Likewise.
* src/x86/ffi.c: Likewise.
(FFI_INIT_TRAMPOLINE): Adjust.
(ffi_prep_raw_closure_loc): Renamed and adjusted from...
(ffi_prep_raw_closure): ... this.
* src/powerpc/ffi.c (ffi_prep_closure_loc): Renamed from
(ffi_prep_closure): ... this.
(flush_icache): Adjust.
boehm-gc/ChangeLog:
* include/gc.h (GC_REGISTER_FINALIZER_UNREACHABLE): New.
(GC_register_finalizer_unreachable): Declare.
(GC_debug_register_finalizer_unreachable): Declare.
* finalize.c (GC_unreachable_finalize_mark_proc): New.
(GC_register_finalizer_unreachable): New.
(GC_finalize): Handle it.
* dbg_mlc.c (GC_debug_register_finalizer_unreachable): New.
(GC_debug_register_finalizer_no_order): Fix whitespace.
libjava/ChangeLog:
* include/jvm.h (_Jv_ClosureListFinalizer): New.
(_Jv_Linker::create_error_method): Adjust.
* boehm.cc (_Jv_ClosureListFinalizer): New.
* nogc.cc (_Jv_ClosureListFinalizer): New.
* java/lang/Class.h (class _Jv_ClosureList): New.
(class java::lang::Class): Declare it as friend.
* java/lang/natClass.cc (_Jv_ClosureList::releaseClosures): New.
(_Jv_ClosureList::registerClousure): New.
* include/execution.h (_Jv_ExecutionEngine): Add get_closure_list.
(_Jv_CompiledEngine::do_get_closure_list): New.
(_Jv_CompiledEngine::_Jv_CompiledEngine): Use it.
(_Jv_IndirectCompiledClass): Add closures.
(_Jv_IndirectCompiledEngine::get_aux_info): New.
(_Jv_IndirectCompiledEngine::do_allocate_field_initializers): Use
it.
(_Jv_IndirectCompiledEngine::do_get_closure_list): New.
(_Jv_IndirectCompiledEngine::_Jv_IndirectCompiledEngine): Use it.
(_Jv_InterpreterEngine::do_get_closure_list): Declare.
(_Jv_InterpreterEngine::_Jv_InterpreterEngine): Use it.
* interpret.cc (FFI_PREP_RAW_CLOSURE): Use _loc variants.
(node_closure): Add closure list.
(_Jv_InterpMethod::ncode): Add jclass argument.  Use
ffi_closure_alloc and the separate code pointer.  Register the
closure for finalization.
(_Jv_JNIMethod::ncode): Likewise.
(_Jv_InterpreterEngine::do_create_ncode): Pass klass to ncode.
(_Jv_InterpreterEngine::do_get_closure_list): New.
* include/java-interp.h (_Jv_InterpMethod::ncode): Adjust.
(_Jv_InterpClass): Add closures field.
(_Jv_JNIMethod::ncode): Adjust.
* defineclass.cc (_Jv_ClassReader::handleCodeAttribute): Adjust.
(_Jv_ClassReader::handleMethodsEnd): Likewise.
* link.cc (struct method_closure): Add closure list.
(_Jv_Linker::create_error_method): Add jclass argument.  Use
ffi_closure_alloc and the separate code pointer.  Register the
closure for finalization.
(_Jv_Linker::link_symbol_table): Remove outdated comment about
sharing of otable and atable.  Adjust.
* java/lang/reflect/natVMProxy.cc (ncode_closure): Add closure
list.
(ncode): Add jclass argument.  Use ffi_closure_alloc and the
separate code pointer.  Register the closure for finalization.
(java::lang::reflect::VMProxy::generateProxyClass): Adjust.
* testsuite/libjava.jar/TestClosureGC.java: New.
* testsuite/libjava.jar/TestClosureGC.out: New.
* testsuite/libjava.jar/TestClosureGC.xfail: New.
* testsuite/libjava.jar/TestClosureGC.jar: New.

From-SVN: r122652
2007-03-07 07:27:25 +00:00
Andrew Haley a29114a3be natVMProxy.cc (ncode_closure.meth): Delete.
2007-03-05  Andrew Haley  <aph@redhat.com>

	* java/lang/reflect/natVMProxy.cc (ncode_closure.meth): Delete.
	(generateProxyClass): Don't pass method to ncode.
	(run_proxy): Call _Jv_GetReflectedMethod to find the proxy method.
	* java/lang/reflect/Method.h: Rebuild.
	* java/lang/reflect/Method.java (internalGetParameterTypes,
	internalGetExceptionTypes): New methods.
	* headers.txt (class java/lang/reflect/Method): Declare
	_Jv_GetReflectedMethod.  Be its friend.
	* java/lang/natClass.cc (_Jv_GetReflectedMethod): New method.
	* java/lang/Class.h: Declare it.  Be its friend.

From-SVN: r122554
2007-03-05 16:06:27 +00:00
Keith Seitz 2b3c67882e Class.h (_Jv_GetClassStatus): Declare.
* java/lang/Class.h (_Jv_GetClassStatus): Declare.
        * java/lang/natClass.cc (_Jv_GetClassStatus): New function.
        * jvmti.cc (_Jv_JVMTI_GetClassStatus): New function.
        (_Jv_JVMTI_Interface): Define GetClassStatus.

From-SVN: r121074
2007-01-23 01:06:10 +00:00
Tom Tromey 97b8365caf Merged gcj-eclipse branch to trunk.
From-SVN: r120621
2007-01-09 19:58:05 +00:00
Keith Seitz f356a436f0 java-stack.h (ncodeMap): Declare.
* include/java-stack.h (ncodeMap): Declare.
        (_Jv_StackTrace): Make _Jv_GetMethodDeclaringClass friend.
        * java/lang/Class.h (_Jv_GetMethodDeclaringClass): Declare.
        * java/lang/natClass.cc (_Jv_GetMethodDeclaringClass): New
        function.
        * stacktrace.cc (ncodeMap): Redefine from file global to global
        for class _Jv_StackTrace.
        (_Jv_StackTrace::UpdateNCodeMap): Add interpreted classes, too,
        so that _Jv_GetMethodDeclaringClass can find them all.
        (_Jv_StackTrace::ClassForFrame): Exclude interpreted classes.
        * jvmti.cc (_Jv_JVMTI_GetMethodDeclaringClass): New function.
        (_Jv_JVMTI_Interface): Define GetMethodDeclaringClass function.

From-SVN: r118100
2006-10-28 02:15:12 +00:00
Tom Tromey e7f7d23387 register2.java: New file.
* testsuite/libjava.jni/register2.java: New file.
	* testsuite/libjava.jni/register2.out: New file.
	* testsuite/libjava.jni/register2.c: New file.
	* java/lang/natClass.cc (_Jv_GetClassNameUtf8): New function.
	* java/lang/Class.h (_Jv_GetClassNameUtf8): Declare.
	* jni.cc (struct NativeMethodCacheEntry): New struct.
	(nathash): Changed type.
	(hash): Updated.
	(nathash_find_slot): Likewise.
	(nathash_find): Likewise.
	(natrehash): Likewise.
	(nathash_add): Likewise.
	(_Jv_JNI_RegisterNatives): Likewise.
	(_Jv_LookupJNIMethod): Likewise.
	Idea from Juerg Lehni <juerg@scratchdisk.com>

Co-Authored-By: Bryce McKinlay <mckinlay@redhat.com>

From-SVN: r117867
2006-10-18 23:17:04 +00:00
Keith Seitz 3056423a31 Class.h (_Jv_FindInterpreterMethod): Change return type to _Jv_MethodBase instead of _Jv_InterpMethod.
* java/lang/Class.h (_Jv_FindInterpreterMethod): Change return type
        to _Jv_MethodBase instead of _Jv_InterpMethod.
        * java/lang/natClass.cc (_Jv_FindInterpreterMethod): Likewise.
        Do not check access flags.
        Fix some minor style anomalies.

From-SVN: r116730
2006-09-06 22:16:59 +00:00
Mark Wielaard ac1ed908de Imported GNU Classpath 0.92
2006-08-14  Mark Wielaard  <mark@klomp.org>

       Imported GNU Classpath 0.92
       * HACKING: Add more importing hints. Update automake version
       requirement.

       * configure.ac (gconf-peer): New enable AC argument.
       Add --disable-gconf-peer and --enable-default-preferences-peer
       to classpath configure when gconf is disabled.
       * scripts/makemake.tcl: Set gnu/java/util/prefs/gconf and
       gnu/java/awt/dnd/peer/gtk to bc. Classify
       gnu/java/security/Configuration.java as generated source file.

       * gnu/java/lang/management/VMGarbageCollectorMXBeanImpl.java,
       gnu/java/lang/management/VMMemoryPoolMXBeanImpl.java,
       gnu/java/lang/management/VMClassLoadingMXBeanImpl.java,
       gnu/java/lang/management/VMRuntimeMXBeanImpl.java,
       gnu/java/lang/management/VMMemoryManagerMXBeanImpl.java,
       gnu/java/lang/management/VMThreadMXBeanImpl.java,
       gnu/java/lang/management/VMMemoryMXBeanImpl.java,
       gnu/java/lang/management/VMCompilationMXBeanImpl.java: New VM stub
       classes.
       * java/lang/management/VMManagementFactory.java: Likewise.
       * java/net/VMURLConnection.java: Likewise.
       * gnu/java/nio/VMChannel.java: Likewise.

       * java/lang/Thread.java (getState): Add stub implementation.
       * java/lang/Class.java (isEnum): Likewise.
       * java/lang/Class.h (isEnum): Likewise.

       * gnu/awt/xlib/XToolkit.java (getClasspathTextLayoutPeer): Removed.

       * javax/naming/spi/NamingManager.java: New override for StackWalker
       functionality.

       * configure, sources.am, Makefile.in, gcj/Makefile.in,
       include/Makefile.in, testsuite/Makefile.in: Regenerated.

From-SVN: r116139
2006-08-14 23:12:35 +00:00
Andrew Haley e046c56eee class.c (make_class_data): When using flag_indirect_classes, don't initialize the vtable of Class instances.
2006-06-16  Andrew Haley  <aph@redhat.com>

        * class.c (make_class_data): When using flag_indirect_classes,
        don't initialize the vtable of Class instances.

2006-06-16  Andrew Haley  <aph@redhat.com>

        * java/lang/natClassLoader.cc (_Jv_NewClassFromInitializer): Don't
        copy the whole Class instance from the initializer: instead, copy
        everything but the first word (the vtable pointer).
        Change prototype to (const char* class_initializer).
        (_Jv_RegisterNewClasses): Change prototype to (const char**).
        * java/lang/Class.h (_Jv_RegisterNewClasses): Change prototype to
        (const char**).

From-SVN: r114714
2006-06-16 08:56:29 +00:00
Mark Wielaard 4f9533c772 Imported GNU Classpath 0.90
Imported GNU Classpath 0.90
       * scripts/makemake.tcl: LocaleData.java moved to gnu/java/locale.

       * sources.am: Regenerated.
       * gcj/javaprims.h: Regenerated.
       * Makefile.in: Regenerated.
       * gcj/Makefile.in: Regenerated.
       * include/Makefile.in: Regenerated.
       * testsuite/Makefile.in: Regenerated.

       * gnu/java/lang/VMInstrumentationImpl.java: New override.
       * gnu/java/net/local/LocalSocketImpl.java: Likewise.
       * gnu/classpath/jdwp/VMMethod.java: Likewise.
       * gnu/classpath/jdwp/VMVirtualMachine.java: Update to latest
       interface.
       * java/lang/Thread.java: Add UncaughtExceptionHandler.
       * java/lang/reflect/Method.java: Implements GenericDeclaration and
       isSynthetic(),
       * java/lang/reflect/Field.java: Likewise.
       * java/lang/reflect/Constructor.java
       * java/lang/Class.java: Implements Type, GenericDeclaration,
       getSimpleName() and getEnclosing*() methods.
       * java/lang/Class.h: Add new public methods.
       * java/lang/Math.java: Add signum(), ulp() and log10().
       * java/lang/natMath.cc (log10): New function.
       * java/security/VMSecureRandom.java: New override.
       * java/util/logging/Logger.java: Updated to latest classpath
       version.
       * java/util/logging/LogManager.java: New override.

From-SVN: r113887
2006-05-18 17:29:21 +00:00
Andrew Haley fdafd4613f prims.cc (_Jv_soleIndirectCompiledEngine): New.
2006-05-09  Andrew Haley  <aph@redhat.com>

        * 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().

From-SVN: r113674
2006-05-10 17:17:20 +00:00
Andrew Haley b2ed63b4aa [multiple changes]
2006-05-04  Andrew Haley  <aph@redhat.com>

        * class.c (make_field_value): Always build_address_of fdecl if
        there is an initializer.

2006-05-03  Andrew Haley  <aph@redhat.com>

        PR libgcj/27352
        * expr.c (maybe_rewrite_invocation): New function.
        (rewrite_arglist_getclass): Likewise.
        (rules): New.
        (expand_invoke): Call maybe_rewrite_invocation.
        * parse.y (patch_invoke): Likewise.
        * java-tree.h: (maybe_rewrite_invocation): New function.

2006-05-03  Andrew Haley  <aph@redhat.com>

        PR libgcj/27352
        * java/lang/Class.java (getClassLoader(Class)): New.
        forName(String, Class): New.
        * java/lang/natClass.cc (getClassLoader(Class)): New.

2006-05-02  Andrew Haley  <aph@redhat.com>

        * prims.cc (_Jv_NewMultiArray): Check for phantom class.

From-SVN: r113532
2006-05-04 18:44:53 +00:00
Tom Tromey b149e89e77 Class.h (JV_STATE_LOADING): Added comment.
* java/lang/Class.h (JV_STATE_LOADING): Added comment.
	* Makefile.in: Rebuilt.
	* Makefile.am (nat_source_files): Added natSystemClassLoader.cc.
	* gnu/gcj/runtime/natSystemClassLoader.cc: New file.
	* gnu/gcj/runtime/SystemClassLoader.java (nativeClasses):
	New field.
	(loadedClasses): Removed.
	(findClass): Declare.
	(addClass): Add to nativeClasses, not loadedClasses.

From-SVN: r113530
2006-05-04 15:29:22 +00:00
Andrew Haley 621ae65dcd lang.c (java_init): Handle flag_indirect_classes.
2006-04-21  Andrew Haley  <aph@redhat.com>

        * 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.

From-SVN: r113224
2006-04-24 15:33:16 +00:00
Bryce McKinlay a286e145de Class.h (_Jv_IDispatchTable): Make it a struct.
2006-02-09  Bryce McKinlay  <mckinlay@redhat.com>

	* 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.

From-SVN: r110818
2006-02-09 23:59:30 +00:00
Bryce McKinlay 1349c68851 re PR libgcj/25187 (dereferencing type-punned pointer warnings while building libgcj)
2006-02-08  Bryce McKinlay  <mckinlay@redhat.com>

        PR libgcj/25187:
        * gnu/gcj/io/natSimpleSHSStream.cc
        (gnu::gcj::io::SimpleSHSStream::shsFinal): Remove bogus cast.
        * interpret.cc (_Jv_InterpMethod::run): Simplify arguments to
        _Jv_InterpFrame().
        * boehm.cc: #undef some autoconf macros before including gc-config.h.
        (_Jv_MarkObject): Don't mark the class, it is reachable via the vtable.
        (_Jv_MarkArray): Likewise.
        * java/lang/ref/natReference.cc (java::lang::ref::Reference::create):
        Simplify _Jv_GCRegisterDisappearingLink() call.
        * java/lang/Class.h (getComponentType): Use element_type.
        (element_type): New field declaration, as a union with "methods".
        * java/lang/natClassLoader.cc (_Jv_NewArrayClass): Use "element_type".
        * java/net/natVMNetworkInterfacePosix.cc
        (java::net::VMNetworkInterface::getInterfaces): Add "int" cast to
        avoid sign comparison warning.
        * include/java-interp.h (_Jv_InterpFrame): Take thread as second
        argument, not parent call frame.
        * include/x86_64-signal.h (MAKE_THROW_FRAME): Use "gregs" directly,
        without a cast.
        (restore_rt): Declare with hidden visibility, not "static".
        * posix.cc (_Jv_platform_initProperties): Make "tmpdir" a string
        constant.
        * jni.cc (_Jv_JNI_DestroyJavaVM): Use a union to avoid strict alias
        warning

From-SVN: r110783
2006-02-09 01:35:33 +00:00
Bryce McKinlay 2cf94e58cb link.cc (_Jv_Linker::print_class_loaded): Declare string constants as "const char *".
2006-02-08  Bryce McKinlay  <mckinlay@redhat.com>

	* 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.

From-SVN: r110767
2006-02-08 20:38:13 +00:00
Robert Schuster c1a9321f29 2006-02-01 Robert Schuster <robertschuster@fsfe.org>
* 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
2006-02-01 13:40:05 +00:00
Keith Seitz 8a0092c834 Class.h (_Jv_FindInterpreterMethod): Add new declaration.
* java/lang/Class.h (_Jv_FindInterpreterMethod): Add new declaration.
        * java/lang/natClass.cc (_Jv_FindInterpreterMethod): New function.

From-SVN: r110142
2006-01-23 18:44:43 +00:00
Tom Tromey 2fb1388876 Class.h (_Jv_CopyClassesToSystemLoader): Updated.
* java/lang/Class.h (_Jv_CopyClassesToSystemLoader): Updated.
	* java/lang/natClassLoader.cc (_Jv_CopyClassesToSystemLoader):
	Changed argument type.  Use SystemClassLoader.addClass.
	* gnu/gcj/runtime/SystemClassLoader.java (addClass): New method.

From-SVN: r109340
2006-01-04 17:59:40 +00:00
Tom Tromey 97b51fd08e class.c (make_class_data): Always emit JV_STATE_PRELOADING for class' initial state.
gcc/java:
	* 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.

From-SVN: r103225
2005-08-17 20:44:10 +00:00
Tom Tromey 7666af8941 Class.java (getClasses): New method.
* java/lang/Class.java (getClasses): New method.
	(internalGetClasses): Likewise.
	(getClassLoader): Updated documentation.
	(getDeclaredClasses): New overload; old overload no longer
	native.
	(_getConstructors): Removed.
	(resourcePath): Updated.
	* java/lang/natClass.cc (getClasses): Removed.
	* java/lang/Class.h (getDeclaredClasses, getDeclaredConstructors):
	Updated.
	(_getConstructors): Removed.

From-SVN: r100948
2005-06-14 18:51:54 +00:00
Tom Tromey cca1655eab gcj.texi (Code Generation): Document -fbootstrap-classes.
gcc/java:
	* gcj.texi (Code Generation): Document -fbootstrap-classes.
	* decl.c (GCJ_BOOTSTRAP_LOADER_ADDITION): New macro.
	(parse_version): Use it.
	* lang.opt (-fbootstrap-classes): New option.
libjava:
	* external/w3c_dom/Makefile.in: Rebuilt.
	* external/w3c_dom/Makefile.am (libw3c_gcj_la_GCJFLAGS): Added
	-fbootstrap-classes.
	* external/sax/Makefile.in: Rebuilt.
	* external/sax/Makefile.am (libsax_gcj_la_GCJFLAGS): Added
	-fbootstrap-classes.
	* java/lang/Class.h (_Jv_CopyClassesToSystemLoader): Declare as
	friend.
	* java/lang/natVMClassLoader.cc (getSystemClassLoaderInternal):
	Call _Jv_CopyClassesToSystemLoader.
	* java/lang/natClassLoader.cc (system_class_list): New global.
	(_Jv_RegisterClassHookDefault): Handle bootstrap and system
	classes differently.
	(_Jv_CopyClassesToSystemLoader): New function.
	(SYSTEM_LOADER_INITIALIZED): New define.
	* include/jvm.h (GCJ_BOOTSTRAP_LOADER_ADDITION): New define.
	(_Jv_CheckABIVersion): Use it.
	(_Jv_ClassForBootstrapLoader): New function.
	* Makefile.in: Rebuilt.
	* Makefile.am (AM_GCJFLAGS): Added -fbootstrap-classes.

From-SVN: r99604
2005-05-12 01:27:15 +00:00
Andrew Haley cfbb263896 Class.h (_Jv_ResolvePoolEntry): Declare as friend.
2005-04-29  Andrew Haley  <aph@redhat.com>

	* java/lang/Class.h (_Jv_ResolvePoolEntry): Declare as friend.

From-SVN: r99016
2005-04-29 20:02:47 +00:00
Tom Tromey f37a936b56 link.cc (ensure_class_linked): Removed #ifdef.
* link.cc (ensure_class_linked): Removed #ifdef.
	(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.

From-SVN: r96589
2005-03-17 00:18:50 +00:00
Andreas Tobler 455d8f0605 stacktrace.cc (_Jv_StackTrace::UnwindTraceFn): Protect interpreter-specific code with #ifdef INTERPRETER.
2005-03-15  Andreas Tobler  <a.tobler@schweiz.ch>

        * stacktrace.cc (_Jv_StackTrace::UnwindTraceFn): Protect
        interpreter-specific code with #ifdef INTERPRETER.
        (_Jv_StackTrace::getLineNumberForFrame): Likewise.
        (_Jv_StackTrace::FillInFrameInfo): Likewise.
        (_Jv_StackTrace::non_system_trace_fn): Likewise.
        * include/java-stack.h (struct _Jv_InterpFrameInfo): Protect  with
        #ifdef INTERPRETER. Also protect declarations that use it.
        * java/lang/Class.h: Move _Jv_StackTrace friend declaration  outside
        #ifdef INTERPRETER block.

From-SVN: r96571
2005-03-16 18:18:59 +00:00
Bryce McKinlay 18744d9b72 New Stack Trace infrastructure.
2005-03-10  Bryce McKinlay  <mckinlay@redhat.com>

	New Stack Trace infrastructure.
	* Makefile.am (libgcj0_convenience_la_SOURCES): Add stacktrace.cc.
	(gnu/gcj/runtime/StackTrace.lo): Removed.
	(ordinary_java_source_files): Remove obsolete files.
	(nat_source_files): Remove obsolete files. Add natVMThrowable.cc.
	* configure.host (fallback_backtrace_h): Set backtrace header
	for mingw and cygwin targets.
	* configure.ac: Make symlink for fallback backtrace headers.
	* Makefile.in, configure: Rebuilt.
	* defineclass.cc (_Jv_ClassReader::read_one_code_attribute):
	Read 'LineNumberTable' attribute.
	(_Jv_ClassReader::read_one_class_attribute): Read 'SourceFile'
	attribute.
	(_Jv_ClassReader::handleCodeAttribute): Initialize method line
	table fields.
	* exception.cc: Remove unused include.
	* interpret.cc (DIRECT_THREADED, insn_slot): Moved to java-interp.h.
	(SAVE_PC): New macro. Save current PC in the interpreter frame.
	(NULLCHECK, NULLARRAYCHECK): Use SAVE_PC.
	(_Jv_InterpMethod::compile): Translate bytecode PC values in the line
	table to direct threaded instruction values.
	(_Jv_StartOfInterpreter, _Jv_EndOfInterpreter): Removed.
	(_Jv_InterpMethod::run): No longer member function. All
	callers updated. Remove _Unwind calls. Call SAVE_PC whenever a call
	is made or where an instruction could throw.
	(_Jv_InterpMethod::get_source_line): New. Look up source line numbers
	in line_table.
	* prims.cc (catch_segv): Construct exception after MAKE_THROW_FRAME.
	(catch_fpe): Likewise.
	* stacktrace.cc: New file. Stack trace code now here.
	* gnu/gcj/runtime/MethodRef.java:
	* gnu/gcj/runtime/NameFinder.java: Mostly reimplemented. Now simply
	calls addr2line to look up PC addresses in a given binary or shared
	library.
	* gnu/gcj/runtime/StackTrace.java, gnu/gcj/runtime/natNameFinder.cc,
	gnu/gcj/runtime/natStackTrace.cc: Removed.
	* gnu/java/lang/MainThread.java (call_main): Add comment warning that
	this function name is specially recognised by the stack trace code
	and shouldn't be changed.
	* include/java-interp.h (DIRECT_THREADED, insn_slot): Moved here.
	(struct  _Jv_LineTableEntry, line_table, line_table_len): New.
	(_Jv_InterpMethod::run): Update declaration.
	(_Jv_StackTrace_): New friend. NameFinder and StackTrace no longer
	friends.
	(_Jv_InterpFrame): Renamed from _Jv_MethodChain. Add PC field.
	* include/java-stack.h: New file. Declarations for stack tracing.
	* include/jvm.h (_Jv_Frame_info): Removed.
	* java/lang/Class.h: Update friend declarations.
	* java/lang/VMClassLoader.java (getSystemClassLoader): Simplify
	exception message.
	* java/lang/VMThrowable.java (fillInStackTrace): Now native.
	(getStackTrace): Now native.
	(data): New RawDataManaged field.
	* java/lang/natClass.cc: Update includes.
	(forName): Use _Jv_StackTrace::GetCallingClass for
	calling-classloader check.
	(getClassLoader): Likewise.
	* java/lang/natRuntime.cc: Update includes.
	(_load): Use _Jv_StackTrace::GetFirstNonSystemClassLoader.
	* java/lang/natVMSecurityManager.cc: Update includes.
	(getClassContext): Use _Jv_StackTrace::GetClassContext.
	* java/lang/natVMThrowable.cc: New file. Native methods for
	VMThrowable.
	* java/lang/reflect/natArray.cc: Update includes.
	(newInstance): Use _Jv_StackTrace::GetCallingClass to implement
	accessibility check.
	* java/lang/reflect/natConstructor.cc: Update includes.
	(newInstance): Use _Jv_StackTrace::GetCallingClass to implement
	accessibility check.
	* java/lang/reflect/natField.cc: Update includes.
	(getAddr): Use _Jv_StackTrace::GetCallingClass to implement
	accessibility check.
	* java/lang/reflect/natMethod.cc: Update includes.
	(invoke): Use _Jv_StackTrace::GetCallingClass to implement
	accessibility check.
	* java/util/natResourceBundle.cc: Update includes.
	(getCallingClassLoader): Use _Jv_StackTrace::GetCallingClass.
	* java/util/logging/natLogger.cc: Update includes. Use
	_Jv_StackTrace::GetCallerInfo to get call-site info.
	* sysdep/generic/backtrace.h: Fallback backtrace code. Stub
	implementation.
	* sysdep/i386/backtrace.h: New. Fallback backtrace code. i386
	implementation.

From-SVN: r96253
2005-03-10 19:02:21 +00:00
Tom Tromey 2a2c6e55e7 Class.h (_Jv_GetMethodString): Updated declaration.
* java/lang/Class.h (_Jv_GetMethodString): Updated declaration.
	* 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.

From-SVN: r95181
2005-02-17 19:17:08 +00:00
Tom Tromey f55db9c2fc defineclass.cc (handleClassBegin): Use _Jv_RegisterInitiatingLoader.
* defineclass.cc (handleClassBegin): Use
	_Jv_RegisterInitiatingLoader.
	* java/lang/Class.h (_Jv_UnregisterInitiatingLoader): Declare.
	* java/lang/natVMClassLoader.cc (resolveClass): Don't register
	class.  Use _Jv_UnregisterInitiatingLoader.
	* java/lang/natClassLoader.cc (_Jv_UnregisterInitiatingLoader):
	New function.

From-SVN: r94717
2005-02-07 21:29:04 +00:00
Tom Tromey 8bf0438795 Class.h (next): Updated documentation.
* java/lang/Class.h (next): Updated documentation.  Renamed to
	'next_or_version'.
	* java/lang/natClassLoader.cc (_Jv_RegisterClasses): Use
	_Jv_CheckABIVersion.
	(_Jv_RegisterClasses_Counted): Likewise.
	(_Jv_RegisterClassHookDefault): Fix starting condition of
	duplicate-checking loop.
	* include/jvm.h (GCJ_VERSION): New define.
	(GCJ_BINARYCOMPAT_ADDITION): Likewise.
	(_Jv_CheckABIVersion): New function.

From-SVN: r94173
2005-01-24 19:05:34 +00:00
Tom Tromey 3fd8010046 PR libgcj/12016, PR libgcj/18405, PR libgcj/17738:
* java/lang/Package.java (getPackages): Use VMClassLoader when
	appropriate.
	(getPackage): Likewise.
	* prims.cc (_Jv_CreateJavaVM): Call
	_Jv_RegisterBootstrapPackages.
	* include/jvm.h (_Jv_RegisterBootstrapPackages): Declare.
	* java/lang/VMClassLoader.java (getPackage): Rewrote.
	(getPackages): Likewise.
	(definedPackages): New field.
	(definePackageForNative): New method.
	* java/lang/Class.h (_Jv_FindClassInCache): Updated.
	* java/lang/natVMClassLoader.cc (loadClass): Updated.
	* defineclass.cc (handleClassBegin): Use
	ClassLoader.findLoadedClass.
	* java/lang/natClassLoader.cc (_Jv_RegisterInitiatingLoader):
	Rewrote.
	(struct _Jv_LoaderInfo): Removed.
	(initiated_classes): Likewise.
	(_Jv_UnregisterClass): Don't use initiated_classes.
	(_Jv_FindClassInCache): Likewise.  Removed 'loader' argument.
	(_Jv_FindClass): Register classes found during boostrap.
	(BOOTSTRAP_CLASS_LIST_SIZE): New define.
	(bootstrap_class_list): New global.
	(bootstrap_index): Likewise.
	(_Jv_RegisterBootstrapPackages): New function.
	* gnu/gcj/runtime/natVMClassLoader.cc (findClass): Call
	definePackageForNative.
	(findClass): Updated.
	* gnu/gcj/runtime/VMClassLoader.java (definePackageForNative):
	New method.

From-SVN: r93155
2005-01-10 19:39:26 +00:00
Tom Tromey 7cb21c1c12 natDebug.cc (getField): Don't qualify name.
* gnu/gcj/util/natDebug.cc (getField): Don't qualify name.
	* java/lang/Class.h (_Jv_Linker): Declare.
	(Class): Fix names of friends.
	(_Jv_getInterfaceMethod): Declare.

From-SVN: r91320
2004-11-26 02:27:54 +00:00
Tom Tromey 367390404d * Merged gcj-abi-2-dev-branch to trunk.
(Actual changes too large to list in the commit message;
see ChangeLog.)

From-SVN: r91270
2004-11-25 03:47:08 +00:00
Kriang Lerdsuwanakij 21a0c6e02e Makefile.am: Correct friend function declaration.
* Makefile.am: Correct friend function declaration.
	* Makefile.in: Regenerated.
	* include/boehm-gc.h (JV_MARKOBJ_DECL, JV_MARKARRAY_DECL): Add
	scope to function names.  Declare functions directly.
	* libjava/java/lang/Class.h
	(java::lang::Class): Correct friend class declaration.
	(_Jv_InitClass, _Jv_GetArrayClass): Move definition to global
	scope.
	* libjava/java/lang/Class.h
	(java::lang::Object): Correct friend class declaration.

From-SVN: r90849
2004-11-18 05:37:13 +00:00
Kriang Lerdsuwanakij ea0ffdd260 * libjava/java/lang/Class.h
(java::lang::Class): Correct friend class declaration.

From-SVN: r89578
2004-10-26 10:43:56 +00:00
Geoffrey Keating f1a6626519 Index: gcc/gcc/ChangeLog
2004-10-25  Geoffrey Keating  <geoffk@apple.com>

	* config/darwin.h (LINK_SPEC): Default weak_reference_mismatches
	to 'non-weak'.
	(MAKE_DECL_ONE_ONLY): Set DECL_WEAK.
	(ASM_MAKE_LABEL_LINKONCE): Delete.
	(ASM_WEAKEN_DECL): New.
	(ASM_DECLARE_OBJECT_NAME): Look at DECL_WEAK not DECL_ONE_ONLY.
	(ASM_DECLARE_FUNCTION_NAME): Likewise.
	(TEXT_SECTION_ASM_OP): Add a tab.
	(DATA_SECTION_ASM_OP): Likewise.
	(SECTION_FUNCTION): Add a tab.  Use fputs.  Don't call
	data_section on every section change.
	(EXTRA_SECTIONS): Add a bunch of new extra sections.
	(EXTRA_SECTION_FUNCTIONS): Likewise.
	(USE_SELECT_SECTION_FOR_FUNCTIONS): Define.
	(JCR_SECTION_NAME): Define.
	(TARGET_SECTION_TYPE_FLAGS): Don't define.
	* config/darwin.c (darwin_encode_section_info): A symbol is defined
	in this file if it is not weak.
	(textcoal_section): Delete.
	(datacoal_section): Delete.
	(darwin_make_decl_one_only): Delete.
	(machopic_select_section): Handle functions.
	(darwin_asm_named_section): Add a tab.
	(darwin_section_type_flags): Delete.
	(darwin_unique_section): Delete contents.
	(darwin_emit_unwind_label): Add a tab.  Make decls weak if
	DECL_WEAK is set.
	* config/darwin-protos.h (darwin_section_type_flags): Delete.
	(darwin_make_decl_one_only): Delete.
	(text_coal_section): New.
	(text_unlikely_section): New.
	(text_unlikely_coal_section): New.
	(const_coal_section): New.
	(data_coal_section): New.
	(const_data_coal_section): New.
	* varasm.c (function_section): Honour
	USE_SELECT_SECTION_FOR_FUNCTIONS.
	* dwarf2out.c (output_call_frame_info): Look at DECL_WEAK when
	TARGET_USES_WEAK_UNWIND_INFO is in effect.
	* dbxout.c (dbxout_source_file): Don't change sections while
	a function is being output.

Index: gcc/testsuite/ChangeLog
2004-10-25  Geoffrey Keating  <geoffk@apple.com>

	* objc.dg/image-info.m: Update for changes to section selection.

Index: libjava/ChangeLog
2004-10-25  Geoffrey Keating  <geoffk@apple.com>

	* Makefile.am (DARWIN_CRT_SRC): New.
	(libgcj_la_SOURCES): Use it.
	* configure.ac: Define USING_DARWIN_CRT when on Darwin.
	* darwin.cc: New file.
	* include/jvm.h (_Jv_RegisterClasses): Constify.
	(_Jv_RegisterClasses_Counted): New prototype.
	* java/lang/Class.h: Include stddef.h.
	(_Jv_RegisterClasses): Constify.
	(_Jv_RegisterClasses_Counted): New prototype.
	(Object): Make '_Jv_RegisterClasses_Counted' a friend.
	* java/lang/natClassLoader.cc (_Jv_RegisterClasses): Constify.
	(_Jv_RegisterClasses_Counted): New function.
	* configure: Regenerate.
	* Makefile.in: Regenerate.
	* gcj/Makefile.in: Regenerate.
	* include/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

Index: libstdc++-v3/ChangeLog
2004-10-25  Geoffrey Keating  <geoffk@apple.com>

	* libsupc++/new_op.cc (new): Make weak.
	* libsupc++/new_opnt.cc (new): Make weak.
	* libsupc++/new_opv.cc (new): Make weak.
	* libsupc++/new_opvnt.cc (new): Make weak.
	* libsupc++/delete_op.cc (delete): Make weak.
	* libsupc++/delete_opnt.cc (delete): Make weak.
	* libsupc++/delete_opv.cc (delete): Make weak.
	* libsupc++/delete_opvnt.cc (delete): Make weak.

From-SVN: r89572
2004-10-26 06:09:05 +00:00
Per Bothner b4d49f49bf javaprims.h (_Jv_Utf8Const): Change struct to a class, with private fields and access methods.
* gcj/javaprims.h (_Jv_Utf8Const): Change struct to a class,
	with private fields and access methods.
	(_Jv_NewStringUTF, _Jv_hashUtf8String): New function declarations.
	* gcj/cni.h (_Jv_NewStringUTF): Move to javaprims.h.
	* prims.cc (_Jv_Utf8COnst::init): New method implementation.
	( _Jv_makeUtf8Const): Rewrite using new constructors.
	(hashUtf8String): Rename to +_Jv_hashUtf8String and make non-static.
	* defineclass.cc: Use new _Utf8Const access/convenience methods.
	* jni.cc: Likewise.
	* resolve.cc: Likewise.
	* gcj/field.h: Likewise.
	* include/jvm.h: Likewise.
	* java/lang/Class.h: Likewise.
	* java/lang/natClass.cc: Likwise.
	* java/lang/natClassLoader.cc: Likewise
	* java/lang/reflect/natMethod.cc: Likewise
	* verify.cc: Likewise.
	(_Jv_BytecodeVerifier::make_utf8_const):  Optimize.
	(~_Jv_BytecodeVerifier):  Don't need second _Jv_Free call.

From-SVN: r85854
2004-08-11 23:53:42 -07:00
Bryce McKinlay ffe4e0376f prims.cc (_Jv_InitPrimClass): Don't create an array class.
2004-07-23  Bryce McKinlay  <mckinlay@redhat.com>

	* prims.cc (_Jv_InitPrimClass): Don't create an array class.
	(_Jv_CreateJavaVM): Don't pass array vtable parameter to
	_Jv_InitPrimClass.
	(DECLARE_PRIM_TYPE): Don't declare array vtables.
	* include/jvm.h (struct _Jv_ArrayVTable): Removed.
	* java/lang/Class.h (_Jv_InitPrimClass): Update friend declaration.

From-SVN: r85109
2004-07-24 02:17:29 +01:00
Per Bothner 963ddbd50f Print -verbose:message on "loading", not initialization.
* java/lang/Class.h (JV_STATE_LOADED, JV_STATE_COMPILED):  Swap order.
	* defineclass.cc (_Jv_ClassReader::parse):  Print message if
	gcj::verbose_class_flag.
	* java/lang/natClass.cc (initializeClass):  Don't print message here.
	* java/lang/natClassLoader.cc (_Jv_WaitForState):  If state was
	_JV_STATE_COMPILED, set to JV_STATE_LOADED and may print message.
	(_Jv_PrepareCompiledClass):  Likewise.

From-SVN: r84926
2004-07-19 11:29:31 -07:00
Bryce McKinlay 746ecc7813 natClass.cc (_Jv_LayoutInterfaceMethods): New method.
2004-04-21  Bryce McKinlay  <mckinlay@redhat.com>

        * java/lang/natClass.cc (_Jv_LayoutInterfaceMethods): New method.
        Set method->index values for interface methods to their itable
	index.
        (initializeClass): Call _Jv_LayoutInterfaceMethods.

From-SVN: r80978
2004-04-21 20:26:22 +01:00
Bryce McKinlay f531010820 class.c (make_class_data): Add new field aux_info.
2004-04-19  Bryce McKinlay  <mckinlay@redhat.com>

	* class.c (make_class_data): Add new field aux_info.
	* decl.c (java_init_decl_processing): Push type and decl for
	`aux_info'.

2004-04-19  Bryce McKinlay  <mckinlay@redhat.com>

	* gcj/cni.h (JvAllocObject): Remove these obsolete,
	undocumented CNI calls.
	* include/java-interp.h (_Jv_InterpClass): No longer
	extends java.lang.Class.
	* java/lang/Class.h (Class): Add new field `aux_info'.
	* boehm.cc (_Jv_MarkObj): Update java.lang.Class marking.
	* defineclass.cc: Remove Class<->_Jv_InterpClass casts.
	Use Class->aux_info instead.
	* jni.cc (_Jv_JNI_AllocObject): Use _Jv_AllocObject.
	* resolve.cc: Remove Class<->_Jv_InterpClass casts.
	Use Class->aux_info instead.
	* java/io/natObjectInputStream.cc (allocateObject): Use
	_Jv_AllocObject.
	* java/lang/natClass.cc (newInstance): Likewise.
	* java/lang/natClassLoader.cc (_Jv_NewClass): Likewise.
	* java/lang/natObject.cc (clone): Likewise.
	* java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Likewise.
	* java/lang/natVMClassLoader.cc (defineClass): Don't use
	JvAllocObject. Allocate klass->aux_info here for interpreted
	class.

From-SVN: r80875
2004-04-20 02:38:46 +01:00
Bryce McKinlay 245c3c04af prims.cc (_Jv_AllocObject): Remove `size' argument.
libjava:
2004-04-15  Bryce McKinlay  <mckinlay@redhat.com>

	* prims.cc (_Jv_AllocObject): Remove `size' argument.
	(_Jv_AllocObjectNoFinalizer): Likewise.
	(_Jv_AllocObjectNoInitNoFinalizer): Likewise.
	(_Jv_AllocPtrFreeObject): Likewise.
	(_Jv_AllocString): Moved from natString.cc. Call collector interface
	directly even in the JVMPI case.
	* gcj/cni.h (JvAllocObject): Remove `size' argument from
	_Jv_AllocObject calls.
	* gcj/javaprims.h: Update prototypes.
	* gnu/gcj/natCore.cc (_Jv_create_core): Use `new', not
	_Jv_AllocObject.
	* java/lang/Class.h: Update _Jv_AllocObject friend prototype.
	* java/lang/natString.cc (_Jv_AllocString): Move to prims.cc.

gcc/cp:
2004-04-15  Bryce McKinlay  <mckinlay@redhat.com>

	* init.c (build_new_1): Don't use type size argument for Java
	_Jv_AllocObject call.

gcc/java:
2004-04-15  Bryce McKinlay  <mckinlay@redhat.com>

	* expr.c (expand_java_NEW): Don't use size argument for
	_Jv_AllocObject calls.
	* parse.y (patch_invoke): Likewise.

From-SVN: r80754
2004-04-16 17:27:19 +01:00
Michael Koch b7e0ff4538 Class.h (hack_signers): Renamed signers to hack_signers.
2003-12-03  Michael Koch  <konqueror@gmx.de>

	* java/lang/Class.h (hack_signers): Renamed signers to hack_signers.
	* java/lang/natClass.cc (getSigners): Likewise.
	(setSigners): Likewise.

From-SVN: r74247
2003-12-03 21:26:59 +00:00
Andrew Haley 904715853c lang.c (LANG_HOOKS_GET_CALLEE_FNDECL): New.
2003-10-22  Andrew Haley  <aph@redhat.com>

        * lang.c (LANG_HOOKS_GET_CALLEE_FNDECL): New.
        (java_get_callee_fndecl): New.

        * jcf-parse.c (java_parse_file): Call emit_catch_table().

        * java-tree.h (ctable_decl): New.
        (catch_classes):  New.
        (java_tree_index): Add JTI_CTABLE_DECL, JTI_CATCH_CLASSES.

        * decl.c (java_init_decl_processing): Add catch_class_type.
        Add ctable_decl.
        Add catch_classes field.

        * class.c (build_indirect_class_ref): Break out from
        build_class_ref.
        (make_field_value): Check flag_indirect_dispatch.
        (make_class_data): Ditto.
        Tidy uses of PUSH_FIELD_VALUE.
        Add field catch_classes.
        (make_catch_class_record): New.

        * java-tree.h (PUSH_FIELD_VALUE): Tidy.

2003-10-22  Andrew Haley  <aph@redhat.com>

        * java/lang/natClass.cc (initializeClass): Call
        _Jv_linkExceptionClassTable.
        (_Jv_LinkSymbolTable): Call )_Jv_ThrowNoSuchMethodError.  Call
        _Jv_Defer_Resolution on a method whose ncode is NULL.
        (_Jv_linkExceptionClassTable): New function.
        (_Jv_LayoutVTableMethods): If superclass looks like a constant pool
        entry, look it up.
        * java/lang/Class.h (struct _Jv_CatchClass): New.
        (_Jv_linkExceptionClassTable): New friend.
        (_Jv_Defer_Resolution): New friend.
        (class Class.catch_classes): New field.
        * include/java-interp.h (Jv_Defer_Resolution): New method.
        (_Jv_PrepareClass): Make a friend of _Jv_MethodBase.
        (_Jv_MethodBase.deferred): New field.
        (_Jv_Defer_Resolution): New function.
        * resolve.cc (_Jv_PrepareClass): Resolve deferred handlers.
        * exception.cc (get_ttype_entry): Change return type to void**.
        (PERSONALITY_FUNCTION): Remove all code related to using a
        Utf8Const* for a match type.  Change match type to be a pointer to
        a pointer, rather than a pointer to a Class.
        * defineclass.cc (handleCodeAttribute): Initialize
        method->deferred.
        (handleMethodsEnd): Likewise.

From-SVN: r72886
2003-10-24 09:29:43 +00:00
Tom Tromey eab09cdf1a re PR libgcj/12416 (java.lang.Class.getFields returns duplicate entries.)
PR libgcj/12416:
	* java/lang/Class.h: Updated.
	* java/lang/natClass.cc (_getFields): Removed.
	(getFields): Likewise.
	(getDeclaredFields): Added `public_only' parameter.
	* java/lang/Class.java (getFields): Now implemented in java; from
	Classpath.
	(getDeclaredFields): Likewise.
	(getDeclaredFields(boolean)): Declare.
	(_getFields): Removed.
	(internalGetFields): New method, from Classpath.

From-SVN: r72818
2003-10-22 19:29:27 +00:00
Tom Tromey b379e7b0e9 ClassLoader.java (setSigners): Implemented.
* java/lang/ClassLoader.java (setSigners): Implemented.
	* boehm.cc (_Jv_MarkObj): Mark `signers' field.
	* java/lang/natClassLoader.cc (_Jv_InitNewClassFields):
	Initialize new fields.
	* java/lang/Class.java (getSigners): Now native.
	(setSigners): Declare.
	* java/lang/natClass.cc (getSigners): New method.
	(getSigners): Likewise.
	* java/lang/Class.h (Class::signers): New field.
	(Class::setSigners): New method.

From-SVN: r72271
2003-10-09 16:24:55 +00:00