mirror of
https://github.com/corda/corda.git
synced 2025-01-08 14:03:06 +00:00
don't remove nodes from call node table, since it leads to a race condition
This commit is contained in:
parent
d072b71c39
commit
7e1a2ea876
@ -1184,9 +1184,6 @@ findCallNode(MyThread* t, void* address);
|
|||||||
void
|
void
|
||||||
insertCallNode(MyThread* t, object node);
|
insertCallNode(MyThread* t, object node);
|
||||||
|
|
||||||
void
|
|
||||||
removeCallNode(MyThread* t, object node);
|
|
||||||
|
|
||||||
void*
|
void*
|
||||||
findExceptionHandler(Thread* t, object method, void* ip)
|
findExceptionHandler(Thread* t, object method, void* ip)
|
||||||
{
|
{
|
||||||
@ -4130,14 +4127,6 @@ compileMethod2(MyThread* t)
|
|||||||
(t, resolveThisPointer(t, t->stack, target)), methodOffset(t, target))
|
(t, resolveThisPointer(t, t->stack, target)), methodOffset(t, target))
|
||||||
= &singletonValue(t, methodCompiled(t, target), 0);
|
= &singletonValue(t, methodCompiled(t, target), 0);
|
||||||
} else {
|
} else {
|
||||||
#ifndef VM_STRESS
|
|
||||||
// valgrind doesn't like this, since the effect of updateCall
|
|
||||||
// below does not propagate to valgrind's interpreter:
|
|
||||||
{ ACQUIRE(t, t->m->classLock);
|
|
||||||
removeCallNode(t, node);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Context context(t);
|
Context context(t);
|
||||||
context.c->updateCall
|
context.c->updateCall
|
||||||
(reinterpret_cast<void*>(callNodeAddress(t, node)),
|
(reinterpret_cast<void*>(callNodeAddress(t, node)),
|
||||||
@ -5329,50 +5318,6 @@ insertCallNode(MyThread* t, object node)
|
|||||||
set(t, p->callTable, ArrayBody + (index * BytesPerWord), node);
|
set(t, p->callTable, ArrayBody + (index * BytesPerWord), node);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
removeCallNode(MyThread* t, object node)
|
|
||||||
{
|
|
||||||
if (DebugCallTable) {
|
|
||||||
fprintf(stderr, "remove call node %p\n",
|
|
||||||
reinterpret_cast<void*>(callNodeAddress(t, node)));
|
|
||||||
}
|
|
||||||
|
|
||||||
MyProcessor* p = processor(t);
|
|
||||||
PROTECT(t, node);
|
|
||||||
|
|
||||||
object oldNode = 0;
|
|
||||||
PROTECT(t, oldNode);
|
|
||||||
|
|
||||||
object newNode = 0;
|
|
||||||
PROTECT(t, newNode);
|
|
||||||
|
|
||||||
intptr_t key = callNodeAddress(t, node);
|
|
||||||
unsigned index = static_cast<uintptr_t>(key)
|
|
||||||
& (arrayLength(t, p->callTable) - 1);
|
|
||||||
|
|
||||||
for (oldNode = arrayBody(t, p->callTable, index);
|
|
||||||
oldNode;
|
|
||||||
oldNode = callNodeNext(t, oldNode))
|
|
||||||
{
|
|
||||||
if (oldNode != node) {
|
|
||||||
newNode = makeCallNode
|
|
||||||
(t, callNodeAddress(t, oldNode),
|
|
||||||
callNodeTarget(t, oldNode),
|
|
||||||
callNodeVirtualCall(t, oldNode),
|
|
||||||
newNode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
set(t, p->callTable, ArrayBody + (index * BytesPerWord), newNode);
|
|
||||||
|
|
||||||
-- p->callTableSize;
|
|
||||||
|
|
||||||
if (p->callTableSize <= arrayLength(t, p->callTable) / 3) {
|
|
||||||
p->callTable = resizeTable
|
|
||||||
(t, p->callTable, arrayLength(t, p->callTable) / 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
object&
|
object&
|
||||||
methodTree(MyThread* t)
|
methodTree(MyThread* t)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user