[squeak-dev] The Trunk: Compiler-eem.380.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Mar 20 22:30:22 UTC 2018
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
|