The Trunk: Kernel-eem.1143.mcz

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

The Trunk: Kernel-eem.1143.mcz

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

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

Name: Kernel-eem.1143
Author: eem
Time: 11 January 2018, 12:46:50.669083 pm
UUID: 304608ac-b9d3-459b-813b-fd0c960a5911
Ancestors: Kernel-eem.1142

CompiledBlock>>numCopiedValues has utility

=============== Diff against Kernel-eem.1142 ===============

Item was added:
+ ----- Method: CompiledBlock>>numCopiedValues (in category 'accessing') -----
+ numCopiedValues
+ "Answer the number of copied values the receiver expects.
+ This is not fast as it is not expected to be needed from the
+ compiled block itself.  It is available cheaply from a block
+ closure for the method."
+
+ | locator scanner pc |
+ locator := BlockStartLocator new.
+ scanner := InstructionStream on: self outerCode.
+ [pc := scanner pc.
+ self == (scanner interpretNextInstructionFor: locator) ifTrue:
+ [^(self outerCode abstractBytecodeMessageAt: pc) arguments second].
+ scanner atEnd] whileFalse.
+ self error: 'cannot find the block creation bytecode for this compiled block in its outer code.'!