[squeak-dev] The Trunk: Kernel-eem.1209.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Jan 3 02:30:43 UTC 2019


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

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

Name: Kernel-eem.1209
Author: eem
Time: 2 January 2019, 6:30:39.793608 pm
UUID: 5524e880-035b-4429-a52f-72f66eb53756
Ancestors: Kernel-eem.1208

Provide a method that answers the nested block methods in a method compiled with full blocks.  This is somewhat similar to embeddedBlockClosures, but answers the CompiledBlock methods, not representative closures around them, and does not require interpreting code, merely recursively traversing CompiledCode literals.

=============== Diff against Kernel-eem.1208 ===============

Item was added:
+ ----- Method: CompiledMethod>>nestedBlockMethods (in category 'closures') -----
+ nestedBlockMethods
+ 	"Answer a collection of the block methods of blocks within the receiver, if any."
+ 	| nestedBlockMethods iterator |
+ 	nestedBlockMethods := OrderedCollection new.
+ 	iterator := [:m| | nLits |
+ 				nLits := m numLiterals.
+ 				2 to: (m isCompiledBlock ifTrue: [nLits] ifFalse: [nLits - 1]) do:
+ 					[:index | | lit |
+ 					lit := m objectAt: index.
+ 					lit isCompiledCode ifTrue:
+ 						[iterator value: (nestedBlockMethods add: lit)]]].
+ 	iterator value: self.
+ 	^nestedBlockMethods
+ !



More information about the Squeak-dev mailing list