The Trunk: Kernel-eem.1120.mcz

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

The Trunk: Kernel-eem.1120.mcz

commits-2
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1120.mcz

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

Name: Kernel-eem.1120
Author: eem
Time: 14 November 2017, 11:07:30.755794 am
UUID: 551316ae-8e01-489f-9a50-6d4a310f31d0
Ancestors: Kernel-mt.1119

Move the abstractBytecode acessing messages up to CompiledCode from CompiledMethod and provide CompiledCode>>abstractBytecodeMessagesAndPCs for convenient and thorough analysis of short methods.

=============== Diff against Kernel-mt.1119 ===============

Item was added:
+ ----- Method: CompiledCode>>abstractBytecodeMessageAt: (in category 'scanning') -----
+ abstractBytecodeMessageAt: pc
+ "Answer the abstract bytecode message at pc in the receiver."
+ ^[(InstructionStream new method: self pc: pc) interpretNextInstructionFor: nil]
+ on: MessageNotUnderstood
+ do: [:ex| ex message]!

Item was added:
+ ----- Method: CompiledCode>>abstractBytecodeMessagesAndPCs (in category 'scanning') -----
+ abstractBytecodeMessagesAndPCs
+ "Answer the receiver's sequence of abstract bytecodes as a sequence of tuples of bytecode mnessage and pc."
+ "(CompiledCode >> #abstractBytecodeMessagesAndPCs) abstractBytecodeMessagesAndPCs"
+ | msgs initial endpc pc scanner |
+ scanner := InstructionStream new method: self pc: (initial := self initialPC).
+ msgs := OrderedCollection new: (endpc  := self endPC) - initial.
+ [(pc := scanner pc) <= endpc] whileTrue:
+ [[scanner interpretNextInstructionFor: nil]
+ on: MessageNotUnderstood
+ do: [:ex| msgs addLast: { ex message. pc }]].
+ ^msgs!

Item was added:
+ ----- Method: CompiledCode>>abstractBytecodeMessagesDo: (in category 'scanning') -----
+ abstractBytecodeMessagesDo: aBlock
+ "Evaluate aBlock with the sequence of abstract bytecodes in the receiver"
+ self abstractBytecodeMessagesFrom: self initialPC
+ to: self endPC
+ do: aBlock
+
+ "| msgs |
+ msgs := OrderedCollection new.
+ CompiledCode >> #abstractBytecodeMessagesFrom:to: abstractBytecodeMessagesDo:
+ [:msg| msgs addLast: msg selector].
+ msgs"!

Item was added:
+ ----- Method: CompiledCode>>abstractBytecodeMessagesFrom:to:do: (in category 'scanning') -----
+ abstractBytecodeMessagesFrom: startpc to: endpc do: aBlock
+ "Evaluate aBlock with the sequence of abstract bytecodes from startpc through endpc in the receiver"
+ | scanner |
+ scanner := InstructionStream new method: self pc: startpc.
+ [scanner pc <= endpc] whileTrue:
+ [[scanner interpretNextInstructionFor: nil]
+ on: MessageNotUnderstood
+ do: [:ex| aBlock value: ex message]]
+
+ "| m msgs |
+ msgs := OrderedCollection new.
+ (m := CompiledCode >> #abstractBytecodeMessagesFrom:to:)
+ abstractBytecodeMessagesFrom: m initialPC
+ to: m endPC
+ do: [:msg| msgs add: msg selector].
+ msgs"!

Item was removed:
- ----- Method: CompiledMethod>>abstractBytecodeMessageAt: (in category 'scanning') -----
- abstractBytecodeMessageAt: pc
- "Answer the abstract bytecode message at pc in the receiver."
- ^[(InstructionStream new method: self pc: pc) interpretNextInstructionFor: nil]
- on: MessageNotUnderstood
- do: [:ex| ex message]!

Item was removed:
- ----- Method: CompiledMethod>>abstractBytecodeMessagesDo: (in category 'scanning') -----
- abstractBytecodeMessagesDo: aBlock
- "Evaluate aBlock with the sequence of abstract bytecodes in the receiver"
- self abstractBytecodeMessagesFrom: self initialPC
- to: self endPC
- do: aBlock
-
- "| msgs |
- msgs := OrderedCollection new.
- CompiledMethod >> #abstractBytecodeMessagesFrom:to: abstractBytecodeMessagesDo:
- [:msg| msgs add: msg selector].
- msgs"!

Item was removed:
- ----- Method: CompiledMethod>>abstractBytecodeMessagesFrom:to:do: (in category 'scanning') -----
- abstractBytecodeMessagesFrom: startpc to: endpc do: aBlock
- "Evaluate aBlock with the sequence of abstract bytecodes from startpc through endpc in the receiver"
- | scanner |
- scanner := InstructionStream new method: self pc: startpc.
- [scanner pc <= endpc] whileTrue:
- [[scanner interpretNextInstructionFor: nil]
- on: MessageNotUnderstood
- do: [:ex| aBlock value: ex message]]
-
- "| m msgs |
- msgs := OrderedCollection new.
- (m := CompiledMethod >> #abstractBytecodeMessagesFrom:to:)
- abstractBytecodeMessagesFrom: m initialPC
- to: m endPC
- do: [:msg| msgs add: msg selector].
- msgs"!