mirror of
https://github.com/corda/corda.git
synced 2025-01-07 13:38:47 +00:00
use virtual dispatch when calling Thread.run from VM
This commit is contained in:
parent
2716169110
commit
61e65098df
@ -2872,6 +2872,17 @@ makeTrace(Thread* t, Thread* target)
|
|||||||
return v.trace ? v.trace : makeArray(t, 0, true);
|
return v.trace ? v.trace : makeArray(t, 0, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
runJavaThread(Thread* t)
|
||||||
|
{
|
||||||
|
object method = resolveMethod(t, "java/lang/Thread", "run", "()V");
|
||||||
|
if (t->exception == 0) {
|
||||||
|
t->m->processor->invoke
|
||||||
|
(t, findMethod(t, method, objectClass(t, t->javaThread)),
|
||||||
|
t->javaThread);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
noop()
|
noop()
|
||||||
{ }
|
{ }
|
||||||
|
@ -1190,6 +1190,9 @@ inline void stress(Thread* t);
|
|||||||
|
|
||||||
#endif // not VM_STRESS
|
#endif // not VM_STRESS
|
||||||
|
|
||||||
|
void
|
||||||
|
runJavaThread(Thread* t);
|
||||||
|
|
||||||
class Thread {
|
class Thread {
|
||||||
public:
|
public:
|
||||||
enum State {
|
enum State {
|
||||||
@ -1242,8 +1245,7 @@ class Thread {
|
|||||||
|
|
||||||
t->m->localThread->set(t);
|
t->m->localThread->set(t);
|
||||||
|
|
||||||
t->m->processor->invoke
|
runJavaThread(t);
|
||||||
(t, "java/lang/Thread", "run", "()V", t->javaThread);
|
|
||||||
|
|
||||||
if (t->exception) {
|
if (t->exception) {
|
||||||
printTrace(t, t->exception);
|
printTrace(t, t->exception);
|
||||||
@ -2023,6 +2025,13 @@ findMethod(Thread* t, object class_, object name, object spec)
|
|||||||
(t, class_, name, spec, findMethodInClass, makeNoSuchMethodError);
|
(t, class_, name, spec, findMethodInClass, makeNoSuchMethodError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline object
|
||||||
|
findMethod(Thread* t, object method, object class_)
|
||||||
|
{
|
||||||
|
return arrayBody(t, classVirtualTable(t, class_),
|
||||||
|
methodOffset(t, method));
|
||||||
|
}
|
||||||
|
|
||||||
inline unsigned
|
inline unsigned
|
||||||
objectArrayLength(Thread* t UNUSED, object array)
|
objectArrayLength(Thread* t UNUSED, object array)
|
||||||
{
|
{
|
||||||
|
@ -125,13 +125,6 @@ isSpecialMethod(Thread* t, object method, object class_)
|
|||||||
and isSuperclass(t, methodClass(t, method), class_);
|
and isSuperclass(t, methodClass(t, method), class_);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline object
|
|
||||||
findMethod(Thread* t, object method, object class_)
|
|
||||||
{
|
|
||||||
return arrayBody(t, classVirtualTable(t, class_),
|
|
||||||
methodOffset(t, method));
|
|
||||||
}
|
|
||||||
|
|
||||||
void*
|
void*
|
||||||
resolveNativeMethod2(Thread* t, object method);
|
resolveNativeMethod2(Thread* t, object method);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user