From 2f3eae7f67e90673cb95b61828f665ac6830dd32 Mon Sep 17 00:00:00 2001 From: Christoph Thiede Date: Fri, 29 Apr 2022 17:44:17 +0200 Subject: [PATCH] wip partial simulation see #todo comment --- .../PartialSimulator.class/README.md | 0 ...xt.activateMethod.withArgs.receiver.do..st | 19 +++++++++++++++++++ .../PartialSimulator.class/instance/todo.st | 7 +++++++ .../instance/wantsToSimulate..st | 4 ++++ .../methodProperties.json | 7 +++++++ .../PartialSimulator.class/properties.json | 14 ++++++++++++++ 6 files changed, 51 insertions(+) create mode 100644 packages/SimulationStudio-Support.package/PartialSimulator.class/README.md create mode 100644 packages/SimulationStudio-Support.package/PartialSimulator.class/instance/context.activateMethod.withArgs.receiver.do..st create mode 100644 packages/SimulationStudio-Support.package/PartialSimulator.class/instance/todo.st create mode 100644 packages/SimulationStudio-Support.package/PartialSimulator.class/instance/wantsToSimulate..st create mode 100644 packages/SimulationStudio-Support.package/PartialSimulator.class/methodProperties.json create mode 100644 packages/SimulationStudio-Support.package/PartialSimulator.class/properties.json diff --git a/packages/SimulationStudio-Support.package/PartialSimulator.class/README.md b/packages/SimulationStudio-Support.package/PartialSimulator.class/README.md new file mode 100644 index 0000000..e69de29 diff --git a/packages/SimulationStudio-Support.package/PartialSimulator.class/instance/context.activateMethod.withArgs.receiver.do..st b/packages/SimulationStudio-Support.package/PartialSimulator.class/instance/context.activateMethod.withArgs.receiver.do..st new file mode 100644 index 0000000..f78c34d --- /dev/null +++ b/packages/SimulationStudio-Support.package/PartialSimulator.class/instance/context.activateMethod.withArgs.receiver.do..st @@ -0,0 +1,19 @@ +controlling +context: aContext activateMethod: aCompiledMethod withArgs: arguments receiver: receiver do: aBlock + + | context next | + context := super context: aContext activateMethod: aCompiledMethod withArgs: arguments receiver: receiver do: aBlock. + (self wantsToSimulate: context) ifTrue: + [^ context]. + + next := context. + next isSimulationContext ifTrue: + [next := context decustomize: next]. + next := next runUntilExceptionOrReturnFrom: next ifException: [:ctx :exception | | stack | + stack := ctx stackUpTo: aContext. + stack + elementsForwardIdentityTo: (stack collect: [:sender | context customize: sender]) + copyHash: true. + ^ (context customize: ctx) privRefresh]. + + ^ next \ No newline at end of file diff --git a/packages/SimulationStudio-Support.package/PartialSimulator.class/instance/todo.st b/packages/SimulationStudio-Support.package/PartialSimulator.class/instance/todo.st new file mode 100644 index 0000000..80f1706 --- /dev/null +++ b/packages/SimulationStudio-Support.package/PartialSimulator.class/instance/todo.st @@ -0,0 +1,7 @@ +as yet unclassified +todo + + "STEHENGEBLIEBEN: See https://github.com/LinqLover/SimulationStudio/issues/54. What edge cases did we miss so far? What about resuming from an exception, could we turn off simulation again in this situation? But not so important, rather focus on assessing performance so far #53. Testing ... + For some reason, VM crashed when debugging the simulator and stepping through the exceptino resumption for: + PartialSimulator debug: [TestObject3 new foo2]. + " \ No newline at end of file diff --git a/packages/SimulationStudio-Support.package/PartialSimulator.class/instance/wantsToSimulate..st b/packages/SimulationStudio-Support.package/PartialSimulator.class/instance/wantsToSimulate..st new file mode 100644 index 0000000..8e0067e --- /dev/null +++ b/packages/SimulationStudio-Support.package/PartialSimulator.class/instance/wantsToSimulate..st @@ -0,0 +1,4 @@ +testing +wantsToSimulate: aContext + + ^ (aContext method hasPragma: #skipSimulator) not \ No newline at end of file diff --git a/packages/SimulationStudio-Support.package/PartialSimulator.class/methodProperties.json b/packages/SimulationStudio-Support.package/PartialSimulator.class/methodProperties.json new file mode 100644 index 0000000..e3bb5da --- /dev/null +++ b/packages/SimulationStudio-Support.package/PartialSimulator.class/methodProperties.json @@ -0,0 +1,7 @@ +{ + "class" : { + }, + "instance" : { + "context:activateMethod:withArgs:receiver:do:" : "ct 3/16/2022 14:26", + "todo" : "ct 3/16/2022 14:37", + "wantsToSimulate:" : "ct 3/16/2022 14:04" } } diff --git a/packages/SimulationStudio-Support.package/PartialSimulator.class/properties.json b/packages/SimulationStudio-Support.package/PartialSimulator.class/properties.json new file mode 100644 index 0000000..983d590 --- /dev/null +++ b/packages/SimulationStudio-Support.package/PartialSimulator.class/properties.json @@ -0,0 +1,14 @@ +{ + "category" : "SimulationStudio-Support", + "classinstvars" : [ + ], + "classvars" : [ + ], + "commentStamp" : "", + "instvars" : [ + ], + "name" : "PartialSimulator", + "pools" : [ + ], + "super" : "Simulator", + "type" : "normal" }