Hi Mikhail:
One question is that if Harmony did NULL Pointer Check Elimination? I
am not sure if 1) is done.
For this problem caused by 2). A patch is like following:
IRBuilder.cpp
void
IRBuilder::genMonitorEnter(Opnd* src) {
src = propagateCopy(src);
Opnd *tauNullChecked = genTauCheckNull(src);
* Inst* inst = tauNullChecked->getInst(); //Added*
* if (inst->getOpcode() == Op_TauCheckNull) //Added*
* inst->setDefArgModifier(NonNullThisArg); //Added*
appendInst(instFactory->makeTauMonitorEnter(src, tauNullChecked));
}
By set the modifier of TauCheckNull instruction before the MonitorEnter
instruction. If the "chknull" is not optimized by 1). HARMONY will always
generate the LIR check code for it.
With this way, there is no need to generate two version helper code for
monitorEnter.
Please double check if it's right.
Thanks!
Buqi