-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
current todos and challenges: * without #86, we cannot compare multiple proxies on the same object for different time indices * in general, performance! with #86, comparing two proxies would trigger simCustomizationLevel = 2! but even without that problem, it might be very slow * more proxy problems when trying to manually compare objects (because proxies often consist of shared memory slices) * add tests, also for publicCoalesce:, and deduplicate coalescion
- Loading branch information
Showing
12 changed files
with
83 additions
and
4 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
packages/TraceDebugger.package/Form.extension/instance/tdbContentEquals..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,8 @@ | ||
*TraceDebugger-UI-comparing | ||
tdbContentEquals: anotherObject | ||
|
||
(self class = Form and: [anotherObject class = Form]) | ||
ifFalse: [^ self = anotherObject]. | ||
|
||
^ {self width. self height. self offset. self bits} | ||
= {anotherObject width. anotherObject height. anotherObject offset. anotherObject bits} |
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
packages/TraceDebugger.package/Object.extension/instance/tdbContentEquals..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 @@ | ||
*TraceDebugger-UI-comparing | ||
tdbContentEquals: anotherObject | ||
|
||
^ self = anotherObject |
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
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
6 changes: 6 additions & 0 deletions
6
packages/TraceDebugger.package/TDBMaybeResult.class/instance/tdbContentEquals..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,6 @@ | ||
comparing | ||
tdbContentEquals: anotherObject | ||
|
||
self class = anotherObject class ifFalse: [^ false]. | ||
^ (self error tdbContentEquals: anotherObject error) | ||
and: [self result tdbContentEquals: anotherObject result] |
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
37 changes: 37 additions & 0 deletions
37
packages/TraceDebugger.package/TDBMemorySlice.class/instance/publicCoalesce..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,37 @@ | ||
private | ||
publicCoalesce: equalBlock | ||
"Evaluate equalBlock with each overlapping pair of the receiver's raw values. If the block answers true for a pair, replace the second one with the first one. See also #basicCondense: for preserving all values in a nested slice." | ||
|
||
| coalescedIntervals coalescedRawValues lastInterval lastValue index | | ||
coalescedIntervals := nil. | ||
lastInterval := nil. | ||
lastValue := Object new. | ||
index := 0. | ||
self timesAndValuesDo: [:interval :value | | ||
(lastInterval notNil | ||
and: | ||
[interval isEmpty | ||
or: | ||
[lastInterval stop + 1 = interval start and: | ||
[equalBlock value: lastValue value: value]]]) | ||
ifTrue: | ||
[coalescedIntervals ifNil: | ||
[coalescedIntervals := (Array new: intervals size) writeStream. | ||
coalescedRawValues := (Array new: rawValues size) writeStream. | ||
coalescedIntervals next: index putAll: intervals startingAt: 1. | ||
coalescedRawValues next: index putAll: rawValues startingAt: 1]. | ||
lastInterval := lastInterval start to: interval stop] | ||
ifFalse: | ||
[lastInterval isEmptyOrNil ifFalse: | ||
[coalescedIntervals ifNotNil: | ||
[coalescedIntervals nextPut: lastInterval. | ||
coalescedRawValues nextPut: lastValue tdbproxyYourself]. | ||
index := index + 1]. | ||
lastInterval := interval. | ||
lastValue := value]]. | ||
coalescedIntervals ifNotNil: | ||
[lastInterval isEmptyOrNil ifFalse: | ||
[coalescedIntervals nextPut: lastInterval. | ||
coalescedRawValues nextPut: lastValue tdbproxyYourself]. | ||
intervals := coalescedIntervals contents. | ||
rawValues := coalescedRawValues contents]. |
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
5 changes: 5 additions & 0 deletions
5
packages/TraceDebugger.package/Text.extension/instance/tdbContentEquals..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,5 @@ | ||
*TraceDebugger-UI-comparing | ||
tdbContentEquals: anotherObject | ||
|
||
self = anotherObject ifFalse: [^ false]. | ||
^ self runs = anotherObject runs |
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