[Vm-dev] VM Maker: VMMaker.oscog-dtl.601.mcz

David T. Lewis lewis at mail.msen.com
Sun Feb 2 20:13:04 UTC 2014


Hi Eliot,

This is the primitiveAllObjects update. I made significant changes in shorten:toIndexableSize:
after having discovered a number of interesting new ways to crash the VM, so you will want
to review those changes. There is also a primitiveTestShortenIndexableSize that exists
solely for the purpose of exercising shorten:toIndexableSize: from the image. This should
probably not be a permanent addition to the VM.

I built a Cog VM with these changes, and it seems to be fine. That said, most of my
testing was done on an interpreter VM and there are some difference in the NewObjectMemory
shorten:toIndexableSize: method, so please do check it.

I used the attached Foo.st for testing, you may find that useful also.

Dave


On Sun, Feb 02, 2014 at 07:51:41PM +0000, commits at source.squeak.org wrote:
>  
> David T. Lewis uploaded a new version of VMMaker to project VM Maker:
> http://source.squeak.org/VMMaker/VMMaker.oscog-dtl.601.mcz
> 
> ==================== Summary ====================
> 
> Name: VMMaker.oscog-dtl.601
> Author: dtl
> Time: 2 February 2014, 2:50:58.398 pm
> UUID: 0074410d-1695-4af5-82f4-c74b52a35a9e
> Ancestors: VMMaker.oscog-eem.600
> 
> Fix NewObjectMemory>>shorten:toIndexableSize: for large arrays (3 word header) and make it work for variable objects with fixed fields. Change return value to be number of bytes freed, to permit sender to check for success.
> 
> Fix method comment in ObjectMemory>>lengthOf:baseHeader:format:
> 
> Add primitiveAllObjects.
> 
> Add primitiveTestShortenIndexableSize for testing shorten:toIndexableSize: from the image.
> 
> Adapted from VMMaker-dtl.339.mcz
> 
-------------- next part --------------
'From Squeak4.3 of 6 December 2012 [latest update: #12298] on 2 February 2014 at 2:53:39 pm'!
Object subclass: #Foo
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'DTL'!
!Foo commentStamp: 'dtl 2/2/2014 14:26' prior: 0!
Foo allObjects.

o := Object new.
Foo allObjects includes: o.

a := Array new: 20000.
Foo shorten: a toIndexableSize: 19999.
Foo shorten: a toIndexableSize: 3.

b := ByteArray new: 20000.
Foo shorten: b toIndexableSize: 19999. "no change"!


"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!

Foo class
	instanceVariableNames: ''!

!Foo class methodsFor: 'as yet unclassified' stamp: 'dtl 1/12/2014 17:25'!
allObjects

	"Foo allObjects"

	<primitive: 'primitiveAllObjects'>
	^self primitiveFailed! !

!Foo class methodsFor: 'as yet unclassified' stamp: 'dtl 1/26/2014 21:24'!
shorten: anArray toIndexableSize: size

	"Foo shorten: (Array new: 20) toIndexableSize: 10"

	<primitive: 'primitiveTestShortenIndexableSize'>
	^self primitiveFailed! !


More information about the Vm-dev mailing list