make find[Field|Method]InClass non-inline functions

It seems that GCC 4.6.1 gets confused at LTO time when we take the
address of inline functions, so I'm switching them to non-inline
linkage to make it happy.
This commit is contained in:
Joel Dice 2012-03-26 18:06:16 -06:00
parent 1be6fe6f15
commit 994098baf1
2 changed files with 44 additions and 43 deletions

View File

@ -2418,6 +2418,38 @@ isInitializing(Thread* t, object c)
return false;
}
object
findInTable(Thread* t, object table, object name, object spec,
object& (*getName)(Thread*, object),
object& (*getSpec)(Thread*, object))
{
if (table) {
for (unsigned i = 0; i < arrayLength(t, table); ++i) {
object o = arrayBody(t, table, i);
if (vm::strcmp(&byteArrayBody(t, getName(t, o), 0),
&byteArrayBody(t, name, 0)) == 0 and
vm::strcmp(&byteArrayBody(t, getSpec(t, o), 0),
&byteArrayBody(t, spec, 0)) == 0)
{
return o;
}
}
// fprintf(stderr, "%s %s not in\n",
// &byteArrayBody(t, name, 0),
// &byteArrayBody(t, spec, 0));
// for (unsigned i = 0; i < arrayLength(t, table); ++i) {
// object o = arrayBody(t, table, i);
// fprintf(stderr, "\t%s %s\n",
// &byteArrayBody(t, getName(t, o), 0),
// &byteArrayBody(t, getSpec(t, o), 0));
// }
}
return 0;
}
} // namespace
namespace vm {
@ -3884,35 +3916,17 @@ makeObjectArray(Thread* t, object elementClass, unsigned count)
}
object
findInTable(Thread* t, object table, object name, object spec,
object& (*getName)(Thread*, object),
object& (*getSpec)(Thread*, object))
findFieldInClass(Thread* t, object class_, object name, object spec)
{
if (table) {
for (unsigned i = 0; i < arrayLength(t, table); ++i) {
object o = arrayBody(t, table, i);
if (vm::strcmp(&byteArrayBody(t, getName(t, o), 0),
&byteArrayBody(t, name, 0)) == 0 and
vm::strcmp(&byteArrayBody(t, getSpec(t, o), 0),
&byteArrayBody(t, spec, 0)) == 0)
{
return o;
}
}
return findInTable
(t, classFieldTable(t, class_), name, spec, fieldName, fieldSpec);
}
// fprintf(stderr, "%s %s not in\n",
// &byteArrayBody(t, name, 0),
// &byteArrayBody(t, spec, 0));
// for (unsigned i = 0; i < arrayLength(t, table); ++i) {
// object o = arrayBody(t, table, i);
// fprintf(stderr, "\t%s %s\n",
// &byteArrayBody(t, getName(t, o), 0),
// &byteArrayBody(t, getSpec(t, o), 0));
// }
}
return 0;
object
findMethodInClass(Thread* t, object class_, object name, object spec)
{
return findInTable
(t, classMethodTable(t, class_), name, spec, methodName, methodSpec);
}
object

View File

@ -2591,16 +2591,7 @@ makeObjectArray(Thread* t, unsigned count)
}
object
findInTable(Thread* t, object table, object name, object spec,
object& (*getName)(Thread*, object),
object& (*getSpec)(Thread*, object));
inline object
findFieldInClass(Thread* t, object class_, object name, object spec)
{
return findInTable
(t, classFieldTable(t, class_), name, spec, fieldName, fieldSpec);
}
findFieldInClass(Thread* t, object class_, object name, object spec);
inline object
findFieldInClass2(Thread* t, object class_, const char* name, const char* spec)
@ -2612,12 +2603,8 @@ findFieldInClass2(Thread* t, object class_, const char* name, const char* spec)
return findFieldInClass(t, class_, n, s);
}
inline object
findMethodInClass(Thread* t, object class_, object name, object spec)
{
return findInTable
(t, classMethodTable(t, class_), name, spec, methodName, methodSpec);
}
object
findMethodInClass(Thread* t, object class_, object name, object spec);
inline object
makeThrowable