Re: Issue 2559 in pharo: Senders of #ifNotNil: do not show

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Issue 2559 in pharo: Senders of #ifNotNil: do not show

pharo

Comment #7 on issue 2559 by [hidden email]: Senders of #ifNotNil: do not  
show
http://code.google.com/p/pharo/issues/detail?id=2559

FWIW, this looks like a good solution for the standard Compiler though :)


Reply | Threaded
Open this post in threaded view
|

Re: Issue 2559 in pharo: Senders of #ifNotNil: do not show

pharo

Comment #8 on issue 2559 by [hidden email]: Senders of #ifNotNil: do  
not show
http://code.google.com/p/pharo/issues/detail?id=2559

Name:  
SLICE-Issue-2559-SpecialMessages-browseThem-cascadeThem-overrideThem-nice.1
Dependencies: Compiler-nice.279

Let special selectors be a bit less special.
Special selectors are inlined by the compiler if receiver and arguments  
follow certain rules (like being a block with prescribed number of  
arguments)..
Inlining is very important for speeding up execution but there was a price  
to pay:

1) Until now,  in case the rules are not followed, Compiler would sometimes  
send the message as an ordinary one, and would sometimes refuse to compile  
(though I already relaxed the rules a lot in the past few years).
2) Also you could not browse reference to them because they were inlined  
and had no marker in CompiledMethod.
3) And Compiler would refuse to cascade them because inlining was harder to  
implement in such case.

Now, you can.
1) not respect the rules (in this case the message will always be sent)
2) browse references (there is literal added to the compiled code)
3) cascade (in a cascade, no message is inlined)

While at it I removed the odd rules for compiling caseOf: and that  
simplifies Compiler.

There is no support yet to prevent inlining, and thus to enable true  
overriding
(if receiver/arguments respect the rules, message won't be sent but still  
inlined with a hardcoded implementation).
However, you can hack by using any other argument but a Block:

(2>1) ifTrue: ['print me'] yourself.

This way you could activate your own override of ifTrue:

Also you can write this if you feel like:

(2>1)
        ifTrue: [2 inspect];
        and: [2 odd].

Of course, from pragmatic point of view, you won't probably need this stuff.
But if we can avoid useless sacrifices, let's avoid.


Reply | Threaded
Open this post in threaded view
|

Re: Issue 2559 in pharo: Senders of #ifNotNil: do not show

pharo
Updates:
        Status: FixProposed

Comment #9 on issue 2559 by [hidden email]: Senders of #ifNotNil: do  
not show
http://code.google.com/p/pharo/issues/detail?id=2559

I forgot to say, recompileAll is required so as to be able to browse  
special senders



Reply | Threaded
Open this post in threaded view
|

Re: Issue 2559 in pharo: Senders of #ifNotNil: do not show

pharo

Comment #10 on issue 2559 by [hidden email]: Senders of #ifNotNil:  
do not show
http://code.google.com/p/pharo/issues/detail?id=2559

Name:  
SLICE-Issue-2559-SpecialMessages-browseThem-cascadeThem-overrideThem-nice.2
Dependencies: Compiler-nice.280

Don't forget to deoptimize the receiver in case of cascade.
Add a missing ivar to BlockNode.


Reply | Threaded
Open this post in threaded view
|

Re: Issue 2559 in pharo: Senders of #ifNotNil: do not show

pharo

Comment #11 on issue 2559 by [hidden email]: Senders of #ifNotNil:  
do not show
http://code.google.com/p/pharo/issues/detail?id=2559

The interesting thing is that it it just takes 200Kb more space. I can live  
with that!

(I took a version with, one without. Recompiled, did a #releaseclean in  
both and the difference is

14802344 vs. 15007540 for saved images of the same window size.

One problem that I see is that we need to change the metric of Cog when not  
to JIT. Right now it does not JIT when the method is too large, and  
that "too large" is defined as having more than X literals (60, I think).


Reply | Threaded
Open this post in threaded view
|

Re: Issue 2559 in pharo: Senders of #ifNotNil: do not show

pharo

Comment #12 on issue 2559 by [hidden email]: Senders of #ifNotNil:  
do not show
http://code.google.com/p/pharo/issues/detail?id=2559

Issue 3940 has been merged into this issue.


Reply | Threaded
Open this post in threaded view
|

Re: Issue 2559 in pharo: Senders of #ifNotNil: do not show

pharo
Updates:
        Status: Closed

Comment #13 on issue 2559 by [hidden email]: Senders of #ifNotNil:  
do not show
http://code.google.com/p/pharo/issues/detail?id=2559

in 13138