[squeak-dev] The Trunk: Compiler-mt.406.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Jul 24 15:10:22 UTC 2019
Marcel Taeumel uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-mt.406.mcz
==================== Summary ====================
Name: Compiler-mt.406
Author: mt
Time: 24 July 2019, 5:10:22.611145 pm
UUID: 6d65ea45-4488-471b-a9cf-b4a16cac35f3
Ancestors: Compiler-mt.405
Minor performance improvement for has-literal checks. Thanks to Levente for the ideas!
Still not sure about putting true/false/nil-checks to the top. Also not sure the complex return blocks for symbol/character/integer.
=============== Diff against Compiler-mt.405 ===============
Item was changed:
----- 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 bytecode encoder."
- "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 ifTrue: [^ Smalltalk specialSelectors identityIncludes: aLiteral].
+ aLiteral isCharacter ifTrue: [^ aLiteral asInteger <= 65535].
+ aLiteral isInteger ifTrue: [^ aLiteral between: -32768 and: 32767].
+
+ aLiteral == true ifTrue: [^ true].
+ aLiteral == false ifTrue: [^ true].
+ aLiteral == nil ifTrue: [^ true].
+
+ ^ false!
- ^ ((((((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
|