remove unused function and add some thread state assertions

This commit is contained in:
Joel Dice 2008-01-17 18:27:44 -07:00
parent 7252fdcbf3
commit 9ad00d0ea3
2 changed files with 6 additions and 19 deletions

View File

@ -1590,25 +1590,6 @@ removeString(Thread* t, object o)
hashMapRemove(t, t->m->stringMap, o, stringHash, objectEqual);
}
void
invoke(Thread* t, const char* className, int argc, const char** argv)
{
enter(t, Thread::ActiveState);
object args = makeObjectArray
(t, arrayBody(t, t->m->types, Machine::StringType), argc, true);
PROTECT(t, args);
for (int i = 0; i < argc; ++i) {
object arg = makeString(t, "%s", argv[i]);
set(t, args, ArrayBody + (i * BytesPerWord), arg);
}
t->m->processor->invoke
(t, className, "main", "([Ljava/lang/String;)V", 0, args);
}
void
bootClass(Thread* t, Machine::Type type, int superType, uint32_t objectMask,
unsigned fixedSize, unsigned arrayElementSize, unsigned vtableLength)
@ -2747,6 +2728,8 @@ addFinalizer(Thread* t, object target, void (*finalize)(Thread*, object))
System::Monitor*
objectMonitor(Thread* t, object o, bool createNew)
{
assert(t, t->state == Thread::ActiveState);
object p = hashMapFind(t, t->m->monitorMap, o, objectHash, objectEqual);
if (p) {

View File

@ -1645,6 +1645,8 @@ makeExceptionInInitializerError(Thread* t, object cause)
inline object FORCE_ALIGN
makeNew(Thread* t, object class_)
{
assert(t, t->state == Thread::ActiveState);
PROTECT(t, class_);
unsigned sizeInBytes = pad(classFixedSize(t, class_));
object instance = allocate(t, sizeInBytes, classObjectMask(t, class_));
@ -1658,6 +1660,8 @@ makeNew(Thread* t, object class_)
inline object FORCE_ALIGN
makeNewWeakReference(Thread* t, object class_)
{
assert(t, t->state == Thread::ActiveState);
object instance = makeNew(t, class_);
PROTECT(t, instance);