Remove boilerplate code (nullaryOp methods in Compiler)

This commit is contained in:
Joshua Warner 2013-12-18 16:51:20 -07:00
parent bd7b66a898
commit eab36b3a23
3 changed files with 8 additions and 25 deletions

View File

@ -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;

View File

@ -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,

View File

@ -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);