[squeak-dev] The Trunk: Kernel-mt.1256.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Aug 14 09:47:11 UTC 2019


Marcel Taeumel uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-mt.1256.mcz

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

Name: Kernel-mt.1256
Author: mt
Time: 14 August 2019, 11:47:08.245475 am
UUID: d8d2cfa5-57d9-b24e-8173-811646541d8a
Ancestors: Kernel-mt.1255

Speed up #isDeprecated check to speed up browsing tools. Thanks to Levente to the hints!

=============== Diff against Kernel-mt.1255 ===============

Item was changed:
  ----- Method: CompiledMethod>>isDeprecated (in category 'testing') -----
  isDeprecated
+ 	"Note that #literalsDo: is faster than #hasLiteral: (and #hasLiteral:scanForSpecial:). We already know that 'self deprecated' should be the first statement in a deprecated method, which is directly accessible in this method's literals. No need to check compiled blocks or other nested structures. We expand the implementation of #literalsDo: here to gain twice the speed.
- 	"Note that #literalsDo: is faster than #hasLiteral: (and #hasLiteral:scanForSpecial:). We already know that 'self deprecated' should be the first statement in a deprecated method, which is directly accessible in this method's literals. No need to check compiled blocks or other nested structures.
  	
  	Note that both #isQuick and is-this-method check make no sense performance-wise. Maybe bench again in the future."
  	
+ 	| literal |
+ 	1 to: self numLiterals do: [:index |
+ 		((literal := self literalAt: index) == #deprecated: or: [ literal == #deprecated ])
+ 			ifTrue: [ ^true ] ].
- 	self literalsDo: [:literal |
- 		(#deprecated = literal or: [#deprecated: = literal])
- 			ifTrue: [^ true]].
  	^ false!



More information about the Squeak-dev mailing list