[Pkg] The Trunk: Kernel-eem.1135.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Jan 8 00:52:34 UTC 2018


Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1135.mcz

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

Name: Kernel-eem.1135
Author: eem
Time: 7 January 2018, 4:52:25.529759 pm
UUID: 51a9a0b5-8ab9-4ada-8030-ab0dd9bedf09
Ancestors: Kernel-eem.1134

Speed up some of the scanning methods in CompiledCode by cacheing encoderClass

=============== Diff against Kernel-eem.1134 ===============

Item was changed:
  ----- Method: CompiledCode>>abstractBytecodeMessagesAndPCs (in category 'scanning') -----
  abstractBytecodeMessagesAndPCs
  	"Answer the receiver's sequence of abstract bytecodes as a sequence of tuples of bytecode message and pc."
  	"(CompiledCode >> #abstractBytecodeMessagesAndPCs) abstractBytecodeMessagesAndPCs"
+ 	| msgs initial endpc pc scanner encoderClass |
- 	| msgs initial endpc pc scanner |
  	scanner := InstructionStream new method: self pc: (initial := self initialPC).
  	msgs := OrderedCollection new: (endpc  := self endPC) - initial.
+ 	encoderClass := self encoderClass.
  	[(pc := scanner pc) <= endpc] whileTrue:
+ 		"i.e. nil will not understand any message and so the exception block will collect all of them."
+ 		[[encoderClass interpretNextInstructionFor: nil in: scanner]
- 		[[scanner interpretNextInstructionFor: nil]
  			on: MessageNotUnderstood
  			do: [:ex| msgs addLast: { ex message. pc }]].
  	^msgs!

Item was changed:
  ----- Method: CompiledCode>>abstractBytecodeMessagesFrom:to:do: (in category 'scanning') -----
  abstractBytecodeMessagesFrom: startpc to: endpc do: aBlock
  	"Evaluate aBlock with the sequence of abstract bytecodes from startpc through endpc in the receiver"
+ 	| scanner encoderClass |
- 	| scanner |
  	scanner := InstructionStream new method: self pc: startpc.
+ 	encoderClass := self encoderClass.
  	[scanner pc <= endpc] whileTrue:
+ 		"i.e. nil will not understand any message and so the exception block will collect all of them."
+ 		[[encoderClass interpretNextInstructionFor: nil in: scanner]
- 		[[scanner interpretNextInstructionFor: nil]
  			on: MessageNotUnderstood
  			do: [:ex| aBlock value: ex message]]
  
  	"| m msgs |
  	 msgs := OrderedCollection new.
+ 	 (m := CompiledCode >> #abstractBytecodeMessagesFrom:to:do:)
- 	 (m := CompiledCode >> #abstractBytecodeMessagesFrom:to:)
  		abstractBytecodeMessagesFrom: m initialPC
  		to: m endPC
  		do: [:msg| msgs add: msg selector].
  	 msgs"!

Item was changed:
  ----- Method: CompiledMethod>>embeddedBlockClosures (in category 'closures') -----
  embeddedBlockClosures
+ 	| bms extractor scanner endPC encoderClass |
- 	| bms extractor scanner endPC |
  	bms := OrderedCollection new.
  	scanner := self scanner.
+ 	extractor := ClosureExtractor withAction: [:c| bms add: c] andScanner: scanner.
- 	extractor := ClosureExtractor withAction: [ :c | bms add: c ] andScanner: scanner.
  	endPC := self endPC.
+ 	encoderClass := self encoderClass.
+ 	[scanner pc <= endPC] whileTrue:
+ 		[encoderClass interpretNextInstructionFor: extractor in: scanner].
+ 	^bms!
- 	[ scanner pc <= endPC ] whileTrue: [ scanner interpretNextInstructionFor: extractor ].
- 	^ bms!



More information about the Packages mailing list