2006-04-28 Bryce McKinlay <mckinlay@redhat.com>
* link.cc (_Jv_Linker::resolve_pool_entry): Don't pass vtable_index
to resolve_method.
* interpret.cc (insn_invokevirtual): Use method->index, not
vtable_index. Check accflag FINAL to determine finals. Only do
explicit null check if calling a final method. Use
throw_null_pointer_exception.
(invokevirtual_resolved): Likewise.
(null_pointer_exc): Remove static field.
(throw_null_pointer_exception): Always define. Throw a new
NullPointerException every time.
* include/java-interp.h (_Jv_ResolvedMethod): Remove vtable_index
field.
* include/execution.h (resolve_method): Remove vtable_index argument.
From-SVN: r113370
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
* 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