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

commits at source.squeak.org commits at source.squeak.org
Fri Dec 12 01:17:00 UTC 2014


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

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

Name: VMMaker.oscog-eem.979
Author: eem
Time: 11 December 2014, 5:14:05.949 pm
UUID: 6e5d060a-75ea-42ab-8dd3-ac3d7a550ed9
Ancestors: VMMaker.oscog-eem.978

Handle not in nilOrBooleanConstantReceiverOf:

Don't do the 32-bit swap in a 32-bit words object in
64-bit Spur.  May have to do it in a 64-bit word obj
in 64-bit Spur, but it can wait.

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

Item was changed:
  ----- Method: CCodeGenerator>>nilOrBooleanConstantReceiverOf: (in category 'utilities') -----
  nilOrBooleanConstantReceiverOf: aNode
  	"Answer nil or the boolean constant that is the receiver of the given message send.
  	 Used to suppress conditional code when the condition is a translation-time constant."
  
  	| val receiver argument |
  	generateDeadCode ifTrue:[^nil].
  	((self isConstantNode: aNode valueInto: [:v| val := v])
  	 and: [#(true false) includes: val]) ifTrue:
  		[^val].
  	aNode isSend ifTrue:
+ 		[aNode selector == #not ifTrue:
+ 			[(self nilOrBooleanConstantReceiverOf: aNode receiver) ifNotNil:
+ 				[:bool| ^bool not]].
+ 		 ((#(or: and:) includes: aNode selector)
- 		[((#(or: and:) includes: aNode selector)
  		 and: [aNode args last isStmtList
  		 and: [aNode args last statements size = 1]]) ifTrue:
  			[(self nilOrBooleanConstantReceiverOf: aNode receiver) ifNotNil:
  				[:rcvr|
  				((rcvr == false and: [aNode selector == #and:])
  				 or: [rcvr == true and: [aNode selector == #or:]]) ifTrue:
  					[^rcvr].
  				(self nilOrBooleanConstantReceiverOf: aNode args last statements first) ifNotNil:
  					[:arg|
  					^rcvr perform: aNode selector with: [arg]]]].
  		 ((#(= ~= < > <= >=) includes: aNode selector)
  		  and: [(self isConstantNode: aNode receiver valueInto: [:v| receiver := v])
  		  and: [receiver isInteger
  		  and: [(self isConstantNode: aNode args first valueInto: [:v| argument := v])
  		  and: [argument isInteger]]]]) ifTrue:
  			[^receiver perform: aNode selector with: argument]].
  	^nil!

Item was changed:
  ----- Method: StackInterpreter>>updateObjectsPostByteSwap (in category 'image save/restore') -----
  updateObjectsPostByteSwap
  	"Byte-swap the words of all bytes objects in the image, including Strings, ByteArrays,
  	 and CompiledMethods. This returns these objects to their original byte ordering
  	 after blindly byte-swapping the entire image. For compiled  methods, byte-swap
  	 only their bytecodes part. Ensure floats are in platform-order."
  	| swapFloatWords |
  	swapFloatWords := objectMemory vmEndianness ~= imageFloatsBigEndian.
  	self assert: ClassFloatCompactIndex ~= 0.
  	objectMemory allObjectsDo:
  		[:oop| | fmt wordAddr methodHeader temp |
  		fmt := objectMemory formatOf: oop.
  		 fmt >= self firstByteFormat ifTrue: "oop contains bytes"
  			[wordAddr := oop + objectMemory baseHeaderSize.
  			fmt >= self firstCompiledMethodFormat ifTrue: "compiled method; start after methodHeader and literals"
  				[methodHeader := self longAt: oop + objectMemory baseHeaderSize.
  				 wordAddr := wordAddr + (((objectMemory literalCountOfMethodHeader: methodHeader) + LiteralStart) * objectMemory bytesPerOop)].
  			objectMemory reverseBytesFrom: wordAddr to: oop + (objectMemory sizeBitsOf: oop)].
  		 fmt = self firstLongFormat ifTrue: "Bitmap, Float etc"
  			[(swapFloatWords
  			  and: [(objectMemory compactClassIndexOf: oop) = ClassFloatCompactIndex])
  				ifTrue:
  					[temp := self longAt: oop + objectMemory baseHeaderSize.
  					 self longAt: oop + objectMemory baseHeaderSize put: (self longAt: oop + objectMemory baseHeaderSize + 4).
  					 self longAt: oop + objectMemory baseHeaderSize + 4 put: temp]
  				ifFalse:
+ 					[(objectMemory hasSpurMemoryManagerAPI not
+ 					  and: [objectMemory wordSize = 8]) ifTrue: "Object contains 32-bit half-words packed into 64-bit machine words."
- 					[objectMemory wordSize = 8 ifTrue: "Object contains 32-bit half-words packed into 64-bit machine words."
  						[wordAddr := oop + objectMemory baseHeaderSize.
  						 objectMemory reverseWordsFrom: wordAddr to: oop + (objectMemory sizeBitsOf: oop)]]]]!



More information about the Vm-dev mailing list