mirror of
https://github.com/corda/corda.git
synced 2025-01-05 20:54:13 +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);
|
||||
}
|
||||
|
||||
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
|
||||
noop()
|
||||
{ }
|
||||
|
@ -1190,6 +1190,9 @@ inline void stress(Thread* t);
|
||||
|
||||
#endif // not VM_STRESS
|
||||
|
||||
void
|
||||
runJavaThread(Thread* t);
|
||||
|
||||
class Thread {
|
||||
public:
|
||||
enum State {
|
||||
@ -1242,8 +1245,7 @@ class Thread {
|
||||
|
||||
t->m->localThread->set(t);
|
||||
|
||||
t->m->processor->invoke
|
||||
(t, "java/lang/Thread", "run", "()V", t->javaThread);
|
||||
runJavaThread(t);
|
||||
|
||||
if (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);
|
||||
}
|
||||
|
||||
inline object
|
||||
findMethod(Thread* t, object method, object class_)
|
||||
{
|
||||
return arrayBody(t, classVirtualTable(t, class_),
|
||||
methodOffset(t, method));
|
||||
}
|
||||
|
||||
inline unsigned
|
||||
objectArrayLength(Thread* t UNUSED, object array)
|
||||
{
|
||||
|
@ -125,13 +125,6 @@ isSpecialMethod(Thread* t, object method, object 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*
|
||||
resolveNativeMethod2(Thread* t, object method);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user