Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*SimulationStudio-Support-tracking
trackingFrom: aContext argAt: argIndex

^ TrackedObject tracking: self from: aContext argAt: argIndex
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*SimulationStudio-Support-tracking
trackingFrom: aContext instVarAt: instVarIndex

^ TrackedObject tracking: self from: aContext instVarAt: instVarIndex
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*SimulationStudio-Support-tracking
trackingFrom: aContext tempVarAt: tempVarIndex

^ TrackedObject tracking: self from: aContext tempVarAt: tempVarIndex
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*SimulationStudio-Support-tracking
trackingReceiverFrom: aContext

^ TrackedObject trackingReceiver: self from: aContext
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*SimulationStudio-Support-tracking
untracking

^ self
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"class" : {
},
"instance" : {
"trackingFrom:argAt:" : "ct 3/21/2022 22:53",
"trackingFrom:instVarAt:" : "ct 3/21/2022 22:35",
"trackingFrom:tempVarAt:" : "ct 3/21/2022 22:34",
"trackingReceiverFrom:" : "ct 3/21/2022 22:56",
"untracking" : "ct 3/21/2022 23:04" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
"name" : "ProtoObject" }
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
instance creation
for: anObject

^ self new xxxtrackedObject: anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
instance creation
tracking: anObject from: aContext argAt: argIndex

^ (self for: anObject)
xxxtrackFrom: aContext argAt: argIndex
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
instance creation
tracking: anObject from: aContext instVarAt: tempIndex

^ (self for: anObject)
xxxtrackFrom: aContext instVarAt: tempIndex
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
instance creation
tracking: anObject from: aContext tempVarAt: tempIndex

^ (self for: anObject)
xxxtrackFrom: aContext tempVarAt: tempIndex
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
instance creation
trackingReceiver: anObject from: aContext

^ (self for: anObject)
xxxtrackReceiverFrom: aContext
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dynamic forwarding
doesNotUnderstand: aMessage

^ aMessage sendTo: object
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
tracking
trackingFrom: aContext argAt: argIndex

^ self xxxcopy
xxxtrackFrom: aContext argAt: argIndex
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
tracking
trackingFrom: aContext instVarAt: instVarIndex

^ self xxxcopy
xxxtrackFrom: aContext instVarAt: instVarIndex
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
tracking
trackingFrom: aContext tempVarAt: tempVarIndex

^ self xxxcopy
xxxtrackFrom: aContext tempVarAt: tempVarIndex
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
tracking
trackingReceiverFrom: aContext

^ self xxxcopy
xxxtrackReceiverFrom: aContext
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
untracking

^ object
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
copying
xxxcopy

^ self xxxshallowCopy xxxpostCopy
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
copying
xxxpostCopy

tempVars := tempVars copy.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
copying
xxxshallowCopy
<primitive: 148 error: ec>

^ Error signal: 'primitive failed'
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
accessing
xxxtrackFrom: aContext argAt: argIndex

((args ifNil: [args := IdentityDictionary new])
at: aContext ifAbsentPut: [Set new])
add: argIndex.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
accessing
xxxtrackFrom: aContext instVarAt: instVarIndex

((instVars ifNil: [instVars := IdentityDictionary new])
at: aContext ifAbsentPut: [Set new])
add: instVarIndex.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
accessing
xxxtrackFrom: aContext tempVarAt: tempVarIndex

((tempVars ifNil: [tempVars := IdentityDictionary new])
at: aContext ifAbsentPut: [Set new])
add: tempVarIndex.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
accessing
xxxtrackReceiverFrom: aContext

(receivers ifNil: [receivers := IdentitySet new])
add: aContext.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
xxxtrackedObject: anObject

object := anObject.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
xxxtrackedObject

^ object
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"class" : {
"for:" : "ct 3/21/2022 22:24",
"tracking:from:argAt:" : "ct 3/21/2022 22:54",
"tracking:from:instVarAt:" : "ct 3/21/2022 22:33",
"tracking:from:tempVarAt:" : "ct 3/21/2022 22:26",
"trackingReceiver:from:" : "ct 3/21/2022 22:57" },
"instance" : {
"doesNotUnderstand:" : "ct 3/21/2022 22:26",
"trackingFrom:argAt:" : "ct 3/21/2022 22:53",
"trackingFrom:instVarAt:" : "ct 3/21/2022 22:35",
"trackingFrom:tempVarAt:" : "ct 3/21/2022 22:34",
"trackingReceiverFrom:" : "ct 3/21/2022 22:55",
"untracking" : "ct 3/21/2022 23:04",
"xxxcopy" : "ct 3/21/2022 22:28",
"xxxpostCopy" : "ct 3/21/2022 22:29",
"xxxshallowCopy" : "ct 3/21/2022 22:28",
"xxxtrackFrom:argAt:" : "ct 3/21/2022 22:53",
"xxxtrackFrom:instVarAt:" : "ct 3/21/2022 22:36",
"xxxtrackFrom:tempVarAt:" : "ct 3/21/2022 22:35",
"xxxtrackReceiverFrom:" : "ct 3/21/2022 22:56",
"xxxtrackedObject" : "ct 3/21/2022 22:24",
"xxxtrackedObject:" : "ct 3/21/2022 22:25" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"category" : "SimulationStudio-Support",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
"object",
"tempVars",
"instVars",
"args",
"receivers" ],
"name" : "TrackedObject",
"pools" : [
],
"super" : "ProtoObject",
"type" : "normal" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
controlling
context: aContext activateMethod: aCompiledMethod withArgs: arguments receiver: receiver do: aBlock

| newContext |
newContext := super context: aContext activateMethod: aCompiledMethod withArgs: arguments receiver: receiver do: aBlock.

newContext arguments withIndexDo: [:arg :index |
newContext at: index put:
(self tracking: arg fromArgAt: index in: newContext)].
"newContext receiver:
(self trackingReceiver: newContext receiver in: newContext)."

^ newContext
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
controlling
context: aContext doPrimitive: primitiveIndex method: aCompiledMethod receiver: receiver args: arguments do: aBlock

self flag: #todo. "Do this only for non-simulated prims!"
^ super
context: aContext
doPrimitive: primitiveIndex
method: aCompiledMethod
receiver: receiver untracking
args: (arguments collect: [:argument | argument untracking])
do: aBlock
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
instruction processing
context: aContext popIntoReceiverVariable: offset do: aBlock

| top result |
top := self tracking: aContext pop fromInstVarAt: offset + 1 in: aContext.
result := aContext simulatedObject: aContext receiver instVarAt: offset + 1 put: top.
^ (aContext object: result eqeq: top)
ifTrue: [aContext]
ifFalse: [result]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
instruction processing
context: aContext popIntoTemporaryVariable: offset do: aBlock

^ aContext
at: offset + 1 put:
(self tracking: aContext pop fromTempVarAt: offset + 1 in: aContext);
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
controlling
context: aContext send: selector super: superFlag numArgs: numArgs do: aBlock

"0"numArgs to: numArgs do: [:i |
aContext at: aContext stackPtr - i put:
(aContext at: aContext stackPtr - i) untracking].
^ super
context: aContext
send: selector
super: superFlag
numArgs: numArgs
do: aBlock
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
controlling
context: aContext sendSpecial: selector numArgs: numArgs do: aBlock

^ aContext send: selector super: false numArgs: numArgs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
instruction processing
context: aContext storeIntoReceiverVariable: offset do: aBlock

| top result |
top := self tracking: aContext top fromInstVarAt: offset + 1 in: aContext.
result := aContext simulatedObject: aContext receiver instVarAt: offset + 1 put: top.
^ (aContext object: result eqeq: top)
ifTrue: [aContext]
ifFalse: [result]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
instruction processing
context: aContext storeIntoTemporaryVariable: offset do: aBlock

^ aContext
at: offset + 1 put:
(self tracking: aContext top fromTempVarAt: offset + 1 in: aContext);
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
private
tracking: anObject fromArgAt: argIndex in: aContext

^ anObject trackingFrom: aContext argAt: argIndex
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
private
tracking: anObject fromInstVarAt: instVarIndex in: aContext

^ anObject trackingFrom: aContext instVarAt: instVarIndex
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
private
tracking: anObject fromTempVarAt: tempVarIndex in: aContext

^ anObject trackingFrom: aContext tempVarAt: tempVarIndex
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
private
trackingReceiver: anObject in: aContext

^ anObject trackingReceiverFrom: aContext
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"class" : {
},
"instance" : {
"context:activateMethod:withArgs:receiver:do:" : "ct 3/21/2022 23:08",
"context:doPrimitive:method:receiver:args:do:" : "ct 3/21/2022 23:14",
"context:popIntoReceiverVariable:do:" : "ct 3/21/2022 22:46",
"context:popIntoTemporaryVariable:do:" : "ct 3/21/2022 22:46",
"context:send:super:numArgs:do:" : "ct 3/21/2022 23:29",
"context:sendSpecial:numArgs:do:" : "ct 3/21/2022 23:24",
"context:storeIntoReceiverVariable:do:" : "ct 3/21/2022 22:41",
"context:storeIntoTemporaryVariable:do:" : "ct 3/21/2022 22:43",
"tracking:fromArgAt:in:" : "ct 3/21/2022 22:59",
"tracking:fromInstVarAt:in:" : "ct 3/21/2022 22:35",
"tracking:fromTempVarAt:in:" : "ct 3/21/2022 22:34",
"trackingReceiver:in:" : "ct 3/21/2022 22:55" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"category" : "SimulationStudio-Support",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
],
"name" : "TrackingSimulator",
"pools" : [
],
"super" : "Simulator",
"type" : "normal" }