mirror of
https://github.com/corda/corda.git
synced 2025-01-03 19:54:13 +00:00
fix GC safety bugs
This commit is contained in:
parent
2d0ff83653
commit
651ad20fc3
@ -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));
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user