[squeak-dev] The Trunk: Compiler-eem.380.mcz

Tobias Pape Das.Linux at gmx.de
Fri Mar 23 14:03:43 UTC 2018


HI Eliot,

> On 23.03.2018, at 14:55, Eliot Miranda <eliot.miranda at gmail.com> wrote:
> 
> Hi Tobias,
> 
> as the commit comments says, you must first load Compiler-eem.379.  The update steam contains an update for it.  And its commit comment explains the issue:

Yes, I have 379 loaded,
no it does not help.

Reason: The class is reshaped before its methods are recompiled, hence 'addedSelectorAndMethodClassLiterals' is gone and nilled and throws a MustBeBoolean upon next use, wich is any kind of compilation, so the recompilation fails.

Best regards
	-Tobias



> 
> Name: Compiler-eem.379
> Author: eem
> Time: 20 March 2018, 3:27:27.12646 pm
> UUID: b3856f24-9d98-478a-936f-c6d24d667be4
> Ancestors: Compiler-eem.378
> 
> Add initialization of the Undeclared variable addedExtraLiterals which is soon to be a replacement for Encoder's addedSelectorAndMethodClassLiterals, a name which is now misleading given the new full block support.  By adding the initialization of the Undeclared variable the compiler is not broken as the instance variable is renamed and Encoder's methods are recompiled.
> 
> _,,,^..^,,,_ (phone)
> 
> On Mar 23, 2018, at 1:20 AM, Tobias Pape <Das.Linux at gmx.de> wrote:
> 
>> Hi Eliot,
>> 
>> 
>> loading .380  produces an error for me in #allLiterals.
>> 
>> I think this is because of the Encoder being used for changing the encoder?
>> we need a few thing here probably:
>>  1. remove .380
>>  2. a commit that _Adds_ the new inst var (iirc this is .379 already)
>>  3. an mcm for that (iirc this is .431.mcm)
>>  4. remove config .432.mcm
>>  5. a commit that _uses_ the new inst var
>>  6. an mcm for that (a _new_ .432.mcm)
>>  7. a commit that _Removes_ the old inst var.
>>  (8. maybe an mcm for that..)
>> 
>> Best regards
>> 	-Tobias
>> 
>> 
>> 
>> <Bildschirmfoto 2018-03-23 um 09.02.37.PNG>
>>> On 20.03.2018, at 23:30, commits at source.squeak.org wrote:
>>> 
>>> Eliot Miranda uploaded a new version of Compiler to project The Trunk:
>>> http://source.squeak.org/trunk/Compiler-eem.380.mcz
>>> 
>>> ==================== Summary ====================
>>> 
>>> Name: Compiler-eem.380
>>> Author: eem
>>> Time: 20 March 2018, 3:30:10.256928 pm
>>> UUID: 3133d60f-54b2-410e-92ae-ef5cc782ab9c
>>> Ancestors: Compiler-eem.379
>>> 
>>> Rename Encoder's addedSelectorAndMethodClassLiterals, a name which is now misleading given the new full block support, to addedExtraLiterals.  Requires Compiler-eem.379.
>>> 
>>> =============== Diff against Compiler-eem.379 ===============
>>> 
>>> Item was changed:
>>>  ----- Method: BytecodeEncoder>>allLiteralsForBlockMethod (in category 'results') -----
>>>  allLiteralsForBlockMethod
>>> + 	addedExtraLiterals ifFalse:
>>> + 		[addedExtraLiterals := true.
>>> - 	"N.B. addedSelectorAndMethodClassLiterals is a misnomer.  It should be something like
>>> - 	 addedImplicitLiterals or addedExtraLiterals."
>>> - 	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 >= self maxNumLiterals
>>>  				ifTrue: [self litIndex: optimizedSelectors asArray]
>>>  				ifFalse: [optimizedSelectors do: [:e | self litIndex: e]]].
>>>  		"Add a slot for outerCode"
>>>  		self litIndex: nil].
>>>  	^literalStream contents!
>>> 
>>> Item was changed:
>>>  ----- Method: BytecodeEncoder>>resetForFullBlockGeneration (in category 'code generation') -----
>>>  resetForFullBlockGeneration
>>>  	literalStream := WriteStream on: (Array new: 8).
>>> + 	addedExtraLiterals := false.
>>> - 	addedSelectorAndMethodClassLiterals := addedExtraLiterals := false.
>>>  	optimizedSelectors := Set new!
>>> 
>>> Item was changed:
>>>  ----- Method: BytecodeEncoder>>resetLiteralStreamForFullBlock (in category 'code generation') -----
>>>  resetLiteralStreamForFullBlock
>>>  	literalStream := WriteStream on: (Array new: 32).
>>> + 	addedExtraLiterals := false.
>>> - 	addedSelectorAndMethodClassLiterals := addedExtraLiterals := false.
>>>  	optimizedSelectors := Set new!
>>> 
>>> Item was changed:
>>>  ParseNode subclass: #Encoder
>>> + 	instanceVariableNames: 'scopeTable nTemps supered requestor class selector literalStream selectorSet litIndSet litSet sourceRanges globalSourceRanges addedExtraLiterals optimizedSelectors cue'
>>> - 	instanceVariableNames: 'scopeTable nTemps supered requestor class selector literalStream selectorSet litIndSet litSet sourceRanges globalSourceRanges addedSelectorAndMethodClassLiterals optimizedSelectors cue'
>>>  	classVariableNames: ''
>>>  	poolDictionaries: ''
>>>  	category: 'Compiler-Kernel'!
>>> 
>>>  !Encoder commentStamp: 'cwp 12/26/2012 23:29' prior: 0!
>>>  I encode names and literals into tree nodes with byte codes for the compiler. Byte codes for literals are not assigned until the tree-sizing pass of the compiler, because only then is it known which literals are actually needed. I also keep track of sourceCode ranges during parsing and code generation so I can provide an inverse map for the debugger.!
>>> 
>>> Item was changed:
>>>  ----- Method: Encoder>>allLiterals (in category 'results') -----
>>>  allLiterals
>>> + 	addedExtraLiterals ifFalse:
>>> + 		[addedExtraLiterals := true.
>>> - 	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 >= self maxNumLiterals
>>>  				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>>initScopeAndLiteralTables (in category 'initialize-release') -----
>>>  initScopeAndLiteralTables
>>> 
>>>  	scopeTable := StdVariables copy.
>>>  	litSet := StdLiterals copy.
>>>  	"comments can be left hanging on nodes from previous compilations.
>>>  	 probably better than this hack fix is to create the nodes afresh on each compilation."
>>>  	scopeTable do:
>>>  		[:varNode| varNode comment: nil].
>>>  	litSet do:
>>>  		[:varNode| varNode comment: nil].
>>>  	selectorSet := StdSelectors copy.
>>>  	litIndSet := Dictionary new: 16.
>>>  	literalStream := WriteStream on: (Array new: 32).
>>> + 	addedExtraLiterals := false.
>>> - 	addedSelectorAndMethodClassLiterals := addedExtraLiterals := false.
>>>  	optimizedSelectors := Set new!
>>> 
>>> 
>> 
>> 
> 



More information about the Squeak-dev mailing list