public inbox for infinity@sourceware.org
 help / color / mirror / Atom feed
* Language and note format changes coming up
@ 2015-10-28 10:24 Gary Benson
  2015-11-06 16:09 ` Gary Benson
  0 siblings, 1 reply; 2+ messages in thread
From: Gary Benson @ 2015-10-28 10:24 UTC (permalink / raw)
  To: infinity

Hi all,

I don't know if anybody is playing with Infinity yet, but I have some
compatibility-breaking source language and note format changes in the
pipeline.

SOURCE LANGUAGE
===============

 1. Operators with more than one argument (i.e. "name" and "cast"
    will require a comma between their argument.  This is for
    consistency with #3.  (I could make this optional, but pretty
    much all source will need rewriting because of #2 so...)

 2. Externals will no longer be pushed onto the stack at function
    entry.  You will need to use "load" to access them.

 3. As a shortcut, several operators will gain an optional first
    argument which incorporates a "load".  e.g. instead of:

      load some::function
      call

    you may use the shortcut:

      call some::function

    I'll likely add this to the branch operators too, so instead of:

      load NULL
      beq label

    you can do:

      beq NULL, label

    The folded loads are optional (i.e. you can still use the original
    form) and both will generate the same bytecode.

This is all basically because of #2.  Originally it seemed pushing
externals onto the stack at function entry would minimize the
differences between Infinity and "standard" DWARF, but actually it
just means you have more things to keep track of while writing the
notes.  I'd thought this change would result in longer notes (because
of the extra operations to load the constants) but the ones I've
converted are shorter because the extra operations are offset by
not requiring so many stack-shuffling operations.

NOTE FORMAT
===========

 4. The "max_stack" field from the info chunk and the byteorder mark
    field from the code chunk are being moved into a new code info
    chunk with a type_id of 6.

 5. The info chunk now contains only the function's signature.  It's
    being renamed the signature chunk with a type_id of 5.

 6. The code chunk now contains only bytecode and has had its version
    bumped to 2 to indicate this.

Aside from a cleaner structure, this change makes it possible to add
further information about the code.  Previously this would have had
to go in the info chunk or in a new chunk--the code chunk was pretty
much unmodifyable.  But that left the info chunk into a kind of
kitchen sink, full of stuff that should really have been somewhere
else.
    
I8X 0.0.2 will support 0.0.1's note format (with info and v1 code
chunks) but this is deprecated and will be removed (probably just
after 0.0.2 is released but certainly before 1.0.0).

I8X 0.0.2 will push externals onto the entry stack only if the code
chunk in the note is version 1.  This also is deprecated and will
be removed.

Cheers,
Gary

--
http://gbenson.net/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Language and note format changes coming up
  2015-10-28 10:24 Language and note format changes coming up Gary Benson
@ 2015-11-06 16:09 ` Gary Benson
  0 siblings, 0 replies; 2+ messages in thread
From: Gary Benson @ 2015-11-06 16:09 UTC (permalink / raw)
  To: infinity

This is all in https://github.com/gbenson/i8c now.  I'll spend some
time working with it next week and maybe release 0.0.2 if it's all
good.

Gary Benson wrote:
> Hi all,
> 
> I don't know if anybody is playing with Infinity yet, but I have some
> compatibility-breaking source language and note format changes in the
> pipeline.
> 
> SOURCE LANGUAGE
> ===============
> 
>  1. Operators with more than one argument (i.e. "name" and "cast"
>     will require a comma between their argument.  This is for
>     consistency with #3.  (I could make this optional, but pretty
>     much all source will need rewriting because of #2 so...)
> 
>  2. Externals will no longer be pushed onto the stack at function
>     entry.  You will need to use "load" to access them.
> 
>  3. As a shortcut, several operators will gain an optional first
>     argument which incorporates a "load".  e.g. instead of:
> 
>       load some::function
>       call
> 
>     you may use the shortcut:
> 
>       call some::function
> 
>     I'll likely add this to the branch operators too, so instead of:
> 
>       load NULL
>       beq label
> 
>     you can do:
> 
>       beq NULL, label
> 
>     The folded loads are optional (i.e. you can still use the original
>     form) and both will generate the same bytecode.
> 
> This is all basically because of #2.  Originally it seemed pushing
> externals onto the stack at function entry would minimize the
> differences between Infinity and "standard" DWARF, but actually it
> just means you have more things to keep track of while writing the
> notes.  I'd thought this change would result in longer notes (because
> of the extra operations to load the constants) but the ones I've
> converted are shorter because the extra operations are offset by
> not requiring so many stack-shuffling operations.
> 
> NOTE FORMAT
> ===========
> 
>  4. The "max_stack" field from the info chunk and the byteorder mark
>     field from the code chunk are being moved into a new code info
>     chunk with a type_id of 6.
> 
>  5. The info chunk now contains only the function's signature.  It's
>     being renamed the signature chunk with a type_id of 5.
> 
>  6. The code chunk now contains only bytecode and has had its version
>     bumped to 2 to indicate this.
> 
> Aside from a cleaner structure, this change makes it possible to add
> further information about the code.  Previously this would have had
> to go in the info chunk or in a new chunk--the code chunk was pretty
> much unmodifyable.  But that left the info chunk into a kind of
> kitchen sink, full of stuff that should really have been somewhere
> else.
>     
> I8X 0.0.2 will support 0.0.1's note format (with info and v1 code
> chunks) but this is deprecated and will be removed (probably just
> after 0.0.2 is released but certainly before 1.0.0).
> 
> I8X 0.0.2 will push externals onto the entry stack only if the code
> chunk in the note is version 1.  This also is deprecated and will
> be removed.
> 
> Cheers,
> Gary
> 
> --
> http://gbenson.net/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-06 16:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-28 10:24 Language and note format changes coming up Gary Benson
2015-11-06 16:09 ` Gary Benson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).