summaryrefslogtreecommitdiffstats
path: root/libjava/include/execution.h
diff options
context:
space:
mode:
authoraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>2006-04-24 15:33:16 +0000
committeraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>2006-04-24 15:33:16 +0000
commit2934c6b590ded021f96a83dbb8b1100acedde68c (patch)
tree843ad6f8c55847b78d8168eb919c303e362e94d6 /libjava/include/execution.h
parent2770736a425f430981ababc76e39565b28599ec4 (diff)
downloadppe42-gcc-2934c6b590ded021f96a83dbb8b1100acedde68c.tar.gz
ppe42-gcc-2934c6b590ded021f96a83dbb8b1100acedde68c.zip
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113224 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/include/execution.h')
-rw-r--r--libjava/include/execution.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/libjava/include/execution.h b/libjava/include/execution.h
index 88189f6449e..fe141e91ec9 100644
--- a/libjava/include/execution.h
+++ b/libjava/include/execution.h
@@ -55,9 +55,25 @@ struct _Jv_CompiledEngine : public _Jv_ExecutionEngine
return NULL;
}
- static void do_allocate_static_fields (jclass, int, int)
+ static void do_allocate_static_fields (jclass klass,
+ int pointer_size,
+ int other_size)
{
- // Compiled classes don't need this.
+ // Splitting the allocations here lets us scan reference fields
+ // and avoid scanning non-reference fields.
+ char *reference_fields = (char *) _Jv_AllocRawObj (pointer_size);
+ char *non_reference_fields = (char *) _Jv_AllocBytes (other_size);
+
+ for (int i = 0; i < klass->field_count; i++)
+ {
+ _Jv_Field *field = &klass->fields[i];
+
+ if ((field->flags & java::lang::reflect::Modifier::STATIC) == 0)
+ continue;
+
+ char *base = field->isRef() ? reference_fields : non_reference_fields;
+ field->u.addr = base + field->u.boffset;
+ }
}
static void do_create_ncode (jclass)
OpenPOWER on IntegriCloud