[squeak-dev] The Trunk: Compiler-mt.405.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Jul 24 09:17:04 UTC 2019


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

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

Name: Compiler-mt.405
Author: mt
Time: 24 July 2019, 11:17:04.167109 am
UUID: 7354b36e-2509-4f23-b110-1b9cfe0310d2
Ancestors: Compiler-mt.404

Adds message to avoid costly byte-code scanning for has-literal checks.

Note that ((... or: [...]) or: [...] ...) is a little bit faster to evaluate to false than (... or: [ ... or: [ ... ] ] ). I would suspect not but deeply nested blocks seem to have an interesting effect here.

=============== Diff against Compiler-mt.404 ===============

Item was added:
+ ----- Method: BytecodeEncoder class>>canBeSpecialLiteral: (in category 'testing') -----
+ canBeSpecialLiteral: aLiteral
+ 	"This check can be used to prevent unnecessary use of #scanBlockOrNilForLiteral:. For performance, this method summarizes specializations from all known bytecode encoders. It is not meant to be refined per encoder."
+ 	
+ 	^ ((((((aLiteral isSymbol and: [Smalltalk specialSelectors includes: aLiteral])
+ 		or: [aLiteral isInteger and: [aLiteral between: -32768 and: 32767]])
+ 		or: [aLiteral isCharacter and: [aLiteral asInteger <= 65535]])
+ 		or: [aLiteral == true])
+ 		or: [aLiteral == false])
+ 		or: [aLiteral == nil])!



More information about the Squeak-dev mailing list