initialize the class if necessary when the "new" operator is invoked

This is one of the conditions specified in
http://docs.oracle.com/javase/specs/jls/se7/html/jls-12.html#jls-12.4.1,
which I had forgotten about.
This commit is contained in:
Joel Dice 2013-05-13 13:12:58 -06:00
parent 7e2d265fb9
commit fcfdd6be3a

View File

@ -3252,22 +3252,35 @@ instanceOfFromReference(Thread* t, object pair, object o)
uint64_t
makeNewGeneral64(Thread* t, object class_)
{
PROTECT(t, class_);
initClass(t, class_);
return reinterpret_cast<uintptr_t>(makeNewGeneral(t, class_));
}
uint64_t
makeNew64(Thread* t, object class_)
{
PROTECT(t, class_);
initClass(t, class_);
return reinterpret_cast<uintptr_t>(makeNew(t, class_));
}
uint64_t
makeNewFromReference(Thread* t, object pair)
{
return makeNewGeneral64
(t, resolveClass
(t, classLoader(t, methodClass(t, pairFirst(t, pair))),
referenceName(t, pairSecond(t, pair))));
object class_ = resolveClass
(t, classLoader(t, methodClass(t, pairFirst(t, pair))),
referenceName(t, pairSecond(t, pair)));
PROTECT(t, class_);
initClass(t, class_);
return makeNewGeneral64(t, class_);
}
uint64_t