[squeak-dev] The Inbox: Compiler-ul.307.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Aug 25 20:48:03 UTC 2015

Levente Uzonyi uploaded a new version of Compiler to project The Inbox:

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

Name: Compiler-ul.307
Author: ul
Time: 25 August 2015, 10:47:14.444 pm
UUID: ace15cac-5bbf-48de-ac98-0254d5b8ff17
Ancestors: Compiler-ul.306

Set literal limit to 32767.

=============== Diff against Compiler-ul.306 ===============

Item was changed:
  ----- Method: Encoder>>allLiterals (in category 'results') -----
  	addedSelectorAndMethodClassLiterals ifFalse:
  		[addedSelectorAndMethodClassLiterals := true.
  		"Put the optimized selectors in literals so as to browse senders more easily"
  		optimizedSelectors := optimizedSelectors reject: [:e| literalStream originalContents hasLiteral: e].
  		optimizedSelectors isEmpty ifFalse: [
  			"Use one entry per literal if enough room, else make anArray"
+ 			literalStream position + optimizedSelectors size + 2 > 32767
- 			literalStream position + optimizedSelectors size + 2 > 255
  				ifTrue: [self litIndex: optimizedSelectors asArray]
  				ifFalse: [optimizedSelectors do: [:e | self litIndex: e]]].
  		"Add a slot for selector or MethodProperties"
  		self litIndex: nil.
  		self litIndex: self associationForClass].
  	^literalStream contents!

Item was changed:
  ----- Method: Encoder>>litIndex: (in category 'encoding') -----
  litIndex: literal
  	| p |
  	p := literalStream position.
+ 	p = 32767 ifTrue:
+ 		[self notify: 'More than 32767 literals referenced. 
- 	p = 256 ifTrue:
- 		[self notify: 'More than 256 literals referenced. 
  You must split or otherwise simplify this method.
+ The 32768th literal is: ', literal printString. ^nil].
- 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!

More information about the Squeak-dev mailing list