[Pkg] The Trunk: Kernel-eem.690.mcz

commits at source.squeak.org commits at source.squeak.org
Sun May 20 18:47:15 UTC 2012


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

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

Name: Kernel-eem.690
Author: eem
Time: 20 May 2012, 11:45:51.817 am
UUID: 86741d23-9dcd-4c36-b86e-99d260c22445
Ancestors: Kernel-nice.689

Add Integer>hex8.  Arguablty this should be an extension in
VMMaker, but since hex isn't, this isn't either (historical).
Refactor CompiledMethodTrailer to allow subclasses to
instantiate classes other than CompiledMethod.
Add CompiledMethod>referredInstVars

=============== Diff against Kernel-nice.689 ===============

Item was added:
+ ----- Method: CompiledMethod>>referredInstVars (in category 'accessing') -----
+ referredInstVars
+ 	"Answer a Set of the inst var names the receiver accesses."
+ 	| allInstVarNames instVarNames |
+ 	allInstVarNames := self methodClass allInstVarNames.
+ 	self isReturnField ifTrue:
+ 		[^Set with: (allInstVarNames at: self returnField + 1)].
+ 	instVarNames := Set new.
+ 	self abstractBytecodeMessagesDo:
+ 		[:msg|
+ 		(#(#popIntoReceiverVariable:
+ 		    #pushReceiverVariable:
+ 		    #storeIntoReceiverVariable:) includes: msg selector) ifTrue:
+ 			[instVarNames add: (allInstVarNames at: msg argument + 1)]].
+ 	^instVarNames
+ 
+ 	"Dictionary newFromPairs: (Point selectors collect: [:s| { s. (Point >> s) referredInstVars}])"!

Item was added:
+ ----- Method: CompiledMethodTrailer>>compiledMethodClass (in category 'creating a method') -----
+ compiledMethodClass
+ 	"Allow subclasses to create instyances of classes other than CompiledMethod."
+ 
+ 	^CompiledMethod!

Item was changed:
  ----- Method: CompiledMethodTrailer>>createMethod:header: (in category 'creating a method') -----
  createMethod: numberOfBytesForAllButTrailer header: headerWord 
  	| meth |
+ 
  	encodedData ifNil: [ self encode ].
  	
+ 	"without >>self compiledMethodClass<<, subclassing CompiledMethod is duplicating code"
+ 	meth := self compiledMethodClass newMethod: numberOfBytesForAllButTrailer + size header: headerWord.
- 	meth := CompiledMethod newMethod: numberOfBytesForAllButTrailer + size header: headerWord.
  	
  	"copy the encoded trailer data"
  	
  	1 to: size do:
  		[:i | meth at: meth size - size + i put: (encodedData at: i)].
  
  	^ meth!

Item was added:
+ ----- Method: Integer>>hex8 (in category 'printing') -----
+ hex8
+ 	"Print the receiver in base 16 with prefixed base, using at least 8 digits.
+ 	 DO NOT CHANGE THIS!!  The Cog VMMaker depends on this.
+ 	 Consider using storeStringBase: 16 length: 11 padded: true instead."
+ 	  "16r3333 hex8"
+ 	| hex |
+ 	hex := self hex.  "16rNNN"
+ 	^hex size < 11
+ 		ifTrue: [hex copyReplaceFrom: 4 to: 3
+ 						 with: ('00000000' copyFrom: 1 to: 11-hex size)]
+ 		ifFalse: [hex]!



More information about the Packages mailing list