mirror of
https://github.com/corda/corda.git
synced 2025-01-19 11:16:54 +00:00
Remove boilerplate code (nullaryOp methods in Compiler)
This commit is contained in:
parent
bd7b66a898
commit
eab36b3a23
@ -132,17 +132,12 @@ class Compiler {
|
||||
|
||||
virtual Operand* binaryOp(lir::TernaryOperation type, unsigned size, Operand* a, Operand* b) = 0;
|
||||
virtual Operand* unaryOp(lir::BinaryOperation type, unsigned size, Operand* a) = 0;
|
||||
virtual void nullaryOp(lir::Operation type) = 0;
|
||||
|
||||
virtual Operand* f2f(unsigned aSize, unsigned resSize, Operand* a) = 0;
|
||||
virtual Operand* f2i(unsigned aSize, unsigned resSize, Operand* a) = 0;
|
||||
virtual Operand* i2f(unsigned aSize, unsigned resSize, Operand* a) = 0;
|
||||
|
||||
virtual void trap() = 0;
|
||||
|
||||
virtual void loadBarrier() = 0;
|
||||
virtual void storeStoreBarrier() = 0;
|
||||
virtual void storeLoadBarrier() = 0;
|
||||
|
||||
virtual void compile(uintptr_t stackOverflowHandler,
|
||||
unsigned stackLimitOffset) = 0;
|
||||
virtual unsigned resolve(uint8_t* dst) = 0;
|
||||
|
@ -2655,20 +2655,8 @@ class MyCompiler: public Compiler {
|
||||
return result;
|
||||
}
|
||||
|
||||
virtual void trap() {
|
||||
appendOperation(&c, lir::Trap);
|
||||
}
|
||||
|
||||
virtual void loadBarrier() {
|
||||
appendOperation(&c, lir::LoadBarrier);
|
||||
}
|
||||
|
||||
virtual void storeStoreBarrier() {
|
||||
appendOperation(&c, lir::StoreStoreBarrier);
|
||||
}
|
||||
|
||||
virtual void storeLoadBarrier() {
|
||||
appendOperation(&c, lir::StoreLoadBarrier);
|
||||
virtual void nullaryOp(lir::Operation type) {
|
||||
appendOperation(&c, type);
|
||||
}
|
||||
|
||||
virtual void compile(uintptr_t stackOverflowHandler,
|
||||
|
@ -4530,7 +4530,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
||||
2, c->register_(t->arch->thread()), target);
|
||||
|
||||
if (ip == codeLength(t, code)) {
|
||||
c->trap();
|
||||
c->nullaryOp(lir::Trap);
|
||||
}
|
||||
} goto next;
|
||||
|
||||
@ -4926,7 +4926,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
||||
c->register_(t->arch->thread()),
|
||||
frame->append(field));
|
||||
} else {
|
||||
c->loadBarrier();
|
||||
c->nullaryOp(lir::LoadBarrier);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -6057,7 +6057,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
||||
0, frame->trace(0, 0), 0, Compiler::VoidType, 2,
|
||||
c->register_(t->arch->thread()), frame->append(field));
|
||||
} else {
|
||||
c->storeStoreBarrier();
|
||||
c->nullaryOp(lir::StoreStoreBarrier);
|
||||
}
|
||||
}
|
||||
|
||||
@ -6156,7 +6156,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
||||
0, frame->trace(0, 0), 0, Compiler::VoidType, 2,
|
||||
c->register_(t->arch->thread()), frame->append(field));
|
||||
} else {
|
||||
c->storeLoadBarrier();
|
||||
c->nullaryOp(lir::StoreLoadBarrier);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -6254,7 +6254,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
||||
|
||||
case return_:
|
||||
if (needsReturnBarrier(t, context->method)) {
|
||||
c->storeStoreBarrier();
|
||||
c->nullaryOp(lir::StoreStoreBarrier);
|
||||
}
|
||||
|
||||
handleExit(t, frame);
|
||||
|
Loading…
Reference in New Issue
Block a user