Re: [Pharo-project] squeak VM 5.0

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

Re: [Pharo-project] squeak VM 5.0

johnmci
RIght and it's 12:30 am again,

So the MAGIC fixes for the tracer to let you build a 64bit Pharo image are below.
No doubt they apply to closure based squeak trunk images.

Could someone can be kind enough to integrate them into the current System-Tracing.2forPharo.cs ?
Then some people in Europe? can grab the current Pharo/Trunk image and convert it, and run some smoke tests.
BTW you need to use the Squeak.5.0.0.b9.64*64.app.zip to run a 64bit image

Don't forget to convert you have to use a powerpc, or a  squeak VM that is running as powerpc (via get info settings) on your macintel machine.
Still need someone to *fix* the systemtracer so it will run on intel machines.  (Hint watch how it writes out integer data). ...
 
Changes below:

"This is the magic change, it's not the conversion of the image that is bad. It's the Smalltalk code assumption of is that 4 or 8 bytes? "
"There likely should be a Pharo/Squeak bug for this since it should be using wordSize not a magic number of 4"

Eliot notes  "Bravo!  But Smalltalk wordSize has to be implemented in some way that caches the value in e.g. a class variable (or class inst var for max speed) that is reevaluated on startup."

So I'll let someone propose/write a clever solution since the Smalltalk wordSize is computational heavy.

CompiledMethod>>initialPC
        "Answer the program counter for the receiver's first bytecode."

        ^ (self numLiterals + 1) * (Smalltalk wordSize) + 1  
       

"This next method  isn't used much, should be. But the System-Tracing.2forPharo.cs trashes it with a ancient version.
This is the correct version"

SystemDictionary>>wordSize
 "Answer the size (in bytes) of an object pointer."
 "Smalltalk wordSize"
 ^[SmalltalkImage current vmParameterAt: 40] on: Error do: [4]

"Changes to properly fix up BlockClosure in the SystemTracer2"

SystemTracer2>>object: object allFieldsWithIndex: block collect: sequenceableCollectionClass
        "Evaluate block against each of the pointer fields with index, and collect the results in an instance of sequenceableCollectionClass"

        | fixedSize results varSize nilResults blockvalue |
        object isCompiledMethod ifTrue:
                [results := sequenceableCollectionClass new: 1 + object numLiterals.
                1 to: 1 + object numLiterals do:
                        [:j | results at: j put: (block value: (object objectAt: j) value: j)].
                ^ results].
       
        fixedSize := object class instSize.
        varSize := object basicSize.
        results := sequenceableCollectionClass new: fixedSize + varSize.
        1 to: fixedSize do:
                [:j | results at: j put: (block value: (object instVarAt: j) value: j)].
        1 to: varSize do:
                [:j |
                results at: fixedSize + j put: (block value: (object basicAt: j) value: fixedSize + j)].

        object isContextPart ifTrue:
                [(object instVarAt: 2) ifNotNil:
                        ["May need to adjust PC and startPC if changing wordSize..."
                        blockvalue := (object instVarAt: 2)+(self pcDeltaForMethod: object method).
                results at: 2 put: (block value: blockvalue value: 2)].
                ((object isMemberOf: BlockContext) and: [object home notNil]) ifTrue:
                                [results at: 5 put: (block value: (object instVarAt: 5)+(self pcDeltaForMethod: object method) value: 5)].
                "Need to fill out the nils beyond the knowable end of stack"
                nilResults := sequenceableCollectionClass new: object frameSize - object basicSize.
                1 to: nilResults size do:
                        [:j | nilResults at: j put: (block value: nil value: j)].
                ^ results , nilResults].
        object class = BlockClosure ifTrue:
                ["May need to adjust PC and startPC if changing wordSize..."
                blockvalue := (object instVarAt: 2)+(self pcDeltaForMethod: object method).
                results at: 2 put: (block value: blockvalue value: 2)].
                ^ results


>> Eliot and I spent 30 minutes chatting about what is wrong. The conclusion is we *think* we are doing the right thing,
>> yet the Virtual Machine says the image is busted.   So a quick fix is not apparent, and we'll dig more.

--
===========================================================================
John M. McIntosh <[hidden email]>   Twitter:  squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================





Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-project] squeak VM 5.0

johnmci
Obviously some bored developer should take one of these handy 64bit images and with a 64bit vm
fire it up and create oh mmm let's say a 10GB image?  Just to see, don't forget to save it and reopen,
do a garbage collect all...

Can't recall hearing of anyone trying an image greater than 2 GB...

If you show proof of a 100GB image, then I'll buy you a beer at the next ESUG.

On 2009-12-16, at 12:48 AM, John M McIntosh wrote:

> So the MAGIC fixes for the tracer to let you build a 64bit Pharo image are below.

--
===========================================================================
John M. McIntosh <[hidden email]>   Twitter:  squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================





Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-project] squeak VM 5.0

Stéphane Ducasse
Hi john

I'm sure that jannik (which is not bored) can generate huge images :)

Stef

On Dec 16, 2009, at 9:54 AM, John M McIntosh wrote:

> Obviously some bored developer should take one of these handy 64bit images and with a 64bit vm
> fire it up and create oh mmm let's say a 10GB image?  Just to see, don't forget to save it and reopen,
> do a garbage collect all...
>
> Can't recall hearing of anyone trying an image greater than 2 GB...
>
> If you show proof of a 100GB image, then I'll buy you a beer at the next ESUG.
>
> On 2009-12-16, at 12:48 AM, John M McIntosh wrote:
>
>> So the MAGIC fixes for the tracer to let you build a 64bit Pharo image are below.
>
> --
> ===========================================================================
> John M. McIntosh <[hidden email]>   Twitter:  squeaker68882
> Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
> ===========================================================================
>
>
>
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


Reply | Threaded
Open this post in threaded view
|

Re: [Vm-dev] Re: [Pharo-project] squeak VM 5.0

Eliot Miranda-2
In reply to this post by johnmci
Um, I'm _quite_ serious on insisting that Smalltalk wordSize be implemented in some way that caches the value in e.g. a class variable (or class inst var for max speed) that is reevaluated on startup.  initialPC is evaluated a lot, e.g. once for every method in a "browse inst var refs".  This is performance-critical, and going to a slow primitive to access something that can only change at startup is not a good idea.  Please arrange that e.g. SystemDictionary gains a class var that caches the word size.

On Wed, Dec 16, 2009 at 12:48 AM, John M McIntosh <[hidden email]> wrote:

RIght and it's 12:30 am again,

So the MAGIC fixes for the tracer to let you build a 64bit Pharo image are below.
No doubt they apply to closure based squeak trunk images.

Could someone can be kind enough to integrate them into the current System-Tracing.2forPharo.cs ?
Then some people in Europe? can grab the current Pharo/Trunk image and convert it, and run some smoke tests.
BTW you need to use the Squeak.5.0.0.b9.64*64.app.zip to run a 64bit image

Don't forget to convert you have to use a powerpc, or a  squeak VM that is running as powerpc (via get info settings) on your macintel machine.
Still need someone to *fix* the systemtracer so it will run on intel machines.  (Hint watch how it writes out integer data). ...

Changes below:

"This is the magic change, it's not the conversion of the image that is bad. It's the Smalltalk code assumption of is that 4 or 8 bytes? "
"There likely should be a Pharo/Squeak bug for this since it should be using wordSize not a magic number of 4"

Eliot notes  "Bravo!  But Smalltalk wordSize has to be implemented in some way that caches the value in e.g. a class variable (or class inst var for max speed) that is reevaluated on startup."

So I'll let someone propose/write a clever solution since the Smalltalk wordSize is computational heavy.

CompiledMethod>>initialPC
       "Answer the program counter for the receiver's first bytecode."

       ^ (self numLiterals + 1) * (Smalltalk wordSize) + 1


"This next method  isn't used much, should be. But the System-Tracing.2forPharo.cs trashes it with a ancient version.
This is the correct version"

SystemDictionary>>wordSize
 "Answer the size (in bytes) of an object pointer."
 "Smalltalk wordSize"
 ^[SmalltalkImage current vmParameterAt: 40] on: Error do: [4]

"Changes to properly fix up BlockClosure in the SystemTracer2"

SystemTracer2>>object: object allFieldsWithIndex: block collect: sequenceableCollectionClass
       "Evaluate block against each of the pointer fields with index, and collect the results in an instance of sequenceableCollectionClass"

       | fixedSize results varSize nilResults blockvalue |
       object isCompiledMethod ifTrue:
               [results := sequenceableCollectionClass new: 1 + object numLiterals.
               1 to: 1 + object numLiterals do:
                       [:j | results at: j put: (block value: (object objectAt: j) value: j)].
               ^ results].

       fixedSize := object class instSize.
       varSize := object basicSize.
       results := sequenceableCollectionClass new: fixedSize + varSize.
       1 to: fixedSize do:
               [:j | results at: j put: (block value: (object instVarAt: j) value: j)].
       1 to: varSize do:
               [:j |
               results at: fixedSize + j put: (block value: (object basicAt: j) value: fixedSize + j)].

       object isContextPart ifTrue:
               [(object instVarAt: 2) ifNotNil:
                       ["May need to adjust PC and startPC if changing wordSize..."
                       blockvalue := (object instVarAt: 2)+(self pcDeltaForMethod: object method).
               results at: 2 put: (block value: blockvalue value: 2)].
               ((object isMemberOf: BlockContext) and: [object home notNil]) ifTrue:
                               [results at: 5 put: (block value: (object instVarAt: 5)+(self pcDeltaForMethod: object method) value: 5)].
               "Need to fill out the nils beyond the knowable end of stack"
               nilResults := sequenceableCollectionClass new: object frameSize - object basicSize.
               1 to: nilResults size do:
                       [:j | nilResults at: j put: (block value: nil value: j)].
               ^ results , nilResults].
       object class = BlockClosure ifTrue:
               ["May need to adjust PC and startPC if changing wordSize..."
               blockvalue := (object instVarAt: 2)+(self pcDeltaForMethod: object method).
               results at: 2 put: (block value: blockvalue value: 2)].
               ^ results


>> Eliot and I spent 30 minutes chatting about what is wrong. The conclusion is we *think* we are doing the right thing,
>> yet the Virtual Machine says the image is busted.   So a quick fix is not apparent, and we'll dig more.

--
===========================================================================
John M. McIntosh <[hidden email]>   Twitter:  squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================







Reply | Threaded
Open this post in threaded view
|

Re: [Vm-dev] Re: [Pharo-project] squeak VM 5.0

jannik laval
Hi Eliot, hi John,

This is what I do:
- create a class var in SystemDictionary
- accessors (wordSize and wordSize:), the first one can initialize the variable if nil, the second is to modify the value in case of 64bits image.
Maybe the second one could be integrated in System-Tracing file.
- in CompiledMethod, initialPC use it.

Maybe we could integrate it in pharoCore.

Cheers,
Jannik

=======
'From PharoCore1.1ALPHA of ''19 October 2009'' [Latest update: #11088] on 16 December 2009 at 11:06:21 pm'!
IdentityDictionary subclass: #SystemDictionary
instanceVariableNames: 'cachedClassNames '
classVariableNames: 'LastImageName LastQuitLogPosition LowSpaceProcess LowSpaceSemaphore MemoryHogs ShutDownList SpecialSelectors StartUpList StartupStamp SystemChanges WordSize '
poolDictionaries: ''
category: 'System-Support'!

!SystemDictionary class methodsFor: 'initialization' stamp: 'jannik.laval 12/16/2009 22:40'!
wordSize
WordSize ifNil: [WordSize := [SmalltalkImage current vmParameterAt: 40] on: Error do: [4]].
^WordSize! !

!SystemDictionary class methodsFor: 'initialization' stamp: 'jannik.laval 12/16/2009 22:40'!
wordSize: aNumber
WordSize := aNumber! !

IdentityDictionary subclass: #SystemDictionary
instanceVariableNames: 'cachedClassNames'
classVariableNames: 'LastImageName LastQuitLogPosition LowSpaceProcess LowSpaceSemaphore MemoryHogs ShutDownList SpecialSelectors StartUpList StartupStamp SystemChanges WordSize'
poolDictionaries: ''
category: 'System-Support'!


!CompiledMethod methodsFor: 'accessing' stamp: 'jannik.laval 12/16/2009 22:41'!
initialPC
"Answer the program counter for the receiver's first bytecode."

^ (self numLiterals + 1) * SystemDictionary wordSize + 1! !
=======




On Dec 16, 2009, at 18:32 , Eliot Miranda wrote:

Um, I'm _quite_ serious on insisting that Smalltalk wordSize be implemented in some way that caches the value in e.g. a class variable (or class inst var for max speed) that is reevaluated on startup.  initialPC is evaluated a lot, e.g. once for every method in a "browse inst var refs".  This is performance-critical, and going to a slow primitive to access something that can only change at startup is not a good idea.  Please arrange that e.g. SystemDictionary gains a class var that caches the word size.

On Wed, Dec 16, 2009 at 12:48 AM, John M McIntosh <[hidden email]> wrote:

RIght and it's 12:30 am again,

So the MAGIC fixes for the tracer to let you build a 64bit Pharo image are below.
No doubt they apply to closure based squeak trunk images.

Could someone can be kind enough to integrate them into the current System-Tracing.2forPharo.cs ?
Then some people in Europe? can grab the current Pharo/Trunk image and convert it, and run some smoke tests.
BTW you need to use the Squeak.5.0.0.b9.64*64.app.zip to run a 64bit image

Don't forget to convert you have to use a powerpc, or a  squeak VM that is running as powerpc (via get info settings) on your macintel machine.
Still need someone to *fix* the systemtracer so it will run on intel machines.  (Hint watch how it writes out integer data). ...

Changes below:

"This is the magic change, it's not the conversion of the image that is bad. It's the Smalltalk code assumption of is that 4 or 8 bytes? "
"There likely should be a Pharo/Squeak bug for this since it should be using wordSize not a magic number of 4"

Eliot notes  "Bravo!  But Smalltalk wordSize has to be implemented in some way that caches the value in e.g. a class variable (or class inst var for max speed) that is reevaluated on startup."

So I'll let someone propose/write a clever solution since the Smalltalk wordSize is computational heavy.

CompiledMethod>>initialPC
       "Answer the program counter for the receiver's first bytecode."

       ^ (self numLiterals + 1) * (Smalltalk wordSize) + 1


"This next method  isn't used much, should be. But the System-Tracing.2forPharo.cs trashes it with a ancient version.
This is the correct version"

SystemDictionary>>wordSize
 "Answer the size (in bytes) of an object pointer."
 "Smalltalk wordSize"
 ^[SmalltalkImage current vmParameterAt: 40] on: Error do: [4]

"Changes to properly fix up BlockClosure in the SystemTracer2"

SystemTracer2>>object: object allFieldsWithIndex: block collect: sequenceableCollectionClass
       "Evaluate block against each of the pointer fields with index, and collect the results in an instance of sequenceableCollectionClass"

       | fixedSize results varSize nilResults blockvalue |
       object isCompiledMethod ifTrue:
               [results := sequenceableCollectionClass new: 1 + object numLiterals.
               1 to: 1 + object numLiterals do:
                       [:j | results at: j put: (block value: (object objectAt: j) value: j)].
               ^ results].

       fixedSize := object class instSize.
       varSize := object basicSize.
       results := sequenceableCollectionClass new: fixedSize + varSize.
       1 to: fixedSize do:
               [:j | results at: j put: (block value: (object instVarAt: j) value: j)].
       1 to: varSize do:
               [:j |
               results at: fixedSize + j put: (block value: (object basicAt: j) value: fixedSize + j)].

       object isContextPart ifTrue:
               [(object instVarAt: 2) ifNotNil:
                       ["May need to adjust PC and startPC if changing wordSize..."
                       blockvalue := (object instVarAt: 2)+(self pcDeltaForMethod: object method).
               results at: 2 put: (block value: blockvalue value: 2)].
               ((object isMemberOf: BlockContext) and: [object home notNil]) ifTrue:
                               [results at: 5 put: (block value: (object instVarAt: 5)+(self pcDeltaForMethod: object method) value: 5)].
               "Need to fill out the nils beyond the knowable end of stack"
               nilResults := sequenceableCollectionClass new: object frameSize - object basicSize.
               1 to: nilResults size do:
                       [:j | nilResults at: j put: (block value: nil value: j)].
               ^ results , nilResults].
       object class = BlockClosure ifTrue:
               ["May need to adjust PC and startPC if changing wordSize..."
               blockvalue := (object instVarAt: 2)+(self pcDeltaForMethod: object method).
               results at: 2 put: (block value: blockvalue value: 2)].
               ^ results


>> Eliot and I spent 30 minutes chatting about what is wrong. The conclusion is we *think* we are doing the right thing,
>> yet the Virtual Machine says the image is busted.   So a quick fix is not apparent, and we'll dig more.

--
===========================================================================
John M. McIntosh <[hidden email]>   Twitter:  squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================










addWordSizeInSystemDictionary.1.cs (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Vm-dev] Re: [Pharo-project] squeak VM 5.0

johnmci
Ok, well I created Mantis 
to document. 

Personally I would do 
Smalltalk wordSize
versus 
SystemDictionary wordSize

Also the issue is when to change the WordSize variable. 

I think in 
SmalltalkImage>>snapshot: andQuit: embedded:  
right at the 
ifTrue: [self quitPrimitive].
Cursor normal show.
you want to set things so that wordSize is reset. 

At quit time you could do the reset before the 
"self quitPrimitive"
then you know the value is reset and needs to be recalculated at startup time. 
or you can reset it before the
Cursor normal show.
which runs after startup time

Somehow I think there is more risk resetting it after startup since I'm not sure 
when something could leap in wanting a valid value. 



On 2009-12-16, at 2:44 PM, Laval Jannik wrote:

Hi Eliot, hi John,

This is what I do:
- create a class var in SystemDictionary
- accessors (wordSize and wordSize:), the first one can initialize the variable if nil, the second is to modify the value in case of 64bits image.
Maybe the second one could be integrated in System-Tracing file.
- in CompiledMethod, initialPC use it.

Maybe we could integrate it in pharoCore.


--
===========================================================================
John M. McIntosh <[hidden email]>   Twitter:  squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================






Reply | Threaded
Open this post in threaded view
|

Re: [Vm-dev] Re: [Pharo-project] squeak VM 5.0

jannik laval
Hi,

I modify the variable in the method "clonePreStartup".
So, it works fine.

=====
!SystemTracer2 methodsFor: 'clone startup' stamp: 'ajh 8/22/2002 11:15'!
clonePreStartup
"This will be executed right away when the new clone starts up, before processStartup.  Subclasses may want to rehash all objects or something"
SystemDictionary wordSize: self wordSize.! !
=====

Now, there are some tests which does not pass.
So, I will publish the code and the pharoImage64, and with the community, we can check this.

Cheers,
Jannik 


On Dec 17, 2009, at 02:32 , John M McIntosh wrote:

Ok, well I created Mantis 
to document. 

Personally I would do 
Smalltalk wordSize
versus 
SystemDictionary wordSize

Also the issue is when to change the WordSize variable. 

I think in 
SmalltalkImage>>snapshot: andQuit: embedded:  
right at the 
ifTrue: [self quitPrimitive].
Cursor normal show.
you want to set things so that wordSize is reset. 

At quit time you could do the reset before the 
"self quitPrimitive"
then you know the value is reset and needs to be recalculated at startup time. 
or you can reset it before the
Cursor normal show.
which runs after startup time

Somehow I think there is more risk resetting it after startup since I'm not sure 
when something could leap in wanting a valid value. 



On 2009-12-16, at 2:44 PM, Laval Jannik wrote:

Hi Eliot, hi John,

This is what I do:
- create a class var in SystemDictionary
- accessors (wordSize and wordSize:), the first one can initialize the variable if nil, the second is to modify the value in case of 64bits image.
Maybe the second one could be integrated in System-Tracing file.
- in CompiledMethod, initialPC use it.

Maybe we could integrate it in pharoCore.


--
===========================================================================
John M. McIntosh <[hidden email]>   Twitter:  squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================








Reply | Threaded
Open this post in threaded view
|

Re: squeak VM 5.0

Bert Freudenberg
On 17.12.2009, at 07:44, Laval Jannik wrote:
Hi,

I modify the variable in the method "clonePreStartup".
So, it works fine.


Given that this won't change on any further startup I'd think this is a better solution than putting it in the snapshot code. Since there won't be a sender of #wordSize: in the resulting image, I'd add a comment explaining why. Also, I'd take out the lazy init code in #wordSize, no need to be lazy here ;)

- Bert -

=====
!SystemTracer2 methodsFor: 'clone startup' stamp: 'ajh 8/22/2002 11:15'!
clonePreStartup
"This will be executed right away when the new clone starts up, before processStartup.  Subclasses may want to rehash all objects or something"
SystemDictionary wordSize: self wordSize.! !
=====

Now, there are some tests which does not pass.
So, I will publish the code and the pharoImage64, and with the community, we can check this.

Cheers,
Jannik 


On Dec 17, 2009, at 02:32 , John M McIntosh wrote:

Ok, well I created Mantis 
to document. 

Personally I would do 
Smalltalk wordSize
versus 
SystemDictionary wordSize

Also the issue is when to change the WordSize variable. 

I think in 
SmalltalkImage>>snapshot: andQuit: embedded:  
right at the 
ifTrue: [self quitPrimitive].
Cursor normal show.
you want to set things so that wordSize is reset. 

At quit time you could do the reset before the 
"self quitPrimitive"
then you know the value is reset and needs to be recalculated at startup time. 
or you can reset it before the
Cursor normal show.
which runs after startup time

Somehow I think there is more risk resetting it after startup since I'm not sure 
when something could leap in wanting a valid value. 





Reply | Threaded
Open this post in threaded view
|

Re: Re: squeak VM 5.0

David T. Lewis
On Thu, Dec 17, 2009 at 03:28:54PM +0100, Bert Freudenberg wrote:

> On 17.12.2009, at 07:44, Laval Jannik wrote:
> > Hi,
> >
> > I modify the variable in the method "clonePreStartup".
> > So, it works fine.
> >
>
> Given that this won't change on any further startup I'd think this is
> a better solution than putting it in the snapshot code. Since there
> won't be a sender of #wordSize: in the resulting image, I'd add a
> comment explaining why. Also, I'd take out the lazy init code in
> #wordSize, no need to be lazy here ;)
>

Actually I think that Laval got it right with the lazy initialize.
CompiledMethod>>initialPC will call #wordSize, so if you clear the
cached value before the snapshot, it should be restored on the next
reference after the snapshot as the image is restarted.

I think John is right that it should be "Smalltalk wordSize" rather
than "SystemDictionary wordSize" (disregard my earlier dumb suggestion
of using "Object wordSize"). And I think it's right to clear the
cached value prior to the snapshot (although I'm not 100% sure it
stays cleared; I guess I should confirm that).

I put a change set that updates Laval's changes on Mantis at
http://bugs.squeak.org/view.php?id=7430.

Dave


Reply | Threaded
Open this post in threaded view
|

Re: Re: squeak VM 5.0

Bert Freudenberg
On 18.12.2009, at 07:05, David T. Lewis wrote:

>
> On Thu, Dec 17, 2009 at 03:28:54PM +0100, Bert Freudenberg wrote:
>> On 17.12.2009, at 07:44, Laval Jannik wrote:
>>> Hi,
>>>
>>> I modify the variable in the method "clonePreStartup".
>>> So, it works fine.
>>>
>>
>> Given that this won't change on any further startup I'd think this is
>> a better solution than putting it in the snapshot code. Since there
>> won't be a sender of #wordSize: in the resulting image, I'd add a
>> comment explaining why. Also, I'd take out the lazy init code in
>> #wordSize, no need to be lazy here ;)
>>
>
> Actually I think that Laval got it right with the lazy initialize.
> CompiledMethod>>initialPC will call #wordSize, so if you clear the
> cached value before the snapshot, it should be restored on the next
> reference after the snapshot as the image is restarted.
>
> I think John is right that it should be "Smalltalk wordSize" rather
> than "SystemDictionary wordSize" (disregard my earlier dumb suggestion
> of using "Object wordSize"). And I think it's right to clear the
> cached value prior to the snapshot (although I'm not 100% sure it
> stays cleared; I guess I should confirm that).
>
> I put a change set that updates Laval's changes on Mantis at
> http://bugs.squeak.org/view.php?id=7430.
>
> Dave

But why?

Except using the SystemTracer you can't change the wordSize of an image. So the right place for setting it is SystemTracer. It is completely unnecessary to check for this on startup.

- Bert -



Reply | Threaded
Open this post in threaded view
|

Re: Re: squeak VM 5.0

David T. Lewis
On Fri, Dec 18, 2009 at 01:18:37PM +0100, Bert Freudenberg wrote:

> On 18.12.2009, at 07:05, David T. Lewis wrote:
> >
> > On Thu, Dec 17, 2009 at 03:28:54PM +0100, Bert Freudenberg wrote:
> >> On 17.12.2009, at 07:44, Laval Jannik wrote:
> >>> Hi,
> >>>
> >>> I modify the variable in the method "clonePreStartup".
> >>> So, it works fine.
> >>>
> >>
> >> Given that this won't change on any further startup I'd think this is
> >> a better solution than putting it in the snapshot code. Since there
> >> won't be a sender of #wordSize: in the resulting image, I'd add a
> >> comment explaining why. Also, I'd take out the lazy init code in
> >> #wordSize, no need to be lazy here ;)
> >>
> >
> > Actually I think that Laval got it right with the lazy initialize.
> > CompiledMethod>>initialPC will call #wordSize, so if you clear the
> > cached value before the snapshot, it should be restored on the next
> > reference after the snapshot as the image is restarted.
> >
> > I think John is right that it should be "Smalltalk wordSize" rather
> > than "SystemDictionary wordSize" (disregard my earlier dumb suggestion
> > of using "Object wordSize"). And I think it's right to clear the
> > cached value prior to the snapshot (although I'm not 100% sure it
> > stays cleared; I guess I should confirm that).
> >
> > I put a change set that updates Laval's changes on Mantis at
> > http://bugs.squeak.org/view.php?id=7430.
> >
> > Dave
>
> But why?
>
> Except using the SystemTracer you can't change the wordSize of an image. So the right place for setting it is SystemTracer. It is completely unnecessary to check for this on startup.
>

Agreed. John pointed that out on the Mantis report also.

Dave
 

Reply | Threaded
Open this post in threaded view
|

Re: Re: squeak VM 5.0

David T. Lewis
In reply to this post by Bert Freudenberg
On Fri, Dec 18, 2009 at 01:18:37PM +0100, Bert Freudenberg wrote:
>
> Except using the SystemTracer you can't change the wordSize of an image.
> So the right place for setting it is SystemTracer. It is completely
> unnecessary to check for this on startup.

Corrected change set is on Mantis http://bugs.squeak.org/view.php?id=7430.

Jannik, hopefully this matches what you added for the Pharo
image.  If you have a change set, can you please upload it to
http://bugs.squeak.org/view.php?id=7430 or just mail it so I
can check? We should make Squeak trunk match Pharo here, and I
do not want to put my author initials on top your your work ;)

Thanks,
Dave