harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "bu qi cheng" <buqi.ch...@gmail.com>
Subject Re: Enable the MACRO _DEBUG_CHECK_NULL_
Date Wed, 12 Nov 2008 14:20:33 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message