diff --git a/src/classpath-openjdk.cpp b/src/classpath-openjdk.cpp index c18445d298..bb4bdb33e4 100644 --- a/src/classpath-openjdk.cpp +++ b/src/classpath-openjdk.cpp @@ -1084,14 +1084,14 @@ interceptFileOperations(Thread* t) (t, root(t, Machine::BootLoader), "java/io/FileInputStream"); if (fileInputStreamClass == 0) return; + PROTECT(t, fileInputStreamClass); + object fileInputStreamFdField = findFieldInClass2 (t, fileInputStreamClass, "fd", "Ljava/io/FileDescriptor;"); if (fileInputStreamFdField == 0) return; cp->fileInputStreamFdField = fieldOffset(t, fileInputStreamFdField); - PROTECT(t, fileInputStreamClass); - intercept(t, fileInputStreamClass, "open", "(Ljava/lang/String;)V", voidPointer(openFile)); diff --git a/src/machine.cpp b/src/machine.cpp index ddf27487b1..98835556bf 100644 --- a/src/machine.cpp +++ b/src/machine.cpp @@ -1903,14 +1903,15 @@ bootJavaClass(Thread* t, Machine::Type type, int superType, const char* name, PROTECT(t, bootMethod); object n = makeByteArray(t, name); + PROTECT(t, n); + object class_ = vm::type(t, type); + PROTECT(t, class_); set(t, class_, ClassName, n); object vtable; if (vtableLength >= 0) { - PROTECT(t, class_); - vtable = makeArray(t, vtableLength); for (int i = 0; i < vtableLength; ++ i) { arrayBody(t, vtable, i) = bootMethod; diff --git a/src/machine.h b/src/machine.h index 984d4e54db..fbb5771c8c 100644 --- a/src/machine.h +++ b/src/machine.h @@ -1513,7 +1513,8 @@ shutDown(Thread* t); inline void stress(Thread* t) { - if ((t->flags & (Thread::StressFlag | Thread::TracingFlag)) == 0 + if ((not t->m->unsafe) + and (t->flags & (Thread::StressFlag | Thread::TracingFlag)) == 0 and t->state != Thread::NoState and t->state != Thread::IdleState) { @@ -3166,10 +3167,10 @@ getMethodRuntimeData(Thread* t, object method) inline object getJClass(Thread* t, object c) { + PROTECT(t, c); + object jclass = classRuntimeDataJclass(t, getClassRuntimeData(t, c)); if (jclass == 0) { - PROTECT(t, c); - ACQUIRE(t, t->m->classLock); jclass = classRuntimeDataJclass(t, getClassRuntimeData(t, c));