gforth
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gforth] A little do-nothing in recognizer.fs: get-stack


From: Anton Ertl
Subject: Re: [gforth] A little do-nothing in recognizer.fs: get-stack
Date: Tue, 2 Feb 2016 18:59:30 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

On Mon, Feb 01, 2016 at 02:38:03AM -0500, James Gere wrote:
>      Now perplexed.  "see get-stack" gives:
> 
> :   get-stack
>      noop   swap   @   noop   >r  cells   bounds   swap
>      ?do     i   @   noop   <cell>
>      -loop
>      r>   ;
> 
> .  recognizer.fs source gives:
> 
> : get-stack ( rec-addr -- xt1 .. xtn n )
>     dup swap @ dup >r cells bounds swap ?DO
> I @
>     cell -LOOP  r> ;
> 
> .  I realize "see" can't always keep up with "c,"  and recognize
> that the cached tos needn't be dup'ed, but where does the last noop come
> from?  (They all optimize out.)

The decompiler is currently not so great when dealing with the code
produced by gforth-fast, and lots of code is decompiled as noop, even
though it is not a noop; e.g., the last "noop" is really a "lit@".  I
guess I should do something about this.

>      Is the "nonce" swap,  in the source, there to trigger this behavior,
> or just
> an oversight?

My guess is that it is just an oversight, but I did not write it.

- anton



reply via email to

[Prev in Thread] Current Thread [Next in Thread]