Hi Yoshiki,

On Thu, Apr 12, 2012 at 4:27 PM, Yoshiki Ohshima <Yoshiki.Ohshima@acm.org> wrote:
At Thu, 12 Apr 2012 16:08:53 -0700,
Eliot Miranda wrote:
>
> Hi Yoshiki,
>
>     what's the image you're using, or at least what is it derived from?  Also, what's the result of (OMeta2 >> #token) symbolic ?

The image is one started from "Squeak4.3alpha-11481" and updated by
pressing the "update code from server" button.  The result of
#symbolic is like this:

37 <71> pushConstant: true
38 <AC 0F> jumpFalse: 55
40 <70> self
41 <21> pushConstant: #anything
42 <E0> send: apply:
43 <68> popIntoTemp: 0
44 <70> self
45 <22> pushConstant: #spaces
46 <E0> send: apply:
47 <87> pop
48 <70> self
49 <24> pushConstant: #seq
50 <10> pushTemp: 0
51 <8A 81> pop 1 into (Array new: 1)
53 <F3> send: apply:withArgs:
54 <90> jumpTo: 56
55 <73> pushConstant: nil
56 <7C> returnTop

-- Yoshiki

I can't reproduce this.  When I debug the following doit (which mimics your code) and inspect the context  I get a valid decompilation:

| t |
       ^ true
               ifTrue: [t := self apply: #anything.
                       self apply: #spaces.
                       self apply: #seq withArgs: {t}]

the same code:

method symbolic
'37 <71> pushConstant: true
38 <AC 0F> jumpFalse: 55
40 <70> self
41 <21> pushConstant: #anything
42 <E0> send: apply:
43 <68> popIntoTemp: 0
44 <70> self
45 <22> pushConstant: #spaces
46 <E0> send: apply:
47 <87> pop
48 <70> self
49 <24> pushConstant: #seq
50 <10> pushTemp: 0
51 <8A 81> pop 1 into (Array new: 1)
53 <F3> send: apply:withArgs:
54 <90> jumpTo: 56
55 <73> pushConstant: nil
56 <7C> returnTop
'

and decompileWithTemps returns something correct:

method decompileWithTemps
DoIt
| t |
^ true
ifTrue: [t := self apply: #anything.
self apply: #spaces.
self apply: #seq withArgs: {t}] 

So has OMeta patched some old bug in the decompiler which is now obsoleted by some other fix?



>
> On Thu, Apr 12, 2012 at 3:09 PM, Yoshiki Ohshima <Yoshiki.Ohshima@acm.org> wrote:
>
>     I noticed that when I debug grammar written in OMeta2/Squeak, there is
>     a problem with some particular methods.  For example, I load
>     OMeta2-preload and -postload, and do:
>
>                   (OMeta2 compiledMethodAt: #token) decompileWithTemps
>
>     I get something like:
>     ------------------------------------
>      token
>            | t |
>            ^ true
>                    ifTrue: [_r1 := self apply: #anything.
>                            self apply: #spaces.
>                            self apply: #seq withArgs: {_r1}]
>     ------------------------------------
>     Debugger uses this to obtain the source code and then it trys to parse
>     it to get the source map. But "_r1" is not a valid variable name so
>     this process fails.
>
>     It appears that the underscore is originated from the method:
>     ------------------------------------
>     codeRemoteTemp: index remoteTemps: tempVector
>
>            ^(RemoteTempVectorNode new
>                    name: '_r', index printString
>                    index: index
>                    type: LdTempType
>                    scope: 0)
>                            remoteTemps: tempVector;
>                            yourself
>     ------------------------------------
>     But I cannot tell why it is "leaking out" to the final result.  Does
>     anybody know what is going on?
>
>     -- Yoshiki
>
> --
> best,
> Eliot
>
>
> [2  <text/plain; us-ascii (7bit)>]
>




--
best,
Eliot