diff --git a/src/machine.cpp b/src/machine.cpp index 3fbe1cd432..6633e5160d 100644 --- a/src/machine.cpp +++ b/src/machine.cpp @@ -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) { diff --git a/src/machine.h b/src/machine.h index a407e9c8cd..d62dd7ddbd 100644 --- a/src/machine.h +++ b/src/machine.h @@ -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);