mirror of
https://github.com/corda/corda.git
synced 2025-01-21 03:55:00 +00:00
use ir::Type in Compiler::return_
This commit is contained in:
parent
587b1e3eda
commit
d9fee1025c
@ -106,7 +106,8 @@ class Compiler {
|
|||||||
OperandType resultType,
|
OperandType resultType,
|
||||||
unsigned argumentFootprint) = 0;
|
unsigned argumentFootprint) = 0;
|
||||||
|
|
||||||
virtual void return_(unsigned size, Operand* value) = 0;
|
virtual void return_(ir::Type type, Operand* value) = 0;
|
||||||
|
virtual void return_() = 0;
|
||||||
|
|
||||||
virtual void initLocal(unsigned size, unsigned index, OperandType type) = 0;
|
virtual void initLocal(unsigned size, unsigned index, OperandType type) = 0;
|
||||||
virtual void initLocalsFromLogicalIp(unsigned logicalIp) = 0;
|
virtual void initLocalsFromLogicalIp(unsigned logicalIp) = 0;
|
||||||
|
@ -2478,8 +2478,17 @@ class MyCompiler: public Compiler {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void return_(unsigned size, Operand* value) {
|
virtual void return_(ir::Type type, Operand* value)
|
||||||
appendReturn(&c, size, static_cast<Value*>(value));
|
{
|
||||||
|
// TODO: once type information is flowed properly, enable this assert.
|
||||||
|
// Some time later, we can remove the parameter.
|
||||||
|
// assert(&c, static_cast<Value*>(value)->type == type);
|
||||||
|
appendReturn(&c, type.size(), static_cast<Value*>(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void return_()
|
||||||
|
{
|
||||||
|
appendReturn(&c, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void initLocal(unsigned footprint, unsigned index, OperandType type)
|
virtual void initLocal(unsigned footprint, unsigned index, OperandType type)
|
||||||
@ -2498,7 +2507,7 @@ class MyCompiler: public Compiler {
|
|||||||
lowIndex = index;
|
lowIndex = index;
|
||||||
} else {
|
} else {
|
||||||
lowIndex = index + 1;
|
lowIndex = index + 1;
|
||||||
highIndex = index;
|
highIndex = index;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TargetBytesPerWord == 4) {
|
if (TargetBytesPerWord == 4) {
|
||||||
|
@ -4290,7 +4290,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
|||||||
|
|
||||||
case areturn: {
|
case areturn: {
|
||||||
handleExit(t, frame);
|
handleExit(t, frame);
|
||||||
c->return_(TargetBytesPerWord, frame->popObject());
|
c->return_(types.address, frame->popObject());
|
||||||
} goto next;
|
} goto next;
|
||||||
|
|
||||||
case arraylength: {
|
case arraylength: {
|
||||||
@ -5179,10 +5179,15 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
|||||||
frame->pushInt(c->binaryOp(lir::Remainder, 4, a, b));
|
frame->pushInt(c->binaryOp(lir::Remainder, 4, a, b));
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case ireturn:
|
case ireturn: {
|
||||||
|
handleExit(t, frame);
|
||||||
|
c->return_(types.i4, frame->popInt());
|
||||||
|
}
|
||||||
|
goto next;
|
||||||
|
|
||||||
case freturn: {
|
case freturn: {
|
||||||
handleExit(t, frame);
|
handleExit(t, frame);
|
||||||
c->return_(4, frame->popInt());
|
c->return_(types.f4, frame->popInt());
|
||||||
} goto next;
|
} goto next;
|
||||||
|
|
||||||
case istore:
|
case istore:
|
||||||
@ -5472,10 +5477,15 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
|||||||
frame->pushLong(c->binaryOp(lir::Remainder, 8, a, b));
|
frame->pushLong(c->binaryOp(lir::Remainder, 8, a, b));
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case lreturn:
|
case lreturn: {
|
||||||
|
handleExit(t, frame);
|
||||||
|
c->return_(types.i8, frame->popLong());
|
||||||
|
}
|
||||||
|
goto next;
|
||||||
|
|
||||||
case dreturn: {
|
case dreturn: {
|
||||||
handleExit(t, frame);
|
handleExit(t, frame);
|
||||||
c->return_(8, frame->popLong());
|
c->return_(types.f8, frame->popLong());
|
||||||
} goto next;
|
} goto next;
|
||||||
|
|
||||||
case lshl:
|
case lshl:
|
||||||
@ -5887,7 +5897,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleExit(t, frame);
|
handleExit(t, frame);
|
||||||
c->return_(0, 0);
|
c->return_();
|
||||||
goto next;
|
goto next;
|
||||||
|
|
||||||
case sipush:
|
case sipush:
|
||||||
|
Loading…
Reference in New Issue
Block a user