harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "chunrong lai" <chunrong...@gmail.com>
Subject Re: Enable the MACRO _DEBUG_CHECK_NULL_
Date Wed, 12 Nov 2008 14:48:43 GMT
hi, Buqi:
     I am not very convinced to add some MonitorEnter specific code in
IRBuilder Code. Why only MonitorEnter is impacted here?

    We can see that the NPE is from the removal of two checknull operations.
    If we target to the inproper removal of the first checknull from JIT.
The modification or the optimization rule should be MonitorEnter
independent. So I do not see MonitorEnter related issue in Mikhail's
    If we target to the removal of the second checknull in the stub/helper.
The modification is MonitorEnter dependent. It is clear that the removal is
due to r659128 who changed the helpers. (It is a little strange to only
change the IRBuilder::genMonitorEnter, with the knowledge of no null
checking code in the stub/helpers).

   I myself am a little confused about the hardware exception check. What is
the background, expected behavior and triggering condition? (Mikhail only
mentioned that the optimization happens only if some conditions, does it
always heppen if so?) Maybe we can just give up the hardware exception
On Wed, Nov 12, 2008 at 10:20 PM, bu qi cheng <buqi.cheng@gmail.com> wrote:

> 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

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