aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrahflow <drahflow@gmx.de>2014-03-06 13:42:55 +0100
committerDrahflow <drahflow@gmx.de>2014-03-06 13:42:55 +0100
commitee08bcf48cb6221295ae4b8663317a5320a6450b (patch)
tree255e8720fa43c3d56969edeaabb7d2632ca41ee0
parent2b3456f8ec1150318430bf71d9af04ff3311e32c (diff)
Tested *-based coroutines
-rw-r--r--compiler/elymasGlobal.ey6
-rw-r--r--doc/notes4
-rw-r--r--examples/working-compiler/coroutine4.test18
3 files changed, 27 insertions, 1 deletions
diff --git a/compiler/elymasGlobal.ey b/compiler/elymasGlobal.ey
index 2e1f8f6..e8c419a 100644
--- a/compiler/elymasGlobal.ey
+++ b/compiler/elymasGlobal.ey
@@ -2629,6 +2629,8 @@
24 /r13 /rax :movqMemDisp8Reg
/r15 8 /rax :movqRegMemDisp8
32 /r13 /rax :movqMemDisp8Reg
+ /rax /rax :testqRegReg
+ /sourceDataStackMissing :jzLbl8
/rsp 8 /rax :movqRegMemDisp8
# exclude source opcodes from being optimized away
@@ -2673,6 +2675,10 @@
/rbx :pushqReg
/rax :movqImmOOBReg "ey!" "ey." ::linkAbs64
/rax :jmpqReg
+
+ @sourceDataStackMissing
+ "cannot leave coroutine with ! which was entered by * (missing own stack)" ::outputError
+ :ud2
]] /ey! defv
> _ ==globalFunctions3 { defv }' ::allocateOffsetStruct
diff --git a/doc/notes b/doc/notes
index 455fc81..4a3ea3d 100644
--- a/doc/notes
+++ b/doc/notes
@@ -342,15 +342,17 @@ Main problem: How do we find out if the names mean what we believe they do?
* [] dynamic: nothing can be assumed
* [v] inactive: push value
* [f] active: execute unless quoted
+* [m] member: like active, but push scope resolving in first
* [q] quote-active: execute on first resolution (execution is instant)
+---------------------------------------------------+
| | | s | t | st | c | d |
+---+------+-------+-------+--------+-------+-------+
| v | defv | defvs | defvt | defvst | defvc | defvd |
| f | deff | deffs | defft | deffst | deffc | deffd |
+| m | defm | defms | defmt | defmst | defmc | defmd |
| q | defq | | | | | |
+---+------+-------+-------+--------+-------+-------+
-* defaults: |defvs "==" deffd |deffs "=*" deffd
+* defaults: |defvs "==" deffd |deffs "=*" deffd |defms "=." deffd
* it is possible to globally turn checking (after dynamic resolution) on
== Sticky Resolution ==
diff --git a/examples/working-compiler/coroutine4.test b/examples/working-compiler/coroutine4.test
new file mode 100644
index 0000000..ab3f29c
--- /dev/null
+++ b/examples/working-compiler/coroutine4.test
@@ -0,0 +1,18 @@
+{ ==caller ==data
+ "coroutine 1" dump data dump
+ data caller * =caller =data
+ "coroutine 2" dump data dump
+ data caller * =caller =data
+ "coroutine 3" dump data dump
+ data caller *
+} !! ==cr
+
+"data"
+cr * --
+"here 1" dump
+cr * --
+"here 2" dump
+cr * --
+"here 3" dump
+
+0 sys .exit