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

Levente Uzonyi leves at caesar.elte.hu
Sat Mar 3 12:50:45 UTC 2018


Hi Eliot,

On Tue, 27 Feb 2018, commits at source.squeak.org wrote:

> Eliot Miranda uploaded a new version of Kernel to project The Trunk:
> http://source.squeak.org/trunk/Kernel-eem.1154.mcz
>
> ==================== Summary ====================
>
> Name: Kernel-eem.1154
> Author: eem
> Time: 27 February 2018, 10:50:39.300209 am
> UUID: f403de94-416e-4740-a83c-7b74e1d00810
> Ancestors: Kernel-ul.1153
>
> Fix CompiledCode>>allLiterals for the FullBlockClosure regime.  Have CompiledBlock implement allSubLiterals for literals within a block and blocks nested within it.
>
> Have CompiledMethod>>hasLiteralSuchThat: recurse through compiled blocks to match its descent into arrays and method properties.
>
> Provide CompiledMethod>>scanForInstructionPattern: as a convenient wrapper for scanForInstructionSequence:
>
> =============== Diff against Kernel-ul.1153 ===============
>
> Item was added:
> + ----- Method: CompiledBlock>>hasLiteralSuchThat: (in category 'literals') -----
> + hasLiteralSuchThat: litBlock
> + 	"Answer true if litBlock returns true for any literal in this method, even if embedded in array structure."
> + 	2 to: self numLiterals do:
> + 		[:index | | lit |
> + 		lit := self objectAt: index.
> + 		((litBlock value: lit)
> + 		or: [(lit isArray or: [lit isCompiledBlock]) and: [lit hasLiteralSuchThat: litBlock]]) ifTrue:

Some literals don't understand #isCompiledBlock, so this method (and 
another one as well) raises an error now.
Changing #isCompiledBlock to #isCompiledCode works (out of 
CompiledCode subinstances only CompiledBlocks can be literals of methods) 
and would fix the method, but I wonder if the checks there are necessary 
at all.
Object implements #hasLiteralSuchThat:, so removing both the #isArray and 
the #isCompiledBlock/Code check would also fix the bug.
The method version introducing the #isArray guard has your initials in my 
image.

Should the checks be removed, or should the check be #isCompiledCode
instead of #isCompiledBlock (and then Object >> #hasLiteralSuchThat: may 
be deprecated/removed)?

Levente


More information about the Squeak-dev mailing list