Marcel Taeumel uploaded a new version of Kernel to project The Trunk: http://source.squeak.org/trunk/Kernel-mt.1541.mcz
==================== Summary ====================
Name: Kernel-mt.1541 Author: mt Time: 15 December 2023, 3:29:07.110782 pm UUID: 2f6c785b-57d4-1545-8a57-2896c4ab2e27 Ancestors: Kernel-mt.1540
Fixes #literalsDo: performance (1 of 2).
=============== Diff against Kernel-mt.1540 ===============
Item was added: + ----- Method: CompiledCode>>allImplicitLiteralsDo: (in category 'literals') ----- + allImplicitLiteralsDo: aBlock + + self codeLiteralsDo: [:compiledCode | + compiledCode implicitLiteralsDo: aBlock].!
Item was added: + ----- Method: CompiledCode>>allLiteralsDo:scanForSpecial: (in category 'literals') ----- + allLiteralsDo: aBlock scanForSpecial: aBoolean + "Enumerate all literals thoroughly. Follow nested instances of CompiledCode. Do not treat compiled code as literals here." + + self codeLiteralsDo: [:compiledCode | + compiledCode literalsDo: [:literal | + literal isCompiledCode ifFalse: [literal allLiteralsDo: aBlock scanForSpecial: aBoolean] ]. + aBoolean ifTrue: [ "Enumerate special selectors/literals such as true/false." + compiledCode implicitLiteralsDo: aBlock] ].!
Item was added: + ----- Method: CompiledCode>>hasImplicitLiteral: (in category 'literals') ----- + hasImplicitLiteral: anImplicitLiteral + "Like #hasLiteral:, check thoroughly, whether anImplicitLiteral is in the receiver. See #allImplicitLiteralsDo:." + + self allImplicitLiteralsDo: [:lit | (lit literalEqual: anImplicitLiteral) ifTrue: [^ true]]. + ^ false!
Item was added: + ----- Method: Object>>allLiteralsDo:scanForSpecial: (in category 'literals') ----- + allLiteralsDo: aBlock scanForSpecial: aBoolean + "Backstop. Avoid bytecode scanning in CompiledCode and below. See #hasLiteral:scanForSpecial:." + + self allLiteralsDo: aBlock.!
Item was added: + ----- Method: Object>>hasLiteral:scanForSpecial: (in category 'literals') ----- + hasLiteral: literal scanForSpecial: aBoolean + + ^ self + hasLiteralSuchThat: [:lit | lit literalEqual: literal] + scanForSpecial: aBoolean!
Item was added: + ----- Method: Object>>hasLiteralSuchThat:scanForSpecial: (in category 'literals') ----- + hasLiteralSuchThat: testBlock scanForSpecial: aBoolean + "Backstop. Avoid bytecode scanning in CompiledCode and below. See #hasLiteral:scanForSpecial:." + + self + allLiteralsDo: [:literal | (testBlock value: literal) ifTrue: [^ true]] + scanForSpecial: aBoolean. + + ^ false!
packages@lists.squeakfoundation.org