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

commits at source.squeak.org commits at source.squeak.org
Tue Jun 7 22:09:20 UTC 2016


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

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

Name: VMMaker.oscog-eem.1884
Author: eem
Time: 7 June 2016, 3:06:08.369636 pm
UUID: 9ed14e3a-5903-474d-92c1-ecd78e7cb932
Ancestors: VMMaker.oscog-eem.1883

Fix multiple bytecode set selection in the Spur 64-bit VM, which must use signedIntFromLong64 to test for a negative header.

In 1884 the Fabian Society is founded in London, Georges-Pierre Seurat paints Bathers at Asnières, and the eight-hour workday is first proclaimed by the Federation of Organized Trades and Labor Unions in the United States. This date, called May Day or Labour Day, becomes a holiday recognized in almost every industrialized country.

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

Item was changed:
  ----- Method: Cogit>>blockCreationBytecodeSizeForHeader: (in category 'method map') -----
  blockCreationBytecodeSizeForHeader: aMethodHeader
  	<inline: true>
  	^self cppIf: MULTIPLEBYTECODESETS
  		ifTrue:
+ 			[(objectMemory headerIndicatesAlternateBytecodeSet: aMethodHeader)
- 			[(coInterpreter headerIndicatesAlternateBytecodeSet: aMethodHeader)
  				ifTrue: [AltBlockCreationBytecodeSize]
  				ifFalse: [BlockCreationBytecodeSize]]
  		ifFalse: [BlockCreationBytecodeSize]!

Item was changed:
  ----- Method: Cogit>>bytecodeSetOffsetForHeader: (in category 'initialization') -----
  bytecodeSetOffsetForHeader: aMethodHeader
  	<inline: true>
  	^self
  		cppIf: MULTIPLEBYTECODESETS
  		ifTrue:
+ 			[(objectMemory headerIndicatesAlternateBytecodeSet: aMethodHeader)
- 			[(coInterpreter headerIndicatesAlternateBytecodeSet: aMethodHeader)
  				ifTrue: [256]
  				ifFalse: [0]]
  		ifFalse: [0]!

Item was removed:
- ----- Method: NewCoObjectMemory>>headerIndicatesAlternateBytecodeSet: (in category 'simulation') -----
- headerIndicatesAlternateBytecodeSet: methodHeader
- 	"this is here only for in-image compilation"
- 	<doNotGenerate>
- 	"A negative header selects the alternate bytecode set."
- 	^methodHeader signedIntFromLong < 0!

Item was changed:
  ----- Method: NewObjectMemory>>literalCountOfMethodHeader: (in category 'memory access') -----
+ literalCountOfMethodHeader: methodHeader
- literalCountOfMethodHeader: header
  	<api>
  	<inline: true>
+ 	self assert: (self isIntegerObject: methodHeader).
+ 	^(self headerIndicatesAlternateBytecodeSet: methodHeader)
+ 		ifTrue: [coInterpreter literalCountOfAlternateHeader: methodHeader]
+ 		ifFalse: [coInterpreter literalCountOfOriginalHeader: methodHeader]!
- 	self assert: (self isIntegerObject: header).
- 	^(coInterpreter headerIndicatesAlternateBytecodeSet: header)
- 		ifTrue: [coInterpreter literalCountOfAlternateHeader: header]
- 		ifFalse: [coInterpreter literalCountOfOriginalHeader: header]!

Item was added:
+ ----- Method: ObjectMemory>>headerIndicatesAlternateBytecodeSet: (in category 'method access') -----
+ headerIndicatesAlternateBytecodeSet: methodHeader
+ 	"A negative header selects the alternate bytecode set."
+ 	<api>
+ 	<inline: true>
+ 	^methodHeader signedIntFromLong < 0!

Item was added:
+ ----- Method: Spur32BitMemoryManager>>headerIndicatesAlternateBytecodeSet: (in category 'method access') -----
+ headerIndicatesAlternateBytecodeSet: methodHeader
+ 	"A negative header selects the alternate bytecode set."
+ 	<api>
+ 	<inline: true>
+ 	^methodHeader signedIntFromLong < 0!

Item was added:
+ ----- Method: Spur64BitMemoryManager>>headerIndicatesAlternateBytecodeSet: (in category 'method access') -----
+ headerIndicatesAlternateBytecodeSet: methodHeader
+ 	"A negative header selects the alternate bytecode set."
+ 	<api>
+ 	<inline: true>
+ 	^methodHeader signedIntFromLong64 < 0!

Item was added:
+ ----- Method: SpurMemoryManager>>headerIndicatesAlternateBytecodeSet: (in category 'method access') -----
+ headerIndicatesAlternateBytecodeSet: methodHeader
+ 	"A negative header selects the alternate bytecode set."
+ 	<api>
+ 	<inline: true>
+ 	self subclassResponsibility!

Item was changed:
  ----- Method: StackInterpreter>>encoderClassForHeader: (in category 'simulation') -----
  encoderClassForHeader: headerInteger
+ 	^Smalltalk classNamed: ((objectMemory headerIndicatesAlternateBytecodeSet: headerInteger)
- 	^Smalltalk classNamed: ((self headerIndicatesAlternateBytecodeSet: headerInteger)
  								ifTrue: [AltBytecodeEncoderClassName]
  								ifFalse: [BytecodeEncoderClassName])!

Item was changed:
  ----- Method: StackInterpreter>>longStoreBytecodeForHeader: (in category 'compiled methods') -----
  longStoreBytecodeForHeader: methodHeader
  	"Answer the relevant long store temp bytecode, which indicates it has a primitive error code."
  	"234		11101010	i i i i i i i i	Store Temporary Variable #iiiiiiii"
  	"129 		10000001 jjkkkkkk 	Store (Receiver Variable, Temporary Location, Illegal, Literal Variable) [jj] #kkkkkk"
  	<api>
  	<inline: true>
  	^self cppIf: MULTIPLEBYTECODESETS
+ 		ifTrue: [(objectMemory headerIndicatesAlternateBytecodeSet: methodHeader)
- 		ifTrue: [(self headerIndicatesAlternateBytecodeSet: methodHeader)
  					ifTrue: [AltLongStoreBytecode]
  					ifFalse: [LongStoreBytecode]]
  		ifFalse: [LongStoreBytecode]!

Item was changed:
  ----- Method: StackInterpreter>>methodHeaderHasPrimitive: (in category 'compiled methods') -----
  methodHeaderHasPrimitive: methodHeader
  	"Note: We now have 10 bits of primitive index, but they are in two places
  	 for temporary backward compatibility.  The time to unpack is negligible,
  	 since the derived primitive function pointer is stored in the method cache."
  	^objectMemory hasSpurMemoryManagerAPI
  		ifTrue: [self alternateHeaderHasPrimitiveFlag: methodHeader]
  		ifFalse:
  			[MULTIPLEBYTECODESETS
  				ifTrue:
+ 					[(objectMemory headerIndicatesAlternateBytecodeSet: methodHeader)
- 					[(self headerIndicatesAlternateBytecodeSet: methodHeader)
  						ifTrue: [self alternateHeaderHasPrimitiveFlag: methodHeader]
  						ifFalse: [methodHeader anyMask: V3PrimitiveBitsMask]]
  				ifFalse:
  					[methodHeader anyMask: V3PrimitiveBitsMask]]!

Item was changed:
  ----- Method: StackInterpreter>>methodUsesAlternateBytecodeSet: (in category 'internal interpreter access') -----
  methodUsesAlternateBytecodeSet: aMethodObj
  	<api>
  	<inline: true>
  	"A negative header selects the alternate bytecode set."
+ 	^objectMemory headerIndicatesAlternateBytecodeSet: (objectMemory methodHeaderOf: aMethodObj)!
- 	^self headerIndicatesAlternateBytecodeSet: (objectMemory methodHeaderOf: aMethodObj)!

Item was changed:
  ----- Method: StackInterpreter>>primitiveIndexOfMethod:header: (in category 'compiled methods') -----
  primitiveIndexOfMethod: theMethod header: methodHeader
+ 	"Note: With the Squeak V3 format we now have 10 bits of primitive index, but they are
+ 	 in two places for temporary backward compatibility.  The time to unpack is negligible,
+ 	 since the derived primitive function pointer is stored in the method cache.  With the
+ 	 Spur format we assume a 3-byte CallPrimitive with a little-endian 16-bit primitive index."
- 	"Note: With the Squeak V0 format we now have 10 bits of primitive index, but they are in
- 	 two places for temporary backward compatibility.  The time to unpack is negligible,
- 	 since the derived primitive function pointer is stored in the method cache.  With the new
- 	 format we assume a 3-byte CallPrimitive with a little-endian 16-bit primitive index."
  	<api>
  	<inline: true>
  	| firstBytecode |
  	^objectMemory hasSpurMemoryManagerAPI
  		ifTrue:
  			[(self alternateHeaderHasPrimitiveFlag: methodHeader)
  				ifTrue:
  					[firstBytecode := self firstBytecodeOfAlternateHeader: methodHeader method: theMethod.
  					 (objectMemory byteAt: firstBytecode + 1) + ((objectMemory byteAt: firstBytecode + 2) << 8)]
  				ifFalse:
  					[0]]
  		ifFalse:
  			[MULTIPLEBYTECODESETS
  				ifTrue:
+ 					[(objectMemory headerIndicatesAlternateBytecodeSet: methodHeader)
- 					[(self headerIndicatesAlternateBytecodeSet: methodHeader)
  						ifTrue:
  							[(self alternateHeaderHasPrimitiveFlag: methodHeader)
  								ifTrue:
  									[firstBytecode := self firstBytecodeOfAlternateHeader: methodHeader method: theMethod.
  									 (objectMemory byteAt: firstBytecode + 1) + ((objectMemory byteAt: firstBytecode + 2) << 8)]
  								ifFalse:
  									[0]]
  						ifFalse:
  							[| primBits |
  							 primBits := objectMemory integerValueOf: methodHeader.
  							 (primBits bitAnd: 16r1FF) + (primBits >> 19 bitAnd: 16r200)]]
  				ifFalse:
  					[| primBits |
  					 primBits := objectMemory integerValueOf: methodHeader.
  					 (primBits bitAnd: 16r1FF) + (primBits >> 19 bitAnd: 16r200)]]!

Item was changed:
  ----- Method: StackInterpreter>>setMethod:methodHeader: (in category 'internal interpreter access') -----
  setMethod: aMethodObj methodHeader: methodHeader
  	"Set the method and determine the bytecode set based on the method header's sign.
  	 If MULTIPLEBYTECODESETS then a negative header selects the alternate bytecode set.
  	 Conditionalizing the code on MULTIPLEBYTECODESETS allows the header sign bit to be
  	 used for other experiments."
  	<inline: true>
  	method := aMethodObj.
  	self assert: (objectMemory isOopCompiledMethod: method).
  	self assert: (objectMemory methodHeaderOf: method) = methodHeader.
  	self cppIf: MULTIPLEBYTECODESETS
+ 		ifTrue: [bytecodeSetSelector := (objectMemory headerIndicatesAlternateBytecodeSet: methodHeader)
- 		ifTrue: [bytecodeSetSelector := (self headerIndicatesAlternateBytecodeSet: methodHeader)
  											ifTrue: [256]
  											ifFalse: [0]]!

Item was changed:
  ----- Method: StackInterpreter>>sizeOfCallPrimitiveBytecode: (in category 'compiled methods') -----
  sizeOfCallPrimitiveBytecode: methodHeader
  	"Answer if the method starts with a long store temp bytecode, which indicates it has a primitive error code."
  	"249		11111001	i i i i i i i i	jjjjjjjj		Call Primitive #iiiiiiii + (jjjjjjjj * 256)"
  	<api>
  	<inline: true>
  	^objectMemory hasSpurMemoryManagerAPI
  		ifTrue: [3]
  		ifFalse:
  			[MULTIPLEBYTECODESETS
+ 				ifTrue: [(objectMemory headerIndicatesAlternateBytecodeSet: methodHeader)
- 				ifTrue: [(self headerIndicatesAlternateBytecodeSet: methodHeader)
  							ifTrue: [3]
  							ifFalse: [0]]
  				ifFalse: [0]]!



More information about the Vm-dev mailing list