summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2014-11-24 16:02:21 +0100
committerjmoenig <jens@moenig.org>2014-11-24 16:02:21 +0100
commit4be96bb240ea8518fa95218cba7111846af93baa (patch)
treef6ce849b98269f59635dfa17ca8ed8d7f7d958ef
parentbd37771334e7c82f86aa99f7509f88dc6950b8c5 (diff)
downloadsnap-4be96bb240ea8518fa95218cba7111846af93baa.tar.gz
snap-4be96bb240ea8518fa95218cba7111846af93baa.zip
tail-call-elimination for reporters - experiment
(commented out, under construction)
-rwxr-xr-xhistory.txt1
-rw-r--r--threads.js28
2 files changed, 29 insertions, 0 deletions
diff --git a/history.txt b/history.txt
index f710d77..964686e 100755
--- a/history.txt
+++ b/history.txt
@@ -2352,3 +2352,4 @@ ______
* Threads: Fixed #131
* snap.html, favicon.ico: new Favicon, thanks, Michael!
* Threads: improved whitespace detection for “split” primitive, thanks, Michael!
+* Threads: tail-call-elimination for reporters experiment (commented out, under construction)
diff --git a/threads.js b/threads.js
index 1f1915b..a6b824b 100644
--- a/threads.js
+++ b/threads.js
@@ -548,6 +548,34 @@ Process.prototype.reportAnd = function (block) {
}
};
+/*
+ tail-call-elimination for reporters
+ -----------------------------------
+ currently under construction, commented out for now
+ to activate add 'doReport' to the list of special forms
+ selectors in evaluateBlock() and comment out / remove
+ the current 'doReport' primitive in the "return"
+ section of the code
+
+Process.prototype.doReport = function (block) {
+
+// if (this.context.expression.partOfCustomCommand) {
+// return this.doStopCustomBlock();
+// }
+
+ var outer = this.context.outerContext;
+ while (this.context && this.context.expression !== 'exitReporter') {
+ if (this.context.expression === 'doStopWarping') {
+ this.doStopWarping();
+ } else {
+ this.popContext();
+ }
+ }
+ this.popContext();
+ this.pushContext(block.inputs()[0], outer);
+};
+*/
+
// Process: Non-Block evaluation
Process.prototype.evaluateMultiSlot = function (multiSlot, argCount) {