[Vm-dev] VM Maker: Cog-eem.116.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Oct 16 23:28:49 UTC 2013


Eliot Miranda uploaded a new version of Cog to project VM Maker:
http://source.squeak.org/VMMaker/Cog-eem.116.mcz

==================== Summary ====================

Name: Cog-eem.116
Author: eem
Time: 16 October 2013, 4:28:35.19 pm
UUID: 397c862f-6130-4235-9229-b9a8490617e6
Ancestors: Cog-eem.115

Spur bootstrap:
Add Behavior>>elementSize so grow request can be scaled by
size of elements.

=============== Diff against Cog-eem.115 ===============

Item was added:
+ ----- Method: SpurBootstrap class>>BehaviorPROTOTYPEelementSize (in category 'method prototypes') -----
+ BehaviorPROTOTYPEelementSize
+ 	"Answer the size in bytes of an element in the receiver.  The formats are
+ 		0 = 0 sized objects (UndefinedObject True False et al)
+ 		1 = non-indexable objects with inst vars (Point et al)
+ 		2 = indexable objects with no inst vars (Array et al)
+ 		3 = indexable objects with inst vars (MethodContext AdditionalMethodState et al)
+ 		4 = weak indexable objects with inst vars (WeakArray et al)
+ 		5 = weak non-indexable objects with inst vars (ephemerons) (Ephemeron)
+ 		6 unused, reserved for exotic pointer objects?
+ 		7 reserved by the VM
+ 		8 unused, reserved for exotic non-pointer objects?
+ 		9 (?) 64-bit indexable
+ 		10 - 11 32-bit indexable
+ 		12 - 15 16-bit indexable
+ 		16 - 23 byte indexable
+ 		24 - 31 compiled method"
+ 	| instSpec |
+ 	instSpec := self instSpec.
+ 	instSpec < 9 ifTrue: [^Smalltalk wordSize].
+ 	instSpec >= 16 ifTrue: [^1].
+ 	instSpec >= 12 ifTrue: [^2].
+ 	instSpec >= 10 ifTrue: [^4].
+ 	^8!

Item was changed:
  ----- Method: SpurBootstrap class>>BehaviorPROTOTYPEhandleFailingBasicNew: (in category 'method prototypes') -----
  BehaviorPROTOTYPEhandleFailingBasicNew: sizeRequested
  	"This basicNew: gets sent after basicNew: has failed and allowed a
  	 scavenging garbage collection to occur.  The scavenging collection
  	 will have happened as the VM is activating the (failing) basicNew:.
  	 If handleFailingBasicNew: fails then the scavenge failed to reclaim
  	 sufficient space and a global garbage collection is required.
  
  	 Primitive. Answer an instance of this class with the number of indexable
  	 variables specified by the argument, sizeRequested.  Fail if this class is not
  	 indexable or if the argument is not a positive Integer, or if there is not
  	 enough memory available. Essential. See Object documentation whatIsAPrimitive."
  
  	<primitive: 71>
  	self isVariable ifFalse:
  		[self error: self printString, ' cannot have variable sized instances'].
  	(sizeRequested isInteger and: [sizeRequested >= 0]) ifTrue:
  		[Smalltalk garbageCollect < sizeRequested ifTrue:
+ 			[Smalltalk growMemoryByAtLeast: sizeRequested * self elementSize].
- 			[Smalltalk growMemoryByAtLeast: sizeRequested].
  		^self handleFailingFailingBasicNew: sizeRequested  "retry after global garbage collect and possible grow"].
  	self primitiveFailed!



More information about the Vm-dev mailing list