The Trunk: Tools-eem.789.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Tools-eem.789.mcz

commits-2
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]!