Eliot Miranda uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-eem.789.mcz
==================== Summary ====================
Name: Tools-eem.789
Author: eem
Time: 11 January 2018, 8:46:29.072557 am
UUID: 65359207-9312-4a75-bd18-d59c7f3f0ae2
Ancestors: Tools-eem.788
Move CompiledMethod>>startpcsToBlockExtents and its support machinery to Compiler; it is used both by the Decompiler and the Debugger and so belongs in Compiler, not in Tools.
=============== Diff against Tools-eem.788 ===============
Item was removed:
- ----- Method: CompiledMethod>>blockExtentsInto:from:to:scanner:numberer: (in category '*Tools-Debugger-support') -----
- blockExtentsInto: aDictionary from: initialPC to: endPC scanner: scanner numberer: numbererBlock
- "Support routine for startpcsToBlockExtents"
- | extentStart blockSizeOrLocator |
- self flag: 'belongs in DebuggerMethodMap'.
- extentStart := numbererBlock value.
- [scanner pc <= endPC] whileTrue:
- [blockSizeOrLocator := scanner interpretNextInstructionFor: BlockStartLocator new.
- blockSizeOrLocator isInteger ifTrue:
- [self
- blockExtentsInto: aDictionary
- from: scanner pc
- to: scanner pc + blockSizeOrLocator - 1
- scanner: scanner
- numberer: numbererBlock]].
- aDictionary at: initialPC put: (extentStart to: numbererBlock value).
- ^aDictionary!
Item was removed:
- ----- Method: CompiledMethod>>startpcsToBlockExtents (in category '*Tools-Debugger-support') -----
- startpcsToBlockExtents
- "Answer a Dictionary of startpc to Interval of blockExtent, using the
- identical numbering scheme described in and orchestrated by
- BlockNode>>analyseArguments:temporaries:rootNode:. This is
- used in part to find the temp names for any block in a method, as
- needed by the debugger. The other half is to recompile the method,
- obtaining the temp names for each block extent. By indirecting through
- the blockExtent instead of using the startpc directly we decouple the
- debugger's access to temp names from the exact bytecode; insulating
- debugging from minor changes in the compiler (e.g. changes in literal
- pooling, adding prefix bytecodes, adding inst vars to CompiledMethod
- in literals towards the end of the literal frame, etc). If the recompilation
- doesn't produce exactly the same bytecode at exactly the same offset
- no matter; the blockExtents will be the same."
- | index |
- self flag: 'belongs in DebuggerMethodMap'.
- index := 0.
- ^self
- blockExtentsInto: Dictionary new
- from: self initialPC
- to: self endPC
- scanner: (InstructionStream on: self)
- numberer: [| value | value := index. index := index + 2. value]!
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1140.mcz
==================== Summary ====================
Name: Kernel-eem.1140
Author: eem
Time: 11 January 2018, 8:44:39.290013 am
UUID: d361ade6-5039-4edf-9782-a6baef35212c
Ancestors: Kernel-eem.1139
Move CompiledMethod>>startpcsToBlockExtents and its support machinery to Compiler; it is used both by the Decompiler and the Debugger and so belongs in Compiler, not in Tools.
=============== Diff against Kernel-eem.1139 ===============
Item was removed:
- InstructionClient subclass: #BlockStartLocator
- instanceVariableNames: ''
- classVariableNames: ''
- poolDictionaries: ''
- category: 'Kernel-Methods'!
Item was removed:
- ----- Method: BlockStartLocator>>pushClosureCopyNumCopiedValues:numArgs:blockSize: (in category 'instruction decoding') -----
- pushClosureCopyNumCopiedValues: numCopied numArgs: numArgs blockSize: blockSize
- "Answer the size of the block"
- ^blockSize!
Item was removed:
- ----- Method: BlockStartLocator>>pushFullClosure:numCopied: (in category 'instruction decoding') -----
- pushFullClosure: aCompiledBlock numCopied: numCopied
- "Answer the block method"
- ^aCompiledBlock!
Eliot Miranda uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-eem.370.mcz
==================== Summary ====================
Name: Compiler-eem.370
Author: eem
Time: 11 January 2018, 8:41:19.10862 am
UUID: 277f856e-2abf-452c-a5e0-84d00819a04d
Ancestors: Compiler-eem.369
Move CompiledMethod>>startpcsToBlockExtents and its support machinery to Compiler; it is used both by the Decompiler and the Debugger and so belongs in Compiler, not in Tools.
=============== Diff against Compiler-eem.369 ===============
Item was changed:
InstructionClient subclass: #BlockLocalTempCounter
instanceVariableNames: 'stackPointer scanner blockEnd joinOffsets'
classVariableNames: ''
poolDictionaries: ''
category: 'Compiler-Support'!
+ !BlockLocalTempCounter commentStamp: 'eem 1/11/2018 08:30' prior: 0!
+ I am a support class for the decompiler that is used to find the number of local temps in a block by finding out what the stack offset is at the end of a block. I am necessary because in the EncoderForV3PlusClosures bytecode set the only way to initialize block-local temporaries is with pushConstant: nil bytecodes, but such bytecodes are ambiguous with a pushConstant: nil used to pass nil as a parameter or answer it as a result. By scanning through to the end of the block these can be disambiguated by tracking the stack depth.!
- !BlockLocalTempCounter commentStamp: '<historical>' prior: 0!
- I am a support class for the decompiler that is used to find the number of local temps in a block by finding out what the stack offset is at the end of a block.!
Item was added:
+ InstructionClient subclass: #BlockStartLocator
+ instanceVariableNames: ''
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'Compiler-Support'!
+
+ !BlockStartLocator commentStamp: 'eem 1/11/2018 08:32' prior: 0!
+ A BlockStartLocator is a scanner that locates the block creation bytecodes in a method. For block creation bytecodes it answers information salient to the kind of block being created, and for all other bytecodes simply answers itself.
+
+ Instance Variables
+ !
Item was added:
+ ----- Method: BlockStartLocator>>pushClosureCopyNumCopiedValues:numArgs:blockSize: (in category 'instruction decoding') -----
+ pushClosureCopyNumCopiedValues: numCopied numArgs: numArgs blockSize: blockSize
+ "Answer the size of the block"
+ ^blockSize!
Item was added:
+ ----- Method: BlockStartLocator>>pushFullClosure:numCopied: (in category 'instruction decoding') -----
+ pushFullClosure: aCompiledBlock numCopied: numCopied
+ "Answer the block method"
+ ^aCompiledBlock!
Item was added:
+ ----- Method: CompiledMethod>>blockExtentsInto:from:to:scanner:numberer: (in category '*Compiler-support') -----
+ blockExtentsInto: aDictionary from: initialPC to: endPC scanner: scanner numberer: numbererBlock
+ "Support routine for startpcsToBlockExtents"
+ | extentStart blockSizeOrLocator |
+ extentStart := numbererBlock value.
+ [scanner pc <= endPC] whileTrue:
+ [blockSizeOrLocator := scanner interpretNextInstructionFor: BlockStartLocator new.
+ blockSizeOrLocator isInteger ifTrue:
+ [self
+ blockExtentsInto: aDictionary
+ from: scanner pc
+ to: scanner pc + blockSizeOrLocator - 1
+ scanner: scanner
+ numberer: numbererBlock]].
+ aDictionary at: initialPC put: (extentStart to: numbererBlock value).
+ ^aDictionary!
Item was added:
+ ----- Method: CompiledMethod>>startpcsToBlockExtents (in category '*Compiler-support') -----
+ startpcsToBlockExtents
+ "Answer a Dictionary of startpc to Interval of blockExtent, using the
+ identical numbering scheme described in and orchestrated by
+ BlockNode>>analyseArguments:temporaries:rootNode:. This is used
+ to find the temp names for any block in a method, as needed by the
+ decompiler and debugger. By indirecting through the blockExtent
+ instead of using the startpc directly we decouple access to temp
+ names from the exact bytecode; insulating the decompiler and
+ debugger from minor changes in the compiler's output. If the
+ recompilation doesn't produce exactly the same bytecode at exactly
+ the same offset no matter; the blockExtents will be the same."
+ | index |
+ index := 0.
+ ^self
+ blockExtentsInto: Dictionary new
+ from: self initialPC
+ to: self endPC
+ scanner: (InstructionStream on: self)
+ numberer: [| value | value := index. index := index + 2. value]!
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1139.mcz
==================== Summary ====================
Name: Kernel-eem.1139
Author: eem
Time: 10 January 2018, 5:37:26.591853 pm
UUID: 54bd97b7-0152-4647-b109-78c294afc74e
Ancestors: Kernel-eem.1138
Add CompiledBlock>>pragmaAt:. Make the accessors that defer to the home mehtod use homeMehtod instaed of chaining through outerCode. The stack depth is one less as a result.
=============== Diff against Kernel-eem.1138 ===============
Item was changed:
----- Method: CompiledBlock>>encoderClass (in category 'accessing') -----
encoderClass
"Answer the encoder class that encoded the bytecodes in this method.
The sign flag bit is used by the VM to select a bytecode set. This formulation
may seem odd but this has to be fast, so no property probe unless needed."
^self header >= 0
ifTrue:
[PrimaryBytecodeSetEncoderClass]
ifFalse:
[PrimaryBytecodeSetEncoderClass == SecondaryBytecodeSetEncoderClass
ifTrue: "Support for testing prior to installing another set"
+ [(self homeMethod propertyValueAt: #encoderClass) ifNil: [SecondaryBytecodeSetEncoderClass]]
- [(self outerCode propertyValueAt: #encoderClass) ifNil: [SecondaryBytecodeSetEncoderClass]]
ifFalse:
[SecondaryBytecodeSetEncoderClass]]!
Item was changed:
----- Method: CompiledBlock>>holdsTempNames (in category 'source code management') -----
holdsTempNames
+ ^self homeMethod holdsTempNames!
- ^self outerCode holdsTempNames!
Item was changed:
----- Method: CompiledBlock>>methodClass (in category 'accessing') -----
methodClass
"Answer the class that I am installed in."
+ ^self homeMethod methodClass!
- | outerCodeOrMethodClassAssoc |
- outerCodeOrMethodClassAssoc := self outerCode.
- outerCodeOrMethodClassAssoc isVariableBinding ifTrue:
- [self assert: outerCodeOrMethodClassAssoc value isBehavior.
- ^outerCodeOrMethodClassAssoc value].
- ^outerCodeOrMethodClassAssoc methodClass!
Item was changed:
----- Method: CompiledBlock>>methodForDecompile (in category 'decompiling') -----
methodForDecompile
+ ^self homeMethod methodForDecompile!
- ^self outerCode methodForDecompile!
Item was changed:
----- Method: CompiledBlock>>methodNode (in category 'accessing') -----
methodNode
+ ^ self homeMethod methodNode!
- ^ self outerCode methodNode!
Item was added:
+ ----- Method: CompiledBlock>>pragmaAt: (in category 'accessing-pragmas & properties') -----
+ pragmaAt: aKey
+ "Answer the pragma with selector aKey, or nil if none."
+ ^self homeMethod pragmaAt: aKey!
Item was changed:
----- Method: CompiledBlock>>selector (in category 'accessing') -----
selector
+ ^ self homeMethod selector!
- ^ self outerCode selector!
Hi,
For a while I've been using an old version of Squeak so recently I decided
to update and I downloaded Squeak 5.1.
First of all, let me tell you I really like what you have done. I haven't
been following the list too much lately so I'm only scratching the surface
but this new Squeak looks and feels *really* nice. And most of my
preferences are already set by default so I don't have to mess around with
the settings too much. Really nice work, thank you.
One thing I noticed while I was playing with the SerialPort is that it
doesn't work if I refer to the ports by name (I'm using Windows 10, by the
way). This used to work in the old VM so I looked in the source code and it
seems the primitives that allow to use port names are only compiled for
Pharo:
https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/9d39149b257141914497…
So I downloaded the PharoVM and indeed the SerialPort works fine with port
names. Is there a reason for this or is it just a bug?
Thanks,
Richo
Hi all,
When Clément and I recently talked about the next VM release, we thought it
might be good to organize a meeting and invite everyone who would be
interested. The agenda is yet to be finalized, but I think it would be
great if Clément and/or Eliot could give an update on their work on Sista.
And I could give an overview of what still needs to be done for the release
or how we plan to sign and update the release bundles. I'm sure there is a
lot more we can talk about.
If you would like to attend, please indicate your availability using this
Doodle link by Sunday, 14th January:
https://doodle.com/poll/cyei4ax4sd43m522.
Looking forward to seeing you all soon.
Best,
Fabio
I just had to commit a small change to this method to prevent it mangling filenames inappropriately but in the process it struck me that this is a bit of a weird bit of code.
For a start there isn’t any point to the split around byte or wide string for the filename extension since the same result is used now - from the commented out bits we can see what used to happen. It makes it pretty clear that the FileStream>multiCs & multiSt are pointless anyway. Nobody sends them.
Then the explicit playing with the text convertor appears pointless too, since the MultiByteFileStream code handles that.
And so far as I can work out nobody actually does anything with the whole html flag part - the sole effect seems to be the file extension and no conversion to html formatted contents is even attempted.
Does anyone remember why this rather complicated method was needed, and if it really still is? A much simpler version of the code seems to do the right thing but I’m no expert in the i18n arena (the middle-finger emoji is deliberately in that comment to try to trigger the multibyte handling) -
writeSourceCodeFrom: aStream baseName: baseName isSt: stOrCsFlag useHtml: useHtml
"Write the source code from aStream into a file.'foo $🖕'"
| extension fileName |
stOrCsFlag ifTrue: [
extension := (FileDirectory dot, FileStream st).
] ifFalse: [
extension := (FileDirectory dot, FileStream cs).
].
useHtml ifTrue: [extension := FileDirectory dot, 'html'].
fileName := (self class baseNameFor: baseName) , extension. "oh, for a decent file name system"
self newFileNamed: fileName do:[:f|
f nextPutAll: aStream contents]
tim
--
tim Rowledge; tim(a)rowledge.org; http://www.rowledge.org/tim
I'm so skeptical that I'm not sure I'm really a skeptic
As part of my quest to improve the file related dialogs I had to deprecate quite a few methods. Currently I’ve moved all of them (I think!) to a package ‘60Deprecated’, which may or may not be the right one. If it isn’t which is?
It would be nice if someone with a firm grip on the subject could spend a few minutes updating the swiki page - http://wiki.squeak.org/squeak/3940
- to give people like me a better view of what to do.
Further, whilst looking for all the places where I might have deprecated stuff I noticed quite a few methods marked with
self flag: #deprecated instead of self deprecated: ‘explanation of why and what to use instead’. And a some simply marked with self deprecated, with no sort of hint about why. It *looks* like pretty much all of them are marked ‘mt' or ‘topa', so if you folks could spend five minutes to update them a little it would help with deciding what to do for the next release.
tim
--
tim Rowledge; tim(a)rowledge.org; http://www.rowledge.org/tim
Semolina - a system of signalling with pudding.