[Newcompiler] TODO list NewCompiler

Marcus Denker denker at iam.unibe.ch
Wed Aug 2 08:19:20 UTC 2006


On 27.07.2006, at 10:16, Stéphane Ducasse wrote:

>
> what is the diff between a field and an instVar access?

The IRBuilder adds the concept of accessing instVars of objects
other then "self" directly. This is needed for accessing variables
in blocks: e.g. temp Variables in Blocks are not shared with the
method's context, but they live in an "environment" that is independed
of the method context. The bytecode generated now need to access
these variables in the environment object.

For making everything uniform, Anthony decided to just have the concept
of "field access" in IRBuilder, where you push the object whose iVar you
want to access first, then do a pushField: or popField.

If the object is "self", this gets compiled to be a normal push/pop  
InstVar,
when it's another object, it uses messages to access the instVar, as  
there
are no bytecode to to it directly.

When I did the "non Closure" mode for the NewCompiler, I renamed all the
Field related stuff to be "InstVar"... this was a good decicion for  
non-closure
mode and bytesurgeon, but when we want to do both, we need to think a  
bit
harder.

Right now it is impossible to write IRBuilder code that works in both  
closure/
non-closure setting, as when in closure mode we need to do a
	pushSelf;
	pushInstVar: 1

and in non-closure mode it's
	pushInstVar: 1

This needs to be fixed. One idea would be to have *both* the concept of
"Field" and "iVar", so people can use iVar when do non-closure stuff. Or
onother option would be to go back to  have the 'Field' concept only...


     Marcus


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3938 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/newcompiler/attachments/20060802/0b64cf07/smime.bin


More information about the Newcompiler mailing list