resolve primitive array classes when generating boot image

This is necessary to accomodate classes loaded at runtime which refer
to primitive array types.  Otherwise, they won't be included unless
classes in the bootimage refer to them.
This commit is contained in:
Joel Dice 2011-01-18 08:35:52 -07:00
parent 475b286c7f
commit c02bfc57a5

View File

@ -411,6 +411,41 @@ writeBootImage(Thread* t, FILE* out, BootImage* image, uint8_t* code,
set(t, type(t, Machine::JdoubleType), ClassName, name);
}
// resolve primitive array classes in case they are needed at
// runtime:
{ resolveSystemClass
(t, root(t, Machine::BootLoader), makeByteArray(t, "[B"), true);
if (t->exception) return;
resolveSystemClass
(t, root(t, Machine::BootLoader), makeByteArray(t, "[Z"), true);
if (t->exception) return;
resolveSystemClass
(t, root(t, Machine::BootLoader), makeByteArray(t, "[S"), true);
if (t->exception) return;
resolveSystemClass
(t, root(t, Machine::BootLoader), makeByteArray(t, "[C"), true);
if (t->exception) return;
resolveSystemClass
(t, root(t, Machine::BootLoader), makeByteArray(t, "[I"), true);
if (t->exception) return;
resolveSystemClass
(t, root(t, Machine::BootLoader), makeByteArray(t, "[J"), true);
if (t->exception) return;
resolveSystemClass
(t, root(t, Machine::BootLoader), makeByteArray(t, "[F"), true);
if (t->exception) return;
resolveSystemClass
(t, root(t, Machine::BootLoader), makeByteArray(t, "[D"), true);
if (t->exception) return;
}
collect(t, Heap::MajorCollection);
uintptr_t* heap = static_cast<uintptr_t*>