[Vm-dev] Igor's fast become for CompiledMethods in Cog

Eliot Miranda eliot.miranda at gmail.com
Tue Jan 31 20:09:49 UTC 2012


On Tue, Jan 31, 2012 at 12:03 PM, Mariano Martinez Peck <
marianopeck at gmail.com> wrote:

>
>
>
> On Tue, Jan 31, 2012 at 8:50 PM, Eliot Miranda <eliot.miranda at gmail.com>wrote:
>
>>
>>
>>
>> On Tue, Jan 31, 2012 at 11:22 AM, Mariano Martinez Peck <
>> marianopeck at gmail.com> wrote:
>>
>>>
>>> Hi Eliot. Me again :)   I was checking the changes Igor did some time
>>> ago for the fast become where he basically swapped the bytes contents
>>> between the objects when they were the same size and same header type. He
>>> put such code in separate primtives and some changes in the image side to
>>> call them. I have just played with them and they seem to work. I have 2
>>> questions for you:
>>>
>>> 1) Do you think that this new fast become can have problems when
>>> becoming CompiledMethods? I am asking because of the JIT/Pic. Maybe I need
>>> a flushCache or something?
>>>
>>
>> Yes, almost certainly.  You'd want to do a flushCache on both methods.
>>
>>
>>> So far, I tried for example the following:
>>>     | methods |
>>>     methods := IdentitySet new.
>>>     (PackageInfo allPackages select: [:each|
>>>         (#( 'AST' 'Autotest' 'AutomaticMethodCategorizer' "'Bogus'
>>> 'CodeStats'  'Gofer' 'Metacello' 'FreeType' 'HelpSystem' 'ProfStef'
>>> 'ScriptManager' 'Zinc' 'Sound' 'Tests' 'ConfigurationOf'
>>> 'ImageForDevelopers' 'LED' 'MemoryMonitor' 'SUnit' 'TrueType' 'Monticello'
>>> 'Network' 'Refactoring' 'Regex' 'ToolBuilder'" ) anySatisfy:  [:aString  |
>>> (each packageName includesSubString: aString)])
>>>         ] )
>>>     do: [:aPackage |
>>>         aPackage classes do: [:each | methods addAll: each methods ].
>>>         ].
>>>     methods do: [:each |
>>>     each become: each copy
>>>     ]
>>>
>>> and I run the tests of that package before and after... no crash. Is
>>> there something better I could test?
>>>
>>
>> You need to test methods that are in use.
>>
>
> But if I run their tests several times before the become, shouldn't they
> have been jitted and in the cache?
>

Perhaps, perhaps not.  For a test one needs to know.  So it is best to
determine this in the test rather than assume it.


>
>
>>  There's an "xray" primitive for peering below the line, e.g. to find out
>> if a method exists as machine codee.  Alas I only implemented the xray
>> primitive for contexts (see MethodContext>>xray in Cog-Tests).  There
>> should be one for methods as well.
>>
>>
> Ok, I will take a look after dinner :)
>
>
>>
>>
>>>
>>> 2) If I prepare a nice script with some small modifications to Igor's
>>> proposal  would you take a look and integrate it if it is ok?  Just to know
>>> whether I should spend time on that or not.
>>>
>>
>> yes.
>>
>>
>
>
> Excellent.
>
>>
>>> Thanks in advance,
>>>
>>>
>>> --
>>> Mariano
>>> http://marianopeck.wordpress.com
>>>
>>>
>>>
>>
>>
>> --
>> best,
>> Eliot
>>
>>
>>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
>
>
>


-- 
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20120131/6c1c8e9e/attachment.htm


More information about the Vm-dev mailing list