[squeak-dev] The Trunk: Kernel-nice.967.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Nov 11 01:12:04 UTC 2015


Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice.967.mcz

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

Name: Kernel-nice.967
Author: nice
Time: 11 November 2015, 2:11:25.428 am
UUID: 9bbbcd71-f6ca-430c-a62a-246e0f21e2e4
Ancestors: Kernel-nice.966

Implement CompiledMethod>>withoutPrimitive because implementation is depending on CompiledMethod format which may change across VM versions, this method cannot be open-coded into Collection-Tests but obviously belongs to Kernel.

=============== Diff against Kernel-nice.966 ===============

Item was added:
+ ----- Method: CompiledMethod>>withoutPrimitive (in category 'converting') -----
+ withoutPrimitive
+ 	"Answers a copy of self without primitive call.
+ 	That may serve for example for testing fallback code."
+ 	
+ 	| copy skipPrimitiveCall |
+ 	self primitive = 0 ifTrue: [^self].
+ 	skipPrimitiveCall := 3.
+ 	copy := CompiledMethod 
+ 		newMethod: self basicSize - self initialPC + 1 - skipPrimitiveCall
+ 		header: (self header bitClear: 16r10000).
+ 	1 to: self numLiterals do: [:index| copy literalAt: index put: (self literalAt: index)].
+ 	self initialPC + skipPrimitiveCall to: self size do: [:index | copy at: index - skipPrimitiveCall put: (self at: index)].
+ 	copy postCopy.
+ 	^copy!



More information about the Squeak-dev mailing list