harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Okonechnikov Konstantin" <okko73...@gmail.com>
Subject Re: [general] GSoC 2008 Refactor Java Bytecode Translator
Date Mon, 31 Mar 2008 16:36:38 GMT
On 31 Mar 2008 16:52:41 +0400, Egor Pasko <egor.pasko@gmail.com> wrote:
>
> On the 0x417 day of Apache Harmony Okonechnikov Konstantin wrote:
> > In addition to previous letter:
> > - I removed DoSimplify flag from IrBuilderFlags and all code connected
> to it
> > , but didn't removed simplifier yet.
> > First reason is that,there are some problems with removing
> simplification
> > from
> >      IRBuilder::genTauCheckNull(Opnd* opnd, bool &alwaysThrows)
> >      IRBuilder::genTauCheckZero(Opnd* opnd, bool &alwaysThrows)
> >      IRBuilder::simplifyTauCheckDivOpnds(Opnd* src1, Opnd* src2, bool
> > &alwaysThrows)
>
>
> what is with these methods?
>
>
> > Well, I figured out that simply removing simplification here doesn't
> work
> > :)
>
>
> what happens? :)


It looks like some dark magic or maybe late night hours
:), now everyting seems to be OK, I removed
simplification. Nevertheless, I beware of nasty warning inside
IRBuilder::genTauCheckNull(...):
...
// Not advisable to turn off simplification of checknull because
// IRBuilder calls genTauCheckNull redundantly many times

// ...then it does simplify without asking the flag
...

I am working now on removing propgate copy and SCE. Testing on HelloWorld.
If there were such code:

    Opnd* IRBuilder::genAdd(Type* dstType, Modifier mod, Opnd* src1, Opnd*
src2) {
        src1 = propagateCopy(src1);
        src2 = propagateCopy(src2);
        Operation operation(Op_Add, dstType->tag, mod);
        uint32 hashcode = operation.encodeForHashing();
        Opnd* dst = lookupHash(hashcode, src1, src2);
        if (dst) return dst;
        if (!dst) {
             dst = createOpnd(dstType);
             Inst *newi = instFactory->makeAdd(mod, dst, src1, src2);
             appendInst(newi);
        }
        insertHash(hashcode, src1, src2, dst->getInst());
        return dst;
     }

It becomes like this:

Opnd* IRBuilder::genAdd(Type* dstType, Modifier mod, Opnd* src1, Opnd* src2)
{
        Operation operation(Op_Add, dstType->tag, mod);
        Opnd* dst = createOpnd(dstType);
        Inst *newi = instFactory->makeAdd(mod, dst, src1, src2);
        appendInst(newi);
        return dst;
     }

Is everything OK?

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