[Truffle] Generated type system overrides isObject()/asObject() methods.

Stefan Marr java at stefan-marr.de
Thu Oct 3 01:02:55 PDT 2013


Hi Thomas:

(cc Michael)

On 03 Oct 2013, at 09:04, Thomas Wuerthinger <thomas.wuerthinger at oracle.com> wrote:

> There is one question I have about the determineContext and getSelfFromMaterialized methods. Could the self value be transmitted via an argument? The lookup over the chain of frames seems slow (and forces materialisation), so is there some other way one could pass these values? Could you describe the requirements for this self value in the system?

I guess `self` could be passed as an argument somehow, but I wouldn't know immediately how to get that right.

What's called the context here is the lexical scope of a block/lambda, which is always defined within a particular method of an object.
Thus, `self` is always the object on which the method was invoked, in which the block was defined.

Now `self` is not the only issue here, I think. (I guess you are mostly thinking of getting rid of all materialized blocks.)
The main issue is that nesting blocks happens quite often, and you want to be able to access the lexical scope.

I am not entirely familiar with all the kind of possible techniques to avoid such 'materialization', but there are a couple of approaches in the Smalltalk world, for instance the one described by Eliot Miranda [1]. So, I could imagine that blocks get compiled into different variants depending on whether they actually access `self` or their outer contexts. This could avoid materialization for an interesting number of cases.

Michael, you got some more insight into what might be possible here?

Thanks
Stefan

[1] http://www.esug.org/data/Articles/misc/oopsla99-contexts.pdf

-- 
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