mirror of
https://github.com/corda/corda.git
synced 2025-01-08 14:03:06 +00:00
don't bother calling methods which are known do nothing
This commit is contained in:
parent
9a0143594a
commit
11dea0ad8e
@ -1436,6 +1436,13 @@ resultSize(MyThread* t, unsigned code)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
emptyMethod(MyThread* t, object method)
|
||||||
|
{
|
||||||
|
object code = methodCode(t, method);
|
||||||
|
return (codeLength(t, code) == 1 and codeBody(t, code, 0) == return_);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
compileDirectInvoke(MyThread* t, Frame* frame, object target)
|
compileDirectInvoke(MyThread* t, Frame* frame, object target)
|
||||||
{
|
{
|
||||||
@ -1443,15 +1450,19 @@ compileDirectInvoke(MyThread* t, Frame* frame, object target)
|
|||||||
|
|
||||||
unsigned rSize = resultSize(t, methodReturnCode(t, target));
|
unsigned rSize = resultSize(t, methodReturnCode(t, target));
|
||||||
|
|
||||||
Compiler::Operand* result = c->call
|
Compiler::Operand* result = 0;
|
||||||
(c->constant
|
|
||||||
(reinterpret_cast<intptr_t>
|
if (not emptyMethod(t, target)) {
|
||||||
(&singletonBody(t, methodCompiled(t, target), 0))),
|
result = c->call
|
||||||
0,
|
(c->constant
|
||||||
Compiler::Aligned,
|
(reinterpret_cast<intptr_t>
|
||||||
frame->trace(target, false),
|
(&singletonBody(t, methodCompiled(t, target), 0))),
|
||||||
rSize,
|
0,
|
||||||
0);
|
Compiler::Aligned,
|
||||||
|
frame->trace(target, false),
|
||||||
|
rSize,
|
||||||
|
0);
|
||||||
|
}
|
||||||
|
|
||||||
c->popped(methodParameterFootprint(t, target));
|
c->popped(methodParameterFootprint(t, target));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user