* configure.ac (INTERPRETER): New AM_CONDITIONAL.
* 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.
From-SVN: r127097
* boehm.cc (_Jv_InitGC): Check both HAVE_DLFCN_H and HAVE_DLADDR
before calling GC_register_has_static_roots_callback.
(_Jv_RegisterLibForGc): Likewise, test for both HAVE_DLFCN_H and
HAVE_DLADDR before calling dladdr.
Co-Authored-By: Andrew Haley <aph@redhat.com>
From-SVN: r113417
2006-04-25 Andrew Haley <aph@redhat.com>
* java/lang/natClassLoader.cc: Don't include link.h or dladdr.h.
* boehm.cc: Don't include link.h.
(_Jv_RegisterLibForGc): Cast away const when calling dladdr().
From-SVN: r113246
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-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
* 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.
From-SVN: r110763
* boehm.cc (_Jv_MarkObj): Don't follow null pointer to static field,
which can happen if class is JV_STATE_LOADED but not JV_STATE_PREPARED.
From-SVN: r97128
* configure.ac: Handle --enable-gc-debug.
* configure: Regenerate.
* include/config.h.in (LIBGCJ_GC_DEBUG): Add.
* boehm.cc: Include gc_mark.h, javaxfc.h, but no GC private files.
Rearrange include file order.
(GC_DEBUG): Set if LIBGCJ_GC_DEBUG is set.
(GC_finalize_all, GC_debug_generic_malloc): Don't declare.
(disable_gc_mutex): Delete along with all references.
(_Jv_MarkObj, _Jv_MarkArray): Use public types,
adjust for debug header size.
(_Jv_AllocObj, _Jv_allocPtrFreeObj): Define out of line for
debug case.
(_Jv_AllocArray): Declare min_heap_addr only if needed.
(gcj_describe_type_fn): New.
(_Jv_InitGC): Use GC_new_free_list, GC_new_proc, and GC_new_kind.
Register gcj_describe_type_fn.
* include/boehm-gc.h:
(_Jv_AllocObj, _Jv_allocPtrFreeObj):
Don't define, but declare, for debug case.
* java/lang/natObject.cc:
(GC_DEBUG): Define if LIBGCJ_GC_DEBUG is set.
From-SVN: r86686
* boehm.cc (_Jv_BuildGCDescr): Put first word of object in most
significant bit of descriptor. Include the vtable and sync_info
fields.
From-SVN: r71895
* boehm.cc (initialized, obj_kind_x, obj_free_list): Removed unused
declarations.
(_Jv_InitGC): Don't bother locking, as this is always called from a
single-thread. Turn off GC_all_interior_pointers. Remove dead code.
From-SVN: r49695
2001-10-15 Hans Boehm <Hans_Boehm@hp.com>
* java/lang/natObject.cc (heavy_lock): Moved fields
old_client_data, old_finalization_proc near beginning.
(heavy_lock_finalization_proc): Now inline; changed type of
argument.
(JV_SYNC_TABLE_SZ): Now 2048.
(mp): New global.
(spin): `mp' now global.
(heavy_lock_obj_finalization_proc): Updated to correctly handle
heavy lock finalization.
(remove_all_heavy): New function.
(maybe_remove_all_heavy): Likewise.
(_Jv_MonitorEnter): Throw exception if object is NULL.
(_Jv_MonitorExit): Likewise. Also, clear long lists of unlocked
heavy locks.
* include/jvm.h (_Jv_AllocTraceTwo): Declare.
* nogc.cc (_Jv_AllocTraceTwo): New function.
* boehm.cc (trace_two_vtable): New global.
(_Jv_AllocTraceTwo): New function.
From-SVN: r46271
2001-08-17 Hans-J. Boehm <Hans_Boehm@hp.com>
* boehm.cc: Include gc_local_alloc.h if appropriate.
(GC_GENERIC_MALLOC): Don't define.
(MAYBE_MARK): Redefine for GC 6.0.
(_Jv_MarkObj): Mark class differently.
(_Jv_AllocArray): Use GC_generic_malloc.
From-SVN: r44993
* configure.in: Update boehm-gc include dir for new GC version.
* configure: Rebuilt.
* exception.cc: Only include <gc.h>. Remove TRUE/FALSE hacks and
extern "C" wrapper.
* boehm.cc: Update includes for new GC version. MAKE_PROC is now
GC_MAKE_PROC. mark_proc is now GC_mark_proc.
* posix-threads.cc: Only include <gc.h>. Don't need to wrap with
extern "C".
From-SVN: r42380
* class.c (make_class_data): Push initial value for "arrayclass".
* decl.c (init_decl_processing): Add new class field "arrayclass".
In libjava:
* java/lang/Class.h (_Jv_InitClass): Use __builtin_expect.
(_Jv_NewArrayClass): Renamed from _Jv_FindArrayClass.
(_Jv_GetArrayClass): New inline function.
(arrayclass): New field.
* prims.cc (_Jv_NewObjectArray): Use _Jv_GetArrayClass. Don't use
_Jv_GetArrayElementFromElementType.
(_Jv_NewPrimArray): Ditto.
(_Jv_PrimClass constructor): Initialize "depth", "ancestors", and
"idt" for completeness. Initialze "arrayclass" using _Jv_NewArrayClass.
Set Modifier::ABSTRACT.
* java/lang/natClassLoader.cc (_Jv_NewClass): Initialize "arrayclass".
(_Jv_NewArrayClass): Renamed from _Jv_FindArrayClass. Now void.
Now synchronized. Array classes are now referenced from
elementClass->arrayclass. Don't use _Jv_FindClassInCache.
Set array classes' accessibility flags correctly. Optimize so that
all array classes share the same IDT.
* java/lang/reflect/natArray.cc (newInstance): Use _Jv_GetArrayClass.
* java/lang/reflect/natMethod.cc (_Jv_GetTypesFromSignature): Ditto.
* java/lang/natClass.cc (_getFields): Increment offset. Prevent fields
in superclasses from overwriting classes own fields.
(_Jv_IsAssignableFrom): Check for NULL source idt instead of calling
Modifier::isAbstract().
(null_idt): New static field.
(_Jv_PrepareConstantTimeTables): Optimize case where class implements
no interfaces.
(_Jv_IndexOf): Made inline.
* boehm.cc (_Jv_MarkObj): Mark "arrayclass" field.
From-SVN: r38808
2000-09-30 Hans Boehm <boehm@acm.org>
Bryce McKinlay <bryce@albatross.co.nz>
Implement bitmap descriptor based marking for Boehm GC.
* configure.in: Define JC1GCSPEC. Set it if boehm-gc is used.
* configure: Rebuilt.
* libgcj.spec.in: Pass JC1GCSPEC to jc1.
* include/jvm.h (struct _Jv_VTable): New field `gc_descr'. New inline
method get_finalizer().
(struct _Jv_ArrayVTable): Ditto. Declare method array with
NUM_OBJECT_METHODS elements instead of NUM_OBJECT_METHODS + 1.
(_Jv_AllocObj): Add new jclass parameter.
(_Jv_AllocArray): Ditto.
(_Jv_BuildGCDescr): New prototype.
* prims.cc (_Jv_AllocObject): Rename parameter `c' to `klass'. Pass
`klass' to _Jv_AllocObj. Don't set the new object's vtable. Use
get_finalizer() instead of direct finalizer vtable offset.
(_Jv_NewObjectArray): Rename parameter `clas' to `klass'. Pass
`klass' to _Jv_AllocArray. Don't set the new array's vtable.
(_Jv_NewPrimArray): Call _Jv_FindArrayClass before _Jv_AllocObj.
Pass `klass' to _Jv_AllocObj. Don't set the new array's vtable.
* resolve.cc (METHOD_NOT_THERE, METHOD_INACCESSIBLE): New #defines.
(_Jv_ResolvePoolEntry): Use METHOD_NOT_THERE and METHOD_INACCESSIBLE.
(_Jv_DetermineVTableIndex): Ditto.
(_Jv_PrepareClass): Ditto. Remove offset-by-one adjustments from vtable
calculations to account for new gc_descr field.
* boehm.cc: #include gc_gcj.h.
(obj_kind_x, obj_free_list): `#if 0'-ed away.
(_Jv_MarkObj): Check that vtable doesn't point to a cleared object.
New commentary from HB. Mark the classes vtable.
(_Jv_MarkArray): Check that vtable doesn't point to a cleared object.
(GC_DEFAULT_DESCR): New #define.
(_Jv_BuildGCDescr): New function. Use GC_DEFAULT_DESCR, for now.
(_Jv_AllocObj): New parameter `klass'. Use GC_GCJ_MALLOC ().
(_Jv_AllocArray): New parameter `klass'. Allocate with GC_MALLOC and
scan conservativly if size is less than min_heap_addr. Set vtable
pointer of new object before returning.
(_Jv_AllocBytes): Use GC_MALLOC_ATOMIC, not GC_GENERIC_MALLOC.
(_Jv_InitGC): Call GC_init_gcj_malloc(). Don't set up marking and
allocation for obj_kind_x.
* nogc.cc (_Jv_BuildGCDescr): New function. Return 0.
(_Jv_AllocObj): Set vtable on returned object.
(_Jv_AllocArray): Ditto.
* java/lang/Class.h (_Jv_NewObjectArray): No longer a friend.
(_Jv_NewPrimArray): Ditto.
(_Jv_AllocObj): Declare as a friend.
(_Jv_AllocArray): Ditto.
* java/lang/natClassLoader.cc (_Jv_FindArrayClass): Copy gc_descr
from &ObjectClass into new array class. Remove offset-by-one
adjustments from `method' size calculations to account for gc_descr
field.
Co-Authored-By: Bryce McKinlay <bryce@albatross.co.nz>
From-SVN: r36679
* gcj/field.h (JvFieldIsRef): Return false for gnu.gcj.RawData
field.
* boehm.cc (_Jv_MarkObj): Removed dead code. Use `STATIC', not
`0x0008'.
Include Modifier.h.
From-SVN: r33702
2000-04-19 Bryce McKinlay <bryce@albatross.co.nz>
* boehm.cc: (_Jv_MarkObj, _Jv_MarkArray): Cast pointers for
MAYBE_MARK to ptr_t, for compatibility with new GC version.
From-SVN: r33252
* All files: Updated copyright information.
* COPYING: New file.
* COPYING.LIB: Removed.
* LIBGCJ_LICENSE: We now use GPL + special exception.
From-SVN: r32387