ZipPy status update

Stefan Marr java at stefan-marr.de
Sat Dec 21 04:16:08 PST 2013


Hi Chris:

On 21 Dec 2013, at 12:59, Chris Seaton <chris at chrisseaton.com> wrote:

> I avoid materialising the frame where I know no local variables from the declaring scope are used, but apart from that I haven't been worrying about the performance impact yet. Your idea of making your own explicit up-values sounds interesting, but I wonder if that's working around Truffle rather than working with it. You will miss out on any performance improvements to MaterializedFrame in the future, and you’ll have more complex code.

I guess, I can revert it then and add materializing on demand instead. But, that’s not going to fix my performance problems. Which are, from what I have seen in SimpleLanguage and ZipPy kind of mysterious.

> In Ruby I also plan to inline all trivial methods immediately - but at the moment I'm only doing it for getters, setters and all core methods. One problem - if you inline straight away how do you stop the number of nodes blowing up beyond the limit?

I actually haven’t inlined getters and setters automatically yet. Just literals and reads of globals. So, there is no node explosion.

> In Ruby I use @ImplicitCast to convert between RubyFixnum and int. There is no difference between these two types - the RubyFixnum version is just so I can have a real object sometimes to simplify some other code. This tells the DSL whenever you see a RubyFixnum, feel free to convert it to an int to make things work.
> 
>     @ImplicitCast
>     public int unboxFixnum(RubyFixnum value) {
>         return value.getValue();
>     }

That’s exactly what I am doing in TruffleSOM:

  @ImplicitCast
  public int castInteger(final SInteger i) {
    return i.getEmbeddedInteger();
  }

  @ImplicitCast
  public BigInteger castBigInteger(final SBigInteger i) {
    return i.getEmbeddedBiginteger();
  }

  @ImplicitCast
  public String castString(final SString str) {
    return str.getEmbeddedString();
  }

  @ImplicitCast
  public double castDouble(final SDouble d) {
    return d.getEmbeddedDouble();
  }

Best regards
Stefan

-- 
Stefan Marr
Software Languages Lab
Vrije Universiteit Brussel
Pleinlaan 2 / B-1050 Brussels / Belgium
http://soft.vub.ac.be/~smarr
Phone: +32 2 629 2974
Fax:   +32 2 629 3525



More information about the graal-dev mailing list