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

commits at source.squeak.org commits at source.squeak.org
Wed Jul 24 09:18:00 UTC 2019


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

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

Name: Kernel-mt.1249
Author: mt
Time: 24 July 2019, 11:17:56.945109 am
UUID: 5eb63b7e-5e78-45cf-a338-98326b5f26a4
Ancestors: Kernel-fn.1248

Uses special-literal check from Compiler-mt.405 to speed up #hasLiteral:.

=============== Diff against Kernel-fn.1248 ===============

Item was changed:
  ----- Method: CompiledCode>>hasLiteral: (in category 'literals') -----
  hasLiteral: aLiteral
+ 	"Overwrite this method to invoke the bytecode encoder scanner explicitely. This might be removed if there would be a way to enumerate special literals in a compiled-code object. See #allLiteralsDo:."
- 	"Since we cannot enumerate this code's special literals, we have to overwrite this method to invoke the encoder scanner explicitely."
  
+ 	^ self
+ 		hasLiteral: aLiteral
+ 		scanForSpecial: (BytecodeEncoder canBeSpecialLiteral: aLiteral)!
- 	| scanBlock |
- 	(super hasLiteral: aLiteral) ifTrue: [^ true].
- 
- 	scanBlock := self class
- 		scanBlocksForLiteral: aLiteral
- 		do: [:primaryScanner :secondaryScanner |
- 			"E.g., scanner for SistaV1 or scanner for V3PlusClosures"
- 			self signFlag ifTrue: [secondaryScanner] ifFalse: [primaryScanner]].
- 	
- 	self codeLiteralsDo: [:compiledCode |
- 		(compiledCode scanFor: scanBlock) ifTrue: [^ true]].
- 
- 	^ false!

Item was added:
+ ----- Method: CompiledCode>>hasLiteral:scanForSpecial: (in category 'literals') -----
+ hasLiteral: aLiteral scanForSpecial: aBoolean
+ 	"Like #hasLiteral: but can scan for encoder-specific special literals. Not that scanning has a noticeable performance impact."
+ 
+ 	| scanBlock |
+ 	(super hasLiteral: aLiteral) ifTrue: [^ true].
+ 	
+ 	aBoolean ifFalse: [^ false].
+ 
+ 	scanBlock := self class
+ 		scanBlocksForLiteral: aLiteral
+ 		do: [:primaryScanner :secondaryScanner |
+ 			"E.g., scanner for SistaV1 or scanner for V3PlusClosures"
+ 			self signFlag ifTrue: [secondaryScanner] ifFalse: [primaryScanner]].
+ 	
+ 	self codeLiteralsDo: [:compiledCode |
+ 		(compiledCode scanFor: scanBlock) ifTrue: [^ true]].
+ 
+ 	^ false!



More information about the Squeak-dev mailing list