summaryrefslogtreecommitdiff
path: root/libjava/prims.cc
Commit message (Collapse)AuthorAgeFilesLines
* * interpret.cc (DEBUG): Rename this ...davek2009-04-281-2/+2
| | | | | | | | | | | | | | | | | (__GCJ_DEBUG): ... to this throughout. * configure.ac: Likewise. * interpret-run.cc: Likewise. * prims.cc: Likewise. * gnu/classpath/natConfiguration.cc: Likewise. * include/java-assert.h: Likewise. * java/io/natVMObjectInputStream.cc: Likewise. * configure: Regenerate. * include/config.h.in: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146869 138bc75d-0d04-0410-961f-82ee72b054a4
* * configure.ac (INTERPRETER): New AM_CONDITIONAL.daney2007-07-311-3/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * scripts/makemake.tcl (package_map): Mark jdwp and jvmti packages as being for interpreter only. Place interpreter related files in 'if INTERPRETER' block. (interpreter_package_files): New list. (interpreter_header_vars): Ditto. (emit_package_rule_to_list): Renamed from emit_package_rule with new target list parameter. (emit_package_rule): Rewritten to call emit_package_rule_to_list. (emit_interpreter_rule): New function. (emit_source_var): Place interpreter related files in interpreter_header_vars. * Makefile.am (ACLOCAL_AMFLAGS): Add -I libltdl. (libgcj_interpret_source_files): New variable. (libgcj_la_SOURCES): Move jvmti.cc and interpret.cc to libgcj_interpret_source_files and include libgcj_interpret_source_files. (nat_jdwp_source_files): New variable. (nat_jvmti_source_files): Ditto. (nat_source_files): Move jdwp and jvmti related files to nat_jdwp_source_files and nat_jvmti_source_files and include nat_jdwp_source_files and nat_jvmti_source_files. * Makefile.in: Regenerate. * include/Makefile.in: Ditto. * testsuite/Makefile.in: Ditto. * gcj/Makefile.in: Ditto. * sources.am: Ditto. * configure: Ditto. * include/config.h.in: Ditto. * interpret.cc: Remove #ifdef INTERPRETER block. * stacktrace.cc (UnwindTraceFn): Do not handle proxy frames if interpreter disabled. * include/java-interp.h (_Jv_FrameType): Move outside of #ifdef INTERPRETER block. * include/execution.h (_Jv_IndirectCompiledEngine::do_get_closure_list, _Jv_InterpreterEngine, _Jv_soleInterpreterEngine): Place in #ifdef INTERPRETER block. * jni.cc (jvmti.h, jvmti-int.h): Only include if INTERPRETER is defined. (_Jv_JNI_PopSystemFrame, _Jv_JNI_GetEnv): Only do jvmti processing if INTERPRETER is defined. * prims.cc (jvmti.h, jvmti-int.h, Jdwp.h, VMVirtualMachine.h): Only include if INTERPRETER is defined. (defaultJdwpOptions, jdwpOptions, jvmti_agent_onload_func, jvmti_agent_onunload_func, jvmti_agentonload, jvmti_agentonunload, jvmti_agent_opts, load_jvmti_agent): Only define if INTERPRETER is defined. (parse_x_arg): Only process 'runjdwp:' if INTERPRETER is defined. (parse_init_args): Only process jvmti related options if INTERPRETER is defined. (_Jv_CreateJavaVM): Only call _Jv_JVMTI_Init if INTERPRETER is defined. (_Jv_RunMain): Only do jvmti and jdwp processing if INTERPRETER is defined. * link.cc (jvmti.h, jvmti-int.h): Only include if INTERPRETER is defined. (_Jv_ThrowNoClassDefFoundError, _Jv_Linker::create_error_method): Define if if INTERPRETER is not defined. (_Jv_Linker::wait_for_state): Only do jvmti proccessing if INTERPRETER is defined. * boehm.cc (closure_list_pointer, finalize_closure_list, _Jv_ClosureListFinalizer): Only define if INTERPRETER is defined. * java/lang/natThread.cc (jvmti.h, jvmti-int.h): Only include if INTERPRETER is defined. (finish_, _Jv_NotifyThreadStart): Only do jvmti proccessing if INTERPRETER is defined. * java/lang/Class.h (_Jv_InterpreterEngine): Move declaration and friend declaration inside #ifdef INTERPRETER block. * java/lang/natClass.cc (_Jv_ClosureList::releaseClosures, _Jv_ClosureList::registerClosure, _Jv_GetInterpClassSourceFile): Only define if INTERPRETER is defined. * java/lang/reflect/natVMProxy.cc (UnsupportedOperationException.h): Include. (generateProxyClass): Throw UnsupportedOperationException unless INTERPRETER is defined. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127097 138bc75d-0d04-0410-961f-82ee72b054a4
* * java/io/File.java: Implement Comparable<File>.tromey2007-07-161-9/+12
| | | | | | | | (compareTo): Removed. * java/io/File.h: Rebuilt. * classpath/lib/java/io/File.class: Rebuilt. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126670 138bc75d-0d04-0410-961f-82ee72b054a4
* * include/java-interp.h (_Jv_InterpFrame::get_pc): Only deductkseitz2007-05-241-1/+6
| | | | | | | | | | | | | | | | | | one when pc_ptr is non-NULL. * prims.cc (parse_init_args): Enable JVMTI with agentlib and agentpath options. * testsuite/lib/libjava.exp (exec_gij): Add new addl_flags parameter. * testsuite/libjava.jvmti/jvmti-interp.exp (gij_jvmti_test_one): Pass '-agentlib:dummyagent' when executing gij. (gij_jvmti_run): Build dummy JVMTI agent before running tests, and remove it when finished. * testsuite/libjava.jvmti/dummyagent.c: New file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125040 138bc75d-0d04-0410-961f-82ee72b054a4
* 2007-04-09 H.J. Lu <hongjiu.lu@intel.com>hjl2007-04-091-1/+1
| | | | | | | * prims.cc (load_jvmti_agent): Add the missing `,'. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123672 138bc75d-0d04-0410-961f-82ee72b054a4
* 2007-04-09 Kyle Galloway <kgallowa@redhat.com>kgallowa2007-04-091-2/+165
| | | | | | | | | | * gij.cc (main): Accept -agentlib and -agentpath options. * prims.cc (parse_init_args): Deal with -agentlib and -agentpath. (load_jvmti_agent): New function. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123671 138bc75d-0d04-0410-961f-82ee72b054a4
* 2007-01-31 Andrew Haley <aph@redhat.com>aph2007-01-311-0/+1
| | | | | | | | | * prims.cc (_Jv_Abort): fflush (stderr). * java/lang/natClassLoader.cc (_Jv_CheckABIVersion): Abort. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121433 138bc75d-0d04-0410-961f-82ee72b054a4
* * prims.cc (_Jv_RunMain): Send JVMTI event notificationskseitz2007-01-241-11/+11
| | | | | | | for VM_INIT and VM_DEATH instead of the JDWP notifications. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121143 138bc75d-0d04-0410-961f-82ee72b054a4
* 2007-01-11 Andrew Haley <aph@redhat.com>aph2007-01-111-2/+3
| | | | | | | | | | | * prims.cc (jdwpOptions) Fix deprecated cast from char[] constant to char*. * include/x86_64-signal.h (HANDLE_DIVIDE_OVERFLOW): Rewrite to fix aliasing violation. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120672 138bc75d-0d04-0410-961f-82ee72b054a4
* Merged gcj-eclipse branch to trunk.tromey2007-01-091-0/+33
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120621 138bc75d-0d04-0410-961f-82ee72b054a4
* * prims.cc (_Jv_PrependVersionedLibdir): Usetromey2006-10-101-3/+6
| | | | | | _Jv_platform_path_separator. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117611 138bc75d-0d04-0410-961f-82ee72b054a4
* * include/jvm.h (_Jv_JVMTI_Init): Declare.kseitz2006-09-011-0/+1
| | | | | | | | | | | | | | | | | | | | | * jvmti.cc (_Jv_JVMTI_Init): New function. * prims.cc (_Jv_CreateJavaVM): Initialize JVMTI. * jvmti.cc (ILLEGAL_ARGUMENT): New macro. (_Jv_JVMTI_Allocate): Use ILLEGAL_ARUMENT. * jvmti.cc (_jvmtiEnvironments): New linked list of JVMTI environments. (FOREACH_ENVIRONMENT): New macro. (_envListLock): New object to act as synchronization lock for _jvmtiEnvironments. (_Jv_JVMTI_DisposeEnvironment): Check for NULL environment. Remove the environment from the list of known environments. (_Jv_GetJVMTIEnv): Add the new environment to the list of known environments. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116635 138bc75d-0d04-0410-961f-82ee72b054a4
* * prims.cc (remoteDebug): New global.kseitz2006-08-241-2/+48
| | | | | | | | | | | (jdwpOptions): New global. (parse_x_arg): Add processing for "X" options "debug" and "runjdwp:" (_Jv_RunMain): If debugging, start up JDWP backend. Send VM_INIT and VM_DEATH when appropriate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116383 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-07-28 Gary Benson <gbenson@redhat.com>gary2006-07-281-9/+2
| | | | | | | | | | | | | | * prims.cc (_Jv_CreateJavaVM): Move setting runtimeInitialized from the start to the end of the function. Remove references to VMThrowable.trace_enabled. * java/lang/natVMThrowable.cc (fillInStackTrace): Use runtimeInitialized rather than trace_enabled to decide whether to inhibit stack trace generation. * java/lang/VMThrowable.java (trace_enabled): Removed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115791 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-05-31 Bryce McKinlay <mckinlay@redhat.com>bryce2006-06-011-1/+1
| | | | | | | | | | | * prims.cc (_Jv_RunMain): Use JvNewStringUTF for command-line class name, not Latin1. * gnu/java/lang/MainThread.java (run): Allow file separator char to be used in place of '.' as class-name separator. Don't chain ClassNotFoundException. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114300 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-05-30 Thomas Fitzsimmons <fitzsim@redhat.com>fitzsim2006-05-301-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * scripts/makemake.tcl (emit_bc_rule): Do not skip gnu-java-awt-peer-gtk.lo. Include gnu/java/awt/peer/gtk Java objects in libgcj.so. Use C++ ABI for gnu/java/awt/peer/gtk package. * gnu/classpath/natSystemProperties.cc (PrependVersionedLibdir): New function. (insertSystemProperties): Only set java.ext.dirs if it is not already defined. Prepend GCJ_VERSIONED_LIBDIR to module search path where necessary. * configure.ac (GTK_AWT): Remove automake conditional. * include/jvm.h (_Jv_PrependVersionedLibdir): New function declaration. * gij.cc (main): Prepend LD_LIBRARY_PATH with GCJ_VERSIONED_LIBDIR and re-exec self. * Makefile.am (AM_CXXFLAGS): Define GCJ_VERSIONED_LIBDIR, GIJ_EXECUTABLE and PATH_SEPARATOR macros. Remove lib-gnu-java-awt-peer-gtk.la and libgcjawt.la build logic. * prims.cc (_Jv_PrependVersionedLibdir): New function. 2006-05-30 Thomas Fitzsimmons <fitzsim@redhat.com> * native/jni/gtk-peer/Makefile.am (gcc_version): New variable. (gcjversionedlibdir): Likewise. (libgtkpeer_la_LDFLAGS): Likewise. Install libgtkpeer.so in GCJ versioned library directory. * native/jawt/Makefile.am (gcc_version): New variable. (gcjversionedlibdir): Likewise. (libjawt_la_LDFLAGS): Likewise. Rename libjawtgnu.so libjawt.so. Install libjawt.so in GCJ versioned library directory. * gnu/java/awt/peer/gtk/GdkFontPeer.java (static): Call System.loadLibrary unconditionally. * gnu/java/awt/peer/gtk/GdkPixbufDecoder.java: Likewise. * gnu/java/awt/peer/gtk/GdkGraphics2D.java: Likewise. * gnu/java/awt/peer/gtk/GdkGraphics.java: Likewise. * gnu/java/awt/peer/gtk/GtkToolkit.java: Likewise. * gnu/java/awt/peer/gtk/GdkTextLayout.java: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114247 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-05-09 Andrew Haley <aph@redhat.com>aph2006-05-101-0/+3
| | | | | | | | | | | | | | | | | | | | * 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
* 2006-05-04 Andrew Haley <aph@redhat.com>aph2006-05-041-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113532 138bc75d-0d04-0410-961f-82ee72b054a4
* PR libgcj/26990:tromey2006-04-041-1/+1
| | | | | | | | | | | | | * prims.cc (_Jv_RunMain): Use exitNoChecksAccessor. * gnu/java/lang/natMainThread.cc (call_main): Use exitNoChecksAccessor. * testsuite/libjava.lang/pr26990.out: New file. * testsuite/libjava.lang/pr26990.java: New file. * java/lang/Runtime.java (exitNoChecks): New method. (exitNoChecksAccessor): Likewise. (exit): Call exitNoChecks. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@112685 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-02-08 Bryce McKinlay <mckinlay@redhat.com>bryce2006-02-081-5/+5
| | | | | | | | | | | | | | | | | | | | * 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
* 2006-02-01 Robert Schuster <robertschuster@fsfe.org>rschuster2006-02-011-2/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* * prims.cc (next_property_value): Never return NULL.tromey2006-01-241-7/+8
| | | | | | (process_gcj_properties): Copy 'props' before using it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110177 138bc75d-0d04-0410-961f-82ee72b054a4
* * java/lang/natThread.cc (finish_): Don't clear 'group'.tromey2006-01-061-4/+4
| | | | | | | | | | | | | * sources.am, Makefile.in: Rebuilt. * java/lang/Runtime.java (exit): Merged with Classpath. (runShutdownHooks): New method from Classpath. * java/io/File.java (deleteOnExit): Use DeleteFileHelper, not FileDeleter. * gnu/gcj/runtime/FileDeleter.java: Removed. * java/lang/natRuntime.cc (runFinalizationForExit): New method. (exitInternal): Don't run finalizers or delete files. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109400 138bc75d-0d04-0410-961f-82ee72b054a4
* Implement -Xss.bryce2005-11-171-5/+13
| | | | | | | | | | | | | | * include/jvm.h (gcj::stack_size): Declare. (_Jv_StackSize): Declare. * posix-threads.cc (_Jv_InitThreads): Validate gcj::stack_size. (_Jv_ThreadStart): Set stack size if specified. * prims.cc (gcj::stack_size): Define. (parse_memory_size): Renamed from parse_heap_size. (_Jv_SetStackSize): Parse stack size argument and set gcj::stack_size. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@107132 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
* 2005-05-12 Bryce McKinlay <mckinlay@redhat.com>bryce2005-05-131-0/+6
| | | | | | | | | | | | | | | | | | | | | | * 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-0/+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
* 2005-04-07 Thomas Fitzsimmons <fitzsim@redhat.com>fitzsim2005-04-131-50/+53
| | | | | | | * prims.cc (parse_verbose_args): Fix verbose argument parsing. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98097 138bc75d-0d04-0410-961f-82ee72b054a4
* * jni.cc (_Jv_JNI_GetAnyFieldID): Throw ClassNotFoundException.tromey2005-04-051-23/+56
| | | | | | | | | | | | | | * 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
* 2005-04-01 Thomas Fitzsimmons <fitzsim@redhat.com>fitzsim2005-04-021-17/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * gcj.texi (Invoking gij): Add descriptions of new -X options. Mention recognized-and-ignored compatibility options. (Memory allocation): Add descriptions of JvMalloc, JvRealloc and JvFree. (About CNI): Add Memory allocation section. 2005-04-01 Thomas Fitzsimmons <fitzsim@redhat.com> PR libgcj/20090, PR libgcj/20526 * gij.cc (nonstandard_opts_help): New function. (add_option): New function. (main): Support java options. Set java.class.path. Don't set _Jv_Jar_Class_Path. * prims.cc (parse_x_arg): New function. (parse_init_args): Call parse_x_arg for -X and _ options, when ignoreUnrecognized is true. (new _Jv_RunMain): New vm_args variant. (old _Jv_RunMain): Call new vm_args _Jv_RunMain. (_Jv_Jar_Class_Path): Remove variable. * include/java-props.h: Likewise. * include/cni.h (JvRealloc): New function. * include/jvm.h (_Jv_RunMain): Declare vm_args variant. * java/lang/natRuntime.cc (insertSystemProperties): Remove _Jv_Jar_Class_Path logic. Use JV_VERSION and JV_API_VERSION macros. * configure.ac (JV_VERSION): Define. (JV_API_VERSION): Likewise. * configure: Regenerate. * include/config.h.in: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97429 138bc75d-0d04-0410-961f-82ee72b054a4
* * java/lang/natVMClassLoader.cc (getSystemClassLoaderInternal):tromey2005-04-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Updated for name change. (nativeFindClass): New method. (loadClass): Use nativeFindClass. * java/lang/natClassLoader.cc (_Jv_FindClass): Use single-argument form of loadClass. * java/lang/VMClassLoader.java (tried_libraries, lib_control, LIB_FULL, LIB_CACHE, LIB_NEVER): New fields from old VMClassLoader. (initialize): New method. (nativeFindClass): Declare. * gnu/gcj/runtime/natVMClassLoader.cc: Removed. * gnu/gcj/runtime/VMClassLoader.java: Removed. * gnu/gcj/runtime/ExtensionClassLoader.java: Renamed from VMClassLoader.java. (definePackageForNative): Removed. (tried_libraries, LIB_CACHE, LIB_FULL, LIB_NEVER, lib_control): Moved to VMClassLoader.java. * prims.cc (_Jv_CreateJavaVM): Updated for renaming. * Makefile.am (gnu/gcj/runtime/ExtensionClassLoader.h): Renamed. (ordinary_java_source_files): Added ExtensionClassLoader.java, removed VMClassLoader.java. (nat_source_files): Removed natVMClassLoader.cc. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97414 138bc75d-0d04-0410-961f-82ee72b054a4
* * Makefile.in: Rebuilt.tromey2005-03-241-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Makefile.am (AM_CXXFLAGS): Define TOOLEXECLIBDIR. (libgcj0_convenience_la_SOURCES): Don't include gnu_xml_source_files. (libgcj0_convenience_la_LIBADD): New variable. (libgcj_la_LIBADD): Don't include sax or w3c_dom. (all_java_source_files): javax_imageio_source_files, javax_xml_source_files, and gnu_java_beans_source_files. ($(gnu_xml_source_files:.java=.lo)): Removed target. (gnu-xml.lo): New target. (javax-imageio.lo): Likewise. (javax-xml.lo): Likewise. (gnu-java-beans.lo): Likewise. (gnu_java_beans_source_files): New variable. (javax_imageio_source_files): Likewise. (javax_xml_source_files): Likewise. (javax_source_files): Moved files to other variable. (awt_java_source_files): Likewise. (ordinary_java_source_files): Added BootClassLoader.java. * java/lang/natVMClassLoader.cc (defineClass): Use boot loader, not system class loader. (initBootLoader): New method. (loadClass): Search bootLoader. * java/lang/natClassLoader.cc (_Jv_RegisterInitiatingLoader): Use boot loader, not system class loader. (_Jv_UnregisterInitiatingLoader): Likewise. (_Jv_FindClass): Likewise. Ensure entries in bootstrap_class_list are unique. * java/lang/natClass.cc (getClassLoader): Don't special case system class loader. * java/lang/VMClassLoader.java (bootLoader): New field. (getResource): Use bootLoader. (getResources): Likewise. (initBootLoader): Declare. * gnu/gcj/runtime/BootClassLoader.java: New file. * external/sax/org/xml/sax/helpers/NamespaceSupport.java (EMPTY_ENUMERATION): Now package-private. * external/w3c_com/Makefile.in: Rebuilt. * external/w3c_com/Makefile.am (MULTIBUILDTOP): New variable. (w3c.jar): New target. (classes.stamp): Updated. (toolexeclib_LTLIBRARIES): Renamed from noinst_LTLIBRARIES. Changed name of library. (libw3c_gcj_la_SOURCES): New variable. (libw3c_gcj_la_GCJFLAGS): Likewise. (source_files): Renamed from lib3c_convenience_la_SOURCES. * external/sax/Makefile.in: Rebuilt. * external/sax/Makefile.am (MULTIBUILDTOP): New variable. (sax.jar): New target. (classes.stamp): Updated. (toolexeclib_LTLIBRARIES): Renamed from noinst_LTLIBRARIES. Changed name of library. (libsax_gcj_la_SOURCES): New variable. (libsax_gcj_la_GCJFLAGS): Likewise. (source_files): Renamed from libsax_convenience_la_SOURCES. * stacktrace.cc (non_system_trace_fn): Don't look at system class loader. * prims.cc (_Jv_CreateJavaVM): Initialize the bootstrap class loader. (_Jv_RunMain): Handle case where 'runtime' is NULL at exit. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96960 138bc75d-0d04-0410-961f-82ee72b054a4
* 2005-03-10 Bryce McKinlay <mckinlay@redhat.com>bryce2005-03-101-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96253 138bc75d-0d04-0410-961f-82ee72b054a4
* 2005-02-23 Thomas Fitzsimmons <fitzsim@redhat.com>fitzsim2005-02-231-6/+175
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR libgcj/16923 * gcj.texi (Invocation): Add descriptions of JvVMInitArgs and JvVMOption. 2005-02-23 Thomas Fitzsimmons <fitzsim@redhat.com> PR libgcj/16923 * jni.cc (JNI_CreateJavaVM): Check JNI version. Cast args to JvVMInitArgs. Pass args to _Jv_CreateJavaVM and check return value. Move argument parsing code to prims.cc. * prims.cc (no_properties): Remove. (_Jv_Compiler_Properties): Initialize to NULL. (_Jv_Properties_Count): Initialize to 0. (parse_verbose_args): New function. (parse_init_args): New function. (_Jv_CreateJavaVM): Call parse_init_args. (_Jv_RunMain): Check return value of _Jv_CreateJavaVM. * gcj/cni.h (JvVMOption): New struct. (JvVMInitArgs): Likewise. (JvCreateJavaVM): Declare vm_args as JvVMInitArgs* rather than void*. * libjava/gcj/javaprims.h (_Jv_VMOption): New struct. (_Jv_VMInitArgs): Likewise. * include/java-props.h (_Jv_Properties_Count): Declare. * java/lang/natRuntime.cc (insertSystemProperties): Use _Jv_Properties_Count in for loop exit condition. * testsuite/libjava.jni/jni.exp (gcj_invocation_compile_c_to_binary): New procedure. (gcj_invocation_test_one): Likewise. (gcj_jni_run): Run JNI invocation API tests. * testsuite/libjava.jni/invocation/PR16923.c, testsuite/libjava.jni/invocation/PR16923.java, testsuite/libjava.jni/invocation/PR16923.out: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95459 138bc75d-0d04-0410-961f-82ee72b054a4
* 2005-02-15 David Daney <ddaney@avtrex.com>bryce2005-02-161-0/+2
| | | | | | | | | | | | | Bryce McKinlay <mckinlay@redhat.com> * prims.cc (_Jv_CreateJavaVM): Add comment about initialization order. * posix-threads.cc (_Jv_InitThreads): Call block_sigchld() here to ensure that GC threads inherit the new signal mask. (block_sigchld): Call JvFail rather than throwing exception if pthread_sigmask() fails. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95095 138bc75d-0d04-0410-961f-82ee72b054a4
* * gnu/gcj/runtime/PersistentByteMap.java: Fixed typo.tromey2005-02-021-2/+1
| | | | | | | * prims.cc: Fixed comment. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94592 138bc75d-0d04-0410-961f-82ee72b054a4
* PR libgcj/12016, PR libgcj/18405, PR libgcj/17738:tromey2005-01-101-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@93155 138bc75d-0d04-0410-961f-82ee72b054a4
* * Merged gcj-abi-2-dev-branch to trunk.tromey2004-11-251-2/+6
| | | | | | | | (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
* * prims.cc (unblock_signal): Annotate signum with __unused__ tobothner2004-09-261-1/+3
| | | | | | | | | | | | | avoid warnings in the non-POSIX_VERSION case. Also, we only need this function if either HANDLE_SEGV or HANDLE_FPE, so place it inside an #if block. * include/default-signal.h (SIGNAL_HANDLER): Parameters are __unused__. * include/i386-signal.h (SIGNAL_HANDLER): Likewise * include/mips-signal.h (SIGNAL_HANDLER): Likewise * include/sparc-signal.h (SIGNAL_HANDLER): Likewise git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88148 138bc75d-0d04-0410-961f-82ee72b054a4
* * prims.cc (process_gcj_properties): Optimization.bothner2004-09-261-11/+8
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88147 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-08-23 Bryce McKinlay <mckinlay@redhat.com>bryce2004-08-231-67/+29
| | | | | | | | | | | | * prims.cc (JVMPI_NOTIFY_ALLOC): New macro. Call jvmpi_notify_alloc only if jvmpi is enabled. (jvmpi_notify_alloc): Don't check if jvmpi is enabled here. (_Jv_AllocObjectNoFinalizer): Use JVMPI_NOTIFY_ALLOC. (_Jv_AllocString): Likewise. (_Jv_AllocPtrFreeObject): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86441 138bc75d-0d04-0410-961f-82ee72b054a4
* * gcj/javaprims.h (_Jv_Utf8Const): Change struct to a class,bothner2004-08-121-8/+15
| | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85854 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-07-23 Bryce McKinlay <mckinlay@redhat.com>bryce2004-07-241-14/+10
| | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85109 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-07-20 Bryce McKinlay <mckinlay@redhat.com>bryce2004-07-201-0/+2
| | | | | | | | | PR libgcj/16591 * prims.cc (_Jv_RunMain): Don't call _Jv_SetArgs if DISABLE_MAIN_ARGS is defined. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84964 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-07-19 Bryce McKinlay <mckinlay@redhat.com>bryce2004-07-201-2/+4
| | | | | | | | * prims.cc (process_gcj_properties): Don't increment i within LHS of assignment. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84957 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-07-13 Bryce McKinlay <mckinlay@redhat.com>bryce2004-07-131-0/+5
| | | | | | | | | | | | | PR libgcj/7587 * interpret.cc (compile_mutex): New. (_Jv_InitInterpreter): New. Initialize compile_mutex. (run): Lock compile_mutex before calling compile() if compilation is required. * prims.cc (_Jv_CreateJavaVM): Call _Jv_InitInterpreter(). * include/java-interp.h (_Jv_InitInterpreter): Declare. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84644 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-07-11 Bryce McKinlay <mckinlay@redhat.com>bryce2004-07-111-2/+1
| | | | | | | | | | | | | | | | PR libgcj/16748 * prims.cc (_Jv_CreateJavaVM): Fix comment. * gnu/gcj/runtime/FinalizerThread.java (init): New. Native. (finalizerReady): Now native. (run): Likewise. (runFinalizers): Removed. * gnu/gcj/runtime/natFinalizerThread.cc (run): Implement here. Use a primitive lock, and don't hold it while running the finalizers. (runFinalizers): Implement. Don't aquire any Java lock. (finalizerReady): Use lock primitives to signal finalizer thread. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84531 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-07-04 Michael Koch <konqueror@gmx.de>mkoch2004-07-041-5/+5
| | | | | | | | | | | | | * gnu/gcj/runtime/FirstThread.java, gnu/gcj/runtime/natFirstThread.cc: Removed. * gnu/java/lang/MainThread.java, gnu/java/lang/natMainThread.cc: New files. * prims.cc (_Jv_RunMain): Use MainThread instead of FirstThread. * Makefile.am: Added new files and removed deleted ones. * Makefile.in: Regenerated. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84085 138bc75d-0d04-0410-961f-82ee72b054a4
* * prims.cc (_Jv_CreateJavaVM): Install SEGV and FPE handlers,rmathew2004-06-181-5/+9
| | | | | | | | if desired, before the default class loader is initialised. Call INIT_SEGV only if HANDLE_SEGV is defined. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83348 138bc75d-0d04-0410-961f-82ee72b054a4
* libjava:bryce2004-04-161-9/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@80754 138bc75d-0d04-0410-961f-82ee72b054a4