[Vm-dev] VM Maker: CogTools-eem.86.mcz

Eliot Miranda eliot.miranda at gmail.com
Fri Jun 1 01:33:49 UTC 2018


Hi Clément, Hi Sophie,

    I fixed the VMProfiler for 64-bits.  It was simply that the profile
buffer, which stores pcs, needs to have 8-byte elements on 64-bits and
4-byte elements on 32-bits.

I also did a quick fix for MNU entries in closed PICs.  But I'm doing a
more thorough change that for each closed PIC will answer an array of the
PIC's selector followed by pairs of class and either targetMethod or the
symbol doesNotUnderstand:.  With this we'll be able to collect type data
for a UI.  Unfortunately it's not trivial to write because the first class
tag for each PIC is stored at the send site, and so a naïve implementation
would have to scan the code zone looking for the send site for each PIC,
which would be N^2 for closed PIC data.  Instead I need to make a single
pass of the code zone, collecting all the class tags at send sites that
bind to closed PICs, and record the class tags in some data structure
(perhaps there's an unused filed in the Closed PIC header I can use?).
Anyway, this is just a heads up to day it'll take a day or two to finish
the code.

On Thu, May 31, 2018 at 5:34 PM, <commits at source.squeak.org> wrote:

>
> Eliot Miranda uploaded a new version of CogTools to project VM Maker:
> http://source.squeak.org/VMMaker/CogTools-eem.86.mcz
>
> ==================== Summary ====================
>
> Name: CogTools-eem.86
> Author: eem
> Time: 31 May 2018, 5:34:16.049979 pm
> UUID: 5becac89-89a6-4f7a-a5bf-be8981ad66a3
> Ancestors: CogTools-sk.85
>
> Fix profile buffer for 64-bits (use DoubleWordAray).  So for symmetry
> change to using WordArray in 32-bits instead of Bitmap.
> Hack fix MNU cases in PICs in analyzeClosedPIC:.  This is a hack because
> the VM is answering useless values.  It simply answers #doesNotUnderstand:,
> whereas it could more usefully answer {theClass. #doesNotUnderstand:} or
> simply {theClass}.  In fact, all the PIC cases should supply what the
> actual receiver class is, not simply the target method.  We have to discuss
> what to do.  This is in Cogit>>#createCPICData:
>
> =============== Diff against CogTools-sk.85 ===============
>
> Item was changed:
>   ----- Method: VMProfiler>>computeHistograms: (in category 'profiling')
> -----
>   computeHistograms: numSamples
>         sampleBuffer ifNil:
> +               [sampleBuffer := (Smalltalk wordSize = 8
> +                                                       ifTrue:
> [DoubleWordArray]
> +                                                       ifFalse:
> [WordArray]) new: self profileSize].
> -               [sampleBuffer := Bitmap new: self profileSize].
>         self getVMProfileSamplesInto: sampleBuffer.
>         Cursor wait showWhile:
>                 [1 to: numSamples do:
>                         [:i|
>                         sampleBag add: (sampleBuffer at: i)].
>                  sortedSamples := sampleBag sortedElements].
>         total := total + numSamples!
>
> Item was changed:
>   ----- Method: VMProfilerSymbolsManager>>analyzeClosedPIC: (in category
> 'Constituents naming') -----
>   analyzeClosedPIC: aClosedPIC
>
>         ^ Dictionary new
>                 at: 'selector' put: aClosedPIC first;
>                 at: 'nbOfCases' put: aClosedPIC size -1;
> +               at: 'listOfCases' put: ((aClosedPIC allButFirst collect:
> +                                                               [ :each |
> +                                                               each
> isSymbol "MNU PIC Case"
> +
>  ifTrue: [each]
> +
>  ifFalse: [each methodClass name]]) asSet);
> +               yourself!
> -               at: 'listOfCases' put: ((aClosedPIC allButFirst collect: [
> :each | each methodClass name ]) asSet);
> -               yourself.!
>
>


-- 
_,,,^..^,,,_
best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20180531/6267ae46/attachment.html>


More information about the Vm-dev mailing list