[Pkg] The Trunk: System-eem.835.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Jul 6 01:13:57 UTC 2016


Eliot Miranda uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-eem.835.mcz

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

Name: System-eem.835
Author: eem
Time: 5 July 2016, 6:13:25.980763 pm
UUID: 44354df1-cecb-414c-a705-daa84b7388dd
Ancestors: System-eem.834

Fix reading methods from DataStreams on Spur.  Old code used pre-Spur numLits header format, and was not 64-bit aware.

=============== Diff against System-eem.834 ===============

Item was changed:
  ----- Method: DataStream>>readMethod (in category 'write and read') -----
  readMethod
  	"PRIVATE -- Read the contents of an arbitrary instance.
  	 ASSUMES: readDataFrom:size: sends me beginReference: after it
  	   instantiates the new object but before reading nested objects.
  	 NOTE: We must restore the current reference position after
  	   recursive calls to next.
  	Let the instance, not the class read the data.  "
  	| instSize refPosn newClass className xxHeader nLits byteCodeSizePlusTrailer newMethod lits |
  
  	instSize := (byteStream nextNumber: 4) - 1.
  	refPosn := self getCurrentReference.
  	className := self next.
  	newClass := Smalltalk at: className asSymbol.
  
  	xxHeader := self next.
  		"nArgs := (xxHeader >> 24) bitAnd: 16rF."
  		"nTemps := (xxHeader >> 18) bitAnd: 16r3F."
  		"largeBit := (xxHeader >> 17) bitAnd: 1."
+ 	nLits := xxHeader bitAnd: 16r7FFF.
+ 	byteCodeSizePlusTrailer := instSize - (newClass instSize "0") - (nLits + 1 * Smalltalk wordSize).
- 	nLits := (xxHeader >> 9) bitAnd: 16rFF.
- 		"primBits := ((xxHeader >> 19) bitAnd: 16r600) + (xxHeader bitAnd: 16r1FF)."
- 	byteCodeSizePlusTrailer := instSize - (newClass instSize "0") - (nLits + 1 * 4).
  
  	newMethod := newClass 
+ 						newMethod: byteCodeSizePlusTrailer
+ 						header: xxHeader.
- 		newMethod: byteCodeSizePlusTrailer
- 		header: xxHeader.
  
  	self setCurrentReference: refPosn.  "before readDataFrom:size:"
  	self beginReference: newMethod.
  	lits := newMethod numLiterals + 1.	"counting header"
  	2 to: lits do:
  		[:ii | newMethod objectAt: ii put: self next].
+ 	lits*Smalltalk wordSize+1 to: newMethod basicSize do:
- 	lits*4+1 to: newMethod basicSize do:
  		[:ii | newMethod basicAt: ii put: byteStream next].
  			"Get raw bytes directly from the file"
  	self setCurrentReference: refPosn.  "before returning to next"
+ 	^newMethod!
- 	^ newMethod!



More information about the Packages mailing list