Deoptimized calls fail in Cog (was Re: [squeak-dev] The Trunk: Compiler-nice.189.mcz)

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Wed Mar 2 23:12:59 UTC 2011


Oops, I always forget to select changes before filing out...

Nicolas

2011/3/3 Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>:
> Then attached proof of concept may work.
>
> Nicolas
>
> 2011/3/3 Eliot Miranda <eliot.miranda at gmail.com>:
>>
>>
>> On Wed, Mar 2, 2011 at 3:02 PM, Nicolas Cellier
>> <nicolas.cellier.aka.nice at gmail.com> wrote:
>>>
>>> One dumb way would be to retain a copy of
>>> originalSelector & originalArguments in MethodNode ivar at creation,
>>> then let #ensureCanCascade: restore the originals.
>>
>> I like this.  Not at all dumb.
>>
>>>
>>> Nicolas
>>>
>>> 2011/3/2 Eliot Miranda <eliot.miranda at gmail.com>:
>>> >
>>> >
>>> > On Wed, Mar 2, 2011 at 1:52 PM, Juan Vuletich <juan at jvuletich.org>
>>> > wrote:
>>> >>
>>> >> Hi Eliot,
>>> >>
>>> >> Thanks for caring!
>>> >>
>>> >> The attached code fixed the case I reported first, but not this:
>>> >>
>>> >> true ifTrue: [ 'was true' print ]; ifFalse: [ 'not true' print ]
>>> >
>>> > Does the second one have to be unoptimized?  I guess that in this both
>>> > are
>>> > deoptimized right?
>>> >
>>> > true ifTrue: [ 'was true' print ]; ifFalse: [ 'not true' print ];
>>> > yourself
>>> >>
>>> >> Thanks,
>>> >> Juan Vuletich
>>> >>
>>> >> Eliot Miranda wrote:
>>> >>>
>>> >>> Hi Juan,
>>> >>>
>>> >>>     I think the deoptimize-after-the-fact approach has no hope of
>>> >>> working
>>> >>> given the transformations for ifFalse:ifTrue: (swap arguments and
>>> >>> transform
>>> >>> to ifTrue:ifFalse:), ifNil:ifNotNil: et al.  Better is to avoid
>>> >>> transforming
>>> >>> at all if in a cascade.  So the attached is a start.  It needs
>>> >>> cleaning up,
>>> >>> the older hack (ensureCanCascade:) removing and either all uses of
>>> >>> receiver:selector:arguments:precedence:from:sourceRange: should use
>>> >>> receiver:selector:arguments:precedence:from:sourceRange:canTransform:,
>>> >>> or
>>> >>> implement receiver:selector:arguments:precedence:from:sourceRange in
>>> >>> terms
>>> >>> of
>>> >>> receiver:selector:arguments:precedence:from:sourceRange:canTransform.
>>> >>>  Anyway, test this and see how you get on.
>>> >>>
>>> >>> cheers,
>>> >>> Eliot
>>> >>>
>>> >>> On Wed, Mar 2, 2011 at 11:46 AM, Juan Vuletich <juan at jvuletich.org
>>> >>> <mailto:juan at jvuletich.org>> wrote:
>>> >>>
>>> >>>    Hi Folks,
>>> >>>
>>> >>>    commits at source.squeak.org <mailto:commits at source.squeak.org> wrote:
>>> >>>
>>> >>>        Nicolas Cellier uploaded a new version of Compiler to project
>>> >>>        The Trunk:
>>> >>>        http://source.squeak.org/trunk/Compiler-nice.189.mcz
>>> >>>
>>> >>>        ==================== Summary ====================
>>> >>>
>>> >>>        Name: Compiler-nice.189
>>> >>>        Author: nice
>>> >>>        Time: 13 February 2011, 7:44:38.363 pm
>>> >>>        UUID: 3f6f02cd-1acf-48de-a388-b5ac55e27055
>>> >>>        Ancestors: Compiler-nice.188
>>> >>>
>>> >>>        Enable cascading of special messages by deoptimizing, thanks
>>> >>>        Eliot.
>>> >>>        This is mostly useless, but it removes an arbitrary limitation
>>> >>>        of the language.
>>> >>>
>>> >>>        =============== Diff against Compiler-nice.188 ===============
>>> >>>
>>> >>>    I integrated this nice code in Cuis, and tried:
>>> >>>
>>> >>>    true ifTrue: [ Transcript cr; show: 'was true' ]; yourself
>>> >>>
>>> >>>    I found that this works ok with the interpreter but does nothing
>>> >>>    in Cog. A bug, right?
>>> >>>
>>> >>>    Cheers,
>>> >>>    Juan Vuletich
>>> >>>
>>> >>>
>>> >>>
>>> >>> ------------------------------------------------------------------------
>>> >>>
>>> >>>
>>> >>>
>>> >>>
>>> >>> ------------------------------------------------------------------------
>>> >>>
>>> >>> No virus found in this message.
>>> >>> Checked by AVG - www.avg.com <http://www.avg.com>
>>> >>> Version: 10.0.1204 / Virus Database: 1435/3477 - Release Date:
>>> >>> 03/02/11
>>> >>>
>>> >>
>>> >>
>>> >
>>> >
>>> >
>>> >
>>> >
>>>
>>
>>
>>
>>
>>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CompileSpecialCascade.st
Type: application/octet-stream
Size: 2433 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20110303/201be1d3/CompileSpecialCascade.obj


More information about the Squeak-dev mailing list