mirror of
https://github.com/corda/corda.git
synced 2025-01-23 04:48:09 +00:00
remove redundant Compiler::stackCall footprint argument
This commit is contained in:
parent
3c9a453d17
commit
69edeaadee
@ -92,7 +92,6 @@ class Compiler {
|
|||||||
unsigned flags,
|
unsigned flags,
|
||||||
TraceHandler* traceHandler,
|
TraceHandler* traceHandler,
|
||||||
ir::Type resultType,
|
ir::Type resultType,
|
||||||
unsigned argumentFootprint,
|
|
||||||
util::Slice<ir::Value*> arguments) = 0;
|
util::Slice<ir::Value*> arguments) = 0;
|
||||||
|
|
||||||
virtual void return_(ir::Type type, ir::Value* value) = 0;
|
virtual void return_(ir::Type type, ir::Value* value) = 0;
|
||||||
|
@ -2497,7 +2497,6 @@ class MyCompiler: public Compiler {
|
|||||||
resultType.size(),
|
resultType.size(),
|
||||||
argumentStack,
|
argumentStack,
|
||||||
index,
|
index,
|
||||||
0,
|
|
||||||
util::Slice<ir::Value*>(0, 0));
|
util::Slice<ir::Value*>(0, 0));
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -2507,7 +2506,6 @@ class MyCompiler: public Compiler {
|
|||||||
unsigned flags,
|
unsigned flags,
|
||||||
TraceHandler* traceHandler,
|
TraceHandler* traceHandler,
|
||||||
ir::Type resultType,
|
ir::Type resultType,
|
||||||
unsigned argumentFootprint,
|
|
||||||
Slice<ir::Value*> arguments)
|
Slice<ir::Value*> arguments)
|
||||||
{
|
{
|
||||||
Value* result = value(&c, resultType);
|
Value* result = value(&c, resultType);
|
||||||
@ -2519,7 +2517,6 @@ class MyCompiler: public Compiler {
|
|||||||
resultType.size(),
|
resultType.size(),
|
||||||
c.stack,
|
c.stack,
|
||||||
0,
|
0,
|
||||||
argumentFootprint,
|
|
||||||
arguments);
|
arguments);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -195,8 +195,7 @@ class CallEvent: public Event {
|
|||||||
unsigned resultSize,
|
unsigned resultSize,
|
||||||
Stack* argumentStack,
|
Stack* argumentStack,
|
||||||
unsigned argumentCount,
|
unsigned argumentCount,
|
||||||
unsigned stackArgumentFootprint,
|
util::Slice<ir::Value*> arguments)
|
||||||
util::Slice<ir::Value*> arguments UNUSED)
|
|
||||||
: Event(c),
|
: Event(c),
|
||||||
address(address),
|
address(address),
|
||||||
traceHandler(traceHandler),
|
traceHandler(traceHandler),
|
||||||
@ -207,13 +206,13 @@ class CallEvent: public Event {
|
|||||||
stackArgumentIndex(0),
|
stackArgumentIndex(0),
|
||||||
flags(flags),
|
flags(flags),
|
||||||
resultSize(resultSize),
|
resultSize(resultSize),
|
||||||
stackArgumentFootprint(stackArgumentFootprint)
|
stackArgumentFootprint(arguments.count)
|
||||||
{
|
{
|
||||||
uint32_t registerMask = c->regFile->generalRegisters.mask;
|
uint32_t registerMask = c->regFile->generalRegisters.mask;
|
||||||
|
|
||||||
if (argumentCount) {
|
if (argumentCount) {
|
||||||
assert(c, (flags & Compiler::TailJump) == 0);
|
assert(c, (flags & Compiler::TailJump) == 0);
|
||||||
assert(c, stackArgumentFootprint == 0);
|
assert(c, arguments.count == 0);
|
||||||
|
|
||||||
Stack* s = argumentStack;
|
Stack* s = argumentStack;
|
||||||
unsigned index = 0;
|
unsigned index = 0;
|
||||||
@ -286,32 +285,24 @@ class CallEvent: public Event {
|
|||||||
Stack* stack = stackBefore;
|
Stack* stack = stackBefore;
|
||||||
|
|
||||||
if (stackArgumentFootprint) {
|
if (stackArgumentFootprint) {
|
||||||
RUNTIME_ARRAY(Value*, argsArr, stackArgumentFootprint);
|
|
||||||
for (int i = stackArgumentFootprint - 1; i >= 0; --i) {
|
for (int i = stackArgumentFootprint - 1; i >= 0; --i) {
|
||||||
Value* v = static_cast<Value*>(arguments[i]);
|
Value* v = static_cast<Value*>(arguments[i]);
|
||||||
stack = stack->next;
|
stack = stack->next;
|
||||||
|
|
||||||
if ((vm::TargetBytesPerWord
|
if ((vm::TargetBytesPerWord == 8
|
||||||
== 8 and(v == 0 or(i >= 1 and arguments[i - 1] == 0)))
|
&& (v == 0 || (i >= 1 && arguments[i - 1] == 0)))
|
||||||
or(vm::TargetBytesPerWord == 4 and v->nextWord != v)) {
|
|| (vm::TargetBytesPerWord == 4 && v->nextWord != v)) {
|
||||||
assert(
|
assert(
|
||||||
c,
|
c,
|
||||||
vm::TargetBytesPerWord == 8 or v->nextWord == arguments[i - 1]);
|
vm::TargetBytesPerWord == 8 or v->nextWord == arguments[i - 1]);
|
||||||
|
|
||||||
Value* v2 = static_cast<Value*>(arguments[i - 1]);
|
|
||||||
RUNTIME_ARRAY_BODY(argsArr)[i] = v2;
|
|
||||||
arguments[i] = arguments[i - 1];
|
arguments[i] = arguments[i - 1];
|
||||||
--i;
|
--i;
|
||||||
stack = stack->next;
|
stack = stack->next;
|
||||||
}
|
}
|
||||||
RUNTIME_ARRAY_BODY(argsArr)[i] = v;
|
|
||||||
arguments[i] = v;
|
arguments[i] = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (size_t i = 0; i < arguments.count; i++) {
|
|
||||||
assert(c, arguments[i] == RUNTIME_ARRAY_BODY(argsArr)[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
int returnAddressIndex;
|
int returnAddressIndex;
|
||||||
int framePointerIndex;
|
int framePointerIndex;
|
||||||
int frameOffset;
|
int frameOffset;
|
||||||
@ -336,7 +327,7 @@ class CallEvent: public Event {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (unsigned i = 0; i < stackArgumentFootprint; ++i) {
|
for (unsigned i = 0; i < stackArgumentFootprint; ++i) {
|
||||||
Value* v = RUNTIME_ARRAY_BODY(argsArr)[i];
|
Value* v = static_cast<Value*>(arguments[i]);
|
||||||
if (v) {
|
if (v) {
|
||||||
int frameIndex = i + frameOffset;
|
int frameIndex = i + frameOffset;
|
||||||
|
|
||||||
@ -516,7 +507,6 @@ void appendCall(Context* c,
|
|||||||
unsigned resultSize,
|
unsigned resultSize,
|
||||||
Stack* argumentStack,
|
Stack* argumentStack,
|
||||||
unsigned argumentCount,
|
unsigned argumentCount,
|
||||||
unsigned stackArgumentFootprint,
|
|
||||||
util::Slice<ir::Value*> arguments)
|
util::Slice<ir::Value*> arguments)
|
||||||
{
|
{
|
||||||
append(c,
|
append(c,
|
||||||
@ -528,7 +518,6 @@ void appendCall(Context* c,
|
|||||||
resultSize,
|
resultSize,
|
||||||
argumentStack,
|
argumentStack,
|
||||||
argumentCount,
|
argumentCount,
|
||||||
stackArgumentFootprint,
|
|
||||||
arguments));
|
arguments));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -971,7 +960,6 @@ appendCombine(Context* c, lir::TernaryOperation type,
|
|||||||
resultSize,
|
resultSize,
|
||||||
argumentStack,
|
argumentStack,
|
||||||
stackSize,
|
stackSize,
|
||||||
0,
|
|
||||||
util::Slice<ir::Value*>(0, 0));
|
util::Slice<ir::Value*>(0, 0));
|
||||||
} else {
|
} else {
|
||||||
append
|
append
|
||||||
@ -1095,7 +1083,6 @@ appendTranslate(Context* c, lir::BinaryOperation type, unsigned firstSize,
|
|||||||
resultSize,
|
resultSize,
|
||||||
argumentStack,
|
argumentStack,
|
||||||
ceilingDivide(firstSize, vm::TargetBytesPerWord),
|
ceilingDivide(firstSize, vm::TargetBytesPerWord),
|
||||||
0,
|
|
||||||
util::Slice<ir::Value*>(0, 0));
|
util::Slice<ir::Value*>(0, 0));
|
||||||
} else {
|
} else {
|
||||||
append(c, new(c->zone)
|
append(c, new(c->zone)
|
||||||
@ -1461,7 +1448,6 @@ appendBranch(Context* c, lir::TernaryOperation type, unsigned size, Value* first
|
|||||||
4,
|
4,
|
||||||
argumentStack,
|
argumentStack,
|
||||||
ceilingDivide(size, vm::TargetBytesPerWord) * 2,
|
ceilingDivide(size, vm::TargetBytesPerWord) * 2,
|
||||||
0,
|
|
||||||
util::Slice<ir::Value*>(0, 0));
|
util::Slice<ir::Value*>(0, 0));
|
||||||
|
|
||||||
appendBranch(c,
|
appendBranch(c,
|
||||||
|
@ -121,7 +121,6 @@ void appendCall(Context* c,
|
|||||||
unsigned resultSize,
|
unsigned resultSize,
|
||||||
Stack* argumentStack,
|
Stack* argumentStack,
|
||||||
unsigned argumentCount,
|
unsigned argumentCount,
|
||||||
unsigned stackArgumentFootprint,
|
|
||||||
util::Slice<ir::Value*> arguments);
|
util::Slice<ir::Value*> arguments);
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -2055,7 +2055,6 @@ class Frame {
|
|||||||
flags,
|
flags,
|
||||||
trace,
|
trace,
|
||||||
operandTypeForFieldCode(t, returnCode),
|
operandTypeForFieldCode(t, returnCode),
|
||||||
footprint,
|
|
||||||
peekMethodArguments(footprint));
|
peekMethodArguments(footprint));
|
||||||
|
|
||||||
pop(footprint);
|
pop(footprint);
|
||||||
@ -2078,7 +2077,6 @@ class Frame {
|
|||||||
flags,
|
flags,
|
||||||
trace,
|
trace,
|
||||||
operandTypeForFieldCode(t, returnCode),
|
operandTypeForFieldCode(t, returnCode),
|
||||||
footprint,
|
|
||||||
peekMethodArguments(footprint));
|
peekMethodArguments(footprint));
|
||||||
|
|
||||||
pop(footprint);
|
pop(footprint);
|
||||||
@ -5109,7 +5107,6 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
|||||||
tailCall ? Compiler::TailJump : 0,
|
tailCall ? Compiler::TailJump : 0,
|
||||||
frame->trace(0, 0),
|
frame->trace(0, 0),
|
||||||
operandTypeForFieldCode(t, returnCode),
|
operandTypeForFieldCode(t, returnCode),
|
||||||
parameterFootprint,
|
|
||||||
frame->peekMethodArguments(parameterFootprint));
|
frame->peekMethodArguments(parameterFootprint));
|
||||||
|
|
||||||
frame->pop(parameterFootprint);
|
frame->pop(parameterFootprint);
|
||||||
|
Loading…
Reference in New Issue
Block a user