[Pkg] The Trunk: Compiler-eem.259.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Apr 3 20:53:54 UTC 2013


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

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

Name: Compiler-eem.259
Author: eem
Time: 3 April 2013, 1:53:21.499 pm
UUID: 5bca5ca6-0cbc-4c06-959f-219d601b27c0
Ancestors: Compiler-eem.258

Fix literal duplication with special bindings for classes.
LiteralNode>>reserve: needs to use sharableLitIndex: if
it is a special binding.
The decompiler is still broken by Compiler-eem.258 for
v := SpecialBinding := expr.  But at least methods containing
globals are debuggable again.

=============== Diff against Compiler-eem.258 ===============

Item was changed:
  ----- Method: Encoder>>litIndex: (in category 'encoding') -----
  litIndex: literal
  	| p |
+ 	(literal isVariableBinding and: [literalStream originalContents identityIncludes: literal]) ifTrue:
+ 		[self halt].
  	p := literalStream position.
  	p = 256 ifTrue:
  		[self notify: 'More than 256 literals referenced. 
  You must split or otherwise simplify this method.
  The 257th literal is: ', literal printString. ^nil].
  		"Would like to show where it is in the source code, 
  		 but that info is hard to get."
  	literalStream nextPut: literal.
  	^ p!

Item was added:
+ ----- Method: LiteralNode>>reserve: (in category 'code generation') -----
+ reserve: encoder 
+ 	"If this is a yet unused literal of type -code, reserve it."
+ 
+ 	code < 0 ifTrue:
+ 		[index := key isVariableBinding "true if sending value[:] to a special binding"
+ 					ifTrue: [encoder sharableLitIndex: key]
+ 					ifFalse: [encoder litIndex: key].
+ 		 code := self code: index type: 0 - code]!

Item was changed:
  ----- Method: LiteralVariableNode>>sizeCodeForStore: (in category 'code generation') -----
  sizeCodeForStore: encoder
  	self reserve: encoder.
  	(key isVariableBinding and: [key isSpecialWriteBinding]) ifFalse:
  		[^encoder sizeStoreLiteralVar: index].
- 	code < 0 ifTrue:
- 		[self flag: #dubious.
- 		 self code: (self code: self index type: LdLitType)].
  	writeNode := encoder encodeSelector: #value:.
  	"On entry the stack has only the expression.  Push the binding,
  	 duplicate the expression, send #value: and pop."
  	^(encoder sizePushLiteral: index)
  	  + (encoder sizePushTempLong: 0) "we don't know yet, hence long, sigh..."
  	  + (writeNode sizeCode: encoder args: 1 super: false)
  	  + encoder sizePop!



More information about the Packages mailing list