[Vm-dev] VM Maker: VMMaker.oscog-eem.1959.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Oct 13 02:40:31 UTC 2016


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

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

Name: VMMaker.oscog-eem.1959
Author: eem
Time: 12 October 2016, 7:38:49.6578 pm
UUID: 2784931a-d7ba-431a-be8c-ec79b1e55684
Ancestors: VMMaker.oscog-eem.1958

Fix primitiveConstantFill for Spur 16-bit and 64-bit indexable objects.  Ensure that on Spur bytes beyond the last byte are zero.

Fix compilation of the Cogits by exporting the full block entry offsets correctly.

In 1959 the Cuban revolution occurs, the Confédération Mondiale des Activités Subaquatiques is founded by, amongst others, Jacques-Yves Cousteau, and I am born ;-).

=============== Diff against VMMaker.oscog-eem.1958 ===============

Item was changed:
  ----- Method: InterpreterPrimitives>>primitiveConstantFill (in category 'sound primitives') -----
  primitiveConstantFill
+ 	"Fill the receiver, which must be an indexable non-pointer
+ 	 object, with the given integer value."
+ 	objectMemory hasSpurMemoryManagerAPI
+ 		ifTrue: [self primitiveConstantFillSpur]
+ 		ifFalse: [self primitiveConstantFillV3]!
- 	"Fill the receiver, which must be an indexable bytes or words 
- 	objects, with the given integer value."
- 	| fillValue rcvr rcvrIsBytes end i |
- 	<var: #end type: #usqInt>
- 	<var: #i type: #usqInt>
- 	fillValue := self positive32BitValueOf: self stackTop.
- 	rcvr := self stackValue: 1.
- 	self success: (objectMemory isWordsOrBytes: rcvr).
- 	rcvrIsBytes := objectMemory isBytes: rcvr.
- 	rcvrIsBytes ifTrue: [self success: (fillValue >= 0 and: [fillValue <= 255])].
- 	self successful ifTrue:
- 		[end := rcvr + (objectMemory sizeBitsOf: rcvr).
- 		i := rcvr + objectMemory baseHeaderSize.
- 		rcvrIsBytes ifTrue:
- 			[fillValue := fillValue bitAnd: 255.
- 			fillValue := fillValue + (fillValue << 8) + (fillValue << 16) + (fillValue << 24)].
- 		[i < end] whileTrue:
- 			[objectMemory long32At: i put: fillValue.
- 			 i := i + 4].
- 		self pop: 1]!

Item was added:
+ ----- Method: InterpreterPrimitives>>primitiveConstantFillSpur (in category 'sound primitives') -----
+ primitiveConstantFillSpur
+ 	"Fill the receiver, which must be an indexable non-pointer object, with the given integer value."
+ 	<inline: true>
+ 	| fillValue rcvr format end i oddBytes |
+ 	<var: #fillValue type: #usqLong>
+ 	<var: #end type: #usqInt>
+ 	<var: #i type: #usqInt>
+ 	fillValue := self positive64BitValueOf: self stackTop.
+ 	rcvr := self stackValue: 1.
+ 	(self successful
+ 	 and: [(objectMemory isNonImmediate: rcvr)
+ 	 and: [(format := objectMemory formatOf: rcvr) >= objectMemory sixtyFourBitIndexableFormat]]) ifFalse:
+ 		[^self primitiveFail].
+ 	format >= objectMemory firstShortFormat
+ 		ifTrue:
+ 			[format >= objectMemory firstByteFormat
+ 				ifTrue:
+ 					[(fillValue > 16rFF or: [format >= objectMemory firstCompiledMethodFormat]) ifTrue:
+ 						[^self primitiveFail].
+ 					 fillValue := fillValue + (fillValue << 8) + (fillValue << 16) + (fillValue << 24).
+ 					 oddBytes := format bitAnd: 7]
+ 				ifFalse:
+ 					[fillValue > 16rFFFF ifTrue:
+ 						[^self primitiveFail].
+ 					 fillValue := fillValue + (fillValue << 16).
+ 					 oddBytes := (format bitAnd: 3) << 1].
+ 			 fillValue := fillValue + (fillValue << 32)]
+ 		ifFalse:
+ 			[format = objectMemory sixtyFourBitIndexableFormat
+ 				ifTrue:
+ 					[oddBytes := 0]
+ 				ifFalse:
+ 					[fillValue > 16rFFFFFFFF ifTrue:
+ 						[^self primitiveFail].
+ 					 fillValue := fillValue + (fillValue << 32).
+ 					 oddBytes := (format bitAnd: 1) << 2]].
+ 	end := objectMemory addressAfter: rcvr.
+ 	i := rcvr + objectMemory baseHeaderSize.
+ 	[i < end] whileTrue:
+ 		[objectMemory long64At: i put: fillValue.
+ 		 i := i + 8].
+ 	"now ensure trailing bytes are zero"
+ 	oddBytes > 0 ifTrue:
+ 		[self flag: #endianness.
+ 		 fillValue := fillValue >> (8 * oddBytes).
+ 		 objectMemory long64At: i - 8 put: fillValue].
+ 	self pop: 1!

Item was added:
+ ----- Method: InterpreterPrimitives>>primitiveConstantFillV3 (in category 'sound primitives') -----
+ primitiveConstantFillV3
+ 	"Fill the receiver, which must be an indexable bytes or words 
+ 	 object, with the given integer value."
+ 	<inline: true>
+ 	| fillValue rcvr end i |
+ 	<var: #end type: #usqInt>
+ 	<var: #i type: #usqInt>
+ 	fillValue := self positive32BitValueOf: self stackTop.
+ 	rcvr := self stackValue: 1.
+ 	self success: (objectMemory isWordsOrBytes: rcvr).
+ 	(objectMemory isBytes: rcvr) ifTrue:
+ 		[self success: (fillValue >= 0 and: [fillValue <= 255]).
+ 		 fillValue := fillValue + (fillValue << 8) + (fillValue << 16) + (fillValue << 24)].
+ 	self successful ifTrue:
+ 		[end := rcvr + (objectMemory sizeBitsOf: rcvr).
+ 		 i := rcvr + objectMemory baseHeaderSize.
+ 		 [i < end] whileTrue:
+ 			[objectMemory long32At: i put: fillValue.
+ 			 i := i + 4].
+ 		 self pop: 1]!

Item was changed:
  ----- Method: SimpleStackBasedCogit>>fullBlockEntryOffset (in category 'accessing') -----
  fullBlockEntryOffset
  	<api>
+ 	<cmacro>
  	^cbEntryOffset!

Item was changed:
  ----- Method: SimpleStackBasedCogit>>fullBlockNoContextSwitchEntryOffset (in category 'accessing') -----
  fullBlockNoContextSwitchEntryOffset
  	<api>
+ 	<cmacro>
  	^cbNoSwitchEntryOffset!



More information about the Vm-dev mailing list