[Pkg] The Trunk: Compiler-nice.200.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Mar 30 20:47:44 UTC 2011


Nicolas Cellier uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-nice.200.mcz

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

Name: Compiler-nice.200
Author: nice
Time: 30 March 2011, 10:47:39.106 pm
UUID: e97c15bd-d6b0-b648-9bde-fb0e2ffde315
Ancestors: Compiler-nice.199

minor ifNil refactoring

=============== Diff against Compiler-nice.199 ===============

Item was changed:
  ----- Method: BlockLocalTempCounter>>tempCountForBlockAt:in: (in category 'initialize-release') -----
  tempCountForBlockAt: pc in: method
  	"Compute the number of local temporaries in a block.
  	 If the block begins with a sequence of push: nil bytecodes then some of
  	 These could be initializing local temps.  We can only reliably disambuguate
  	 them from other uses of nil by parsing the stack and seeing what the offset
  	 of the stack pointer is at the end of the block.
  
  	 There are short-cuts.  The ones we take here are
  		- if there is no sequence of push nils there can be no local temps
  		- we follow forward jumps to shorten the amount of scanning"
  	stackPointer := 0.
  	scanner := InstructionStream new method: method pc: pc.
  	scanner interpretNextInstructionFor: self.
+ 	blockEnd ifNil:
- 	blockEnd isNil ifTrue:
  		[self error: 'pc is not that of a block'].
  	scanner nextByte = Encoder pushNilCode ifTrue:
  		[joinOffsets := Dictionary new.
  		 [scanner pc < blockEnd] whileTrue:
  			[scanner interpretNextInstructionFor: self]].
  	^stackPointer!

Item was changed:
  ----- Method: BlockLocalTempCounter>>testTempCountForBlockAt:in: (in category 'initialize-release') -----
  testTempCountForBlockAt: startPc in: method
  	"Compute the number of local temporaries in a block.
  	 If the block begins with a sequence of push: nil bytecodes then some of
  	 These could be initializing local temps.  We can only reliably disambuguate
  	 them from other uses of nil by parsing the stack and seeing what the offset
  	 of the stack pointer is at the end of the block.There are short-cuts.  The only
  	 one we take here is
  		- if there is no sequence of push nils there can be no local temps"
  
  	| symbolicLines line prior thePc |
  	symbolicLines := Dictionary new.
  	method symbolicLinesDo:
  		[:pc :lineForPC| symbolicLines at: pc put: lineForPC].
  	stackPointer := 0.
  	scanner := InstructionStream new method: method pc: startPc.
  	scanner interpretNextInstructionFor: self.
+ 	blockEnd ifNil:
- 	blockEnd isNil ifTrue:
  		[self error: 'pc is not that of a block'].
  	scanner nextByte = Encoder pushNilCode ifTrue:
  		[joinOffsets := Dictionary new.
  		 [scanner pc < blockEnd] whileTrue:
  			[line := symbolicLines at: scanner pc.
  			 prior := stackPointer.
  			 thePc := scanner pc.
  			 scanner interpretNextInstructionFor: self.
  			 Transcript cr; print: prior; nextPutAll: '->'; print: stackPointer;  tab; print: thePc; tab; nextPutAll: line; flush]].
  	^stackPointer!

Item was changed:
  ----- Method: Parser>>encoder (in category 'public access') -----
  encoder
+ 	^encoder ifNil:
+ 		[encoder := EncoderForV3PlusClosures new]!
- 	encoder isNil ifTrue:
- 		[encoder := EncoderForV3PlusClosures new].
- 	^encoder!

Item was changed:
  ----- Method: Parser>>encoderClass: (in category 'public access') -----
  encoderClass: anEncoderClass
+ 	encoder ifNotNil: [
+ 		self error: 'encoder already set'].
- 	encoder notNil ifTrue:
- 		[self error: 'encoder already set'].
  	encoder := anEncoderClass new!

Item was changed:
  ----- Method: RemoteTempVectorNode>>printDefinitionForClosureAnalysisOn: (in category 'printing') -----
  printDefinitionForClosureAnalysisOn: aStream 
  	| refs |
  	aStream
  		nextPut: ${;
  		nextPutAll: key.
  	definingScope ifNotNil: [definingScope blockExtent ifNotNil: [:be| aStream nextPutAll: ' d@'; print: be first]].
+ 	readingScopes ifNotNil: [
+ 		refs := Set new.
- 	readingScopes notNil ifTrue:
- 		[refs := Set new.
  		readingScopes do: [:elems| refs addAll: elems].
  		refs asSortedCollection do: [:read| aStream nextPutAll: ' r@'; print: read]].
  	remoteTemps
  		do: [:rt| rt printDefinitionForClosureAnalysisOn: aStream]
  		separatedBy: [aStream nextPut: $,; space].
  	aStream nextPut: $}!

Item was changed:
  ----- Method: TempVariableNode>>sizeCodeForLoad: (in category 'code generation') -----
  sizeCodeForLoad: encoder
+ 	^remoteNode
+ 		ifNil: [0]
+ 		ifNotNil: [remoteNode sizeCodeForLoadFor: self encoder: encoder]!
- 	^remoteNode isNil
- 		ifTrue: [0]
- 		ifFalse: [remoteNode sizeCodeForLoadFor: self encoder: encoder]!



More information about the Packages mailing list