-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to show coverage based on Truffle ASTs
- Loading branch information
Showing
9 changed files
with
48 additions
and
4 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
src/TruffleSqueak-Utilities.package/CallTargetBrowser.class/instance/aboutToStyle..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
what to show | ||
aboutToStyle: aStyler | ||
^ self showCoverage not and: [ super aboutToStyle: aStyler ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
src/TruffleSqueak-Utilities.package/CallTargetBrowser.class/instance/showCoverage..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
showCoverage: anObject | ||
|
||
showCoverage := anObject. |
4 changes: 4 additions & 0 deletions
4
src/TruffleSqueak-Utilities.package/CallTargetBrowser.class/instance/showCoverage.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
showCoverage | ||
|
||
^ showCoverage ifNil: [ false ] |
21 changes: 21 additions & 0 deletions
21
...eak-Utilities.package/CallTargetBrowser.class/instance/sourceStringPrettifiedAndDiffed.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
message list | ||
sourceStringPrettifiedAndDiffed | ||
| text | | ||
text := super sourceStringPrettifiedAndDiffed. | ||
(self showCoverage and: [ contentsSymbol = #source ]) ifFalse: [ ^ text ]. | ||
currentCompiledMethod callTarget ifNotNil: [ :ct | | map nodes initialPC scanner client | | ||
map := DebuggerMethodMap forMethod: currentCompiledMethod. | ||
nodes := ct getRootNode executeBytecodeNode bytecodeNodes. | ||
initialPC := currentCompiledMethod initialPC. | ||
scanner := InstructionStream on: currentCompiledMethod. | ||
client := InstructionClient new. | ||
[ scanner pc <= currentCompiledMethod endPC ] whileTrue: [ | pc range attribute | | ||
pc := scanner pc. | ||
(scanner willSend or: [ scanner willReturn ]) ifTrue: [ | ||
range := map rangeForPC: pc in: currentCompiledMethod contextIsActiveContext: true. | ||
attribute := TextColor color: ( | ||
(nodes at: (1 + pc - initialPC)) | ||
ifNil: [ Color red ] ifNotNil: [ Color green ]) muchDarker. | ||
text addAttribute: attribute from: range first to: range last ]. | ||
scanner interpretNextInstructionFor: client ] ]. | ||
^ text |
4 changes: 4 additions & 0 deletions
4
src/TruffleSqueak-Utilities.package/CallTargetBrowser.class/instance/toggleCoverage.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
actions | ||
toggleCoverage | ||
self showCoverage: self showCoverage not. | ||
self changed: #contents |
2 changes: 1 addition & 1 deletion
2
...TruffleSqueak-Utilities.package/CallTargetBrowser.class/instance/updateListsAndCodeIn..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
self-updating | ||
updateListsAndCodeIn: aWindow | ||
super updateListsAndCodeIn: aWindow. | ||
self showingCallTargetInfo ifTrue: [ | ||
(self showingCallTargetInfo or: [ self showCoverage ]) ifTrue: [ | ||
self setContentsToForceRefetch. | ||
self contentsChanged ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters