Squeak 4.6: Kernel-nice.936.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Squeak 4.6: Kernel-nice.936.mcz

commits-2
Nicolas Cellier uploaded a new version of Kernel to project Squeak 4.6:
http://source.squeak.org/squeak46/Kernel-nice.936.mcz

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

Name: Kernel-nice.936
Author: nice
Time: 11 November 2015, 2:05:09.037 am
UUID: 5d8bccd0-d938-4889-abd1-0506c6942a49
Ancestors: Kernel-topa.935

Implement CompiledMethod>>withoutPrimitive because implementation is depending on object memory format, this method cannot be open-coded into Collection-Tests but obviously belongs to Kernel.

=============== Diff against Kernel-topa.935 ===============

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 header skipPrimitiveCall |
+ self primitive = 0 ifTrue: [^self].
+ header := self header.
+ skipPrimitiveCall := header < 0
+ ifTrue: [3]
+ ifFalse: [0].
+ copy := CompiledMethod
+ newMethod: self basicSize - self initialPC + 1 - skipPrimitiveCall
+ header: (header < 0
+ ifTrue: [header bitClear: 16r10000]
+ ifFalse: [header - (header bitAnd: 16r1FF) - (header bitAnd: 16r200 << 19)]).
+ 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!