Files
@ 031c9d14adaa
Branch filter:
Location: CSY/reowolf/testdata/parser/positive/1.pdl - annotation
031c9d14adaa
1.9 KiB
text/plain
Merge branch 'feat-bytecode'
Adds size/alignment/offset computations to the type system and detects
potentially infinite types. If the type is potentially infinite but
contains a union that can break that type loop, then all other variants
of that union are supposed to be allocated on the heap. If the type
is potentially infinite but cannot be broken up, then we throw the
appropriate error.
The size/alignment/offset computations are not yet employed in the
runtime. But prepares Reowolf for a proper bytecode/IR implementation.
Adds size/alignment/offset computations to the type system and detects
potentially infinite types. If the type is potentially infinite but
contains a union that can break that type loop, then all other variants
of that union are supposed to be allocated on the heap. If the type
is potentially infinite but cannot be broken up, then we throw the
appropriate error.
The size/alignment/offset computations are not yet employed in the
runtime. But prepares Reowolf for a proper bytecode/IR implementation.
1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 1b7b852c3395 | #version 100
composite main(in asend, out arecv, in bsend, out brecv) {
channel xo -> xi;
channel yo -> yi;
new replicator(asend, xo, brecv);
new replicator(bsend, yo, arecv);
// x fires first, then y, then x, et cetera
new sequencer(xi, yi);
}
primitive replicator(in a, out b, out c) {
while (true) {
synchronous {
if (fires(a) && fires(b) && fires(c)) {
msg x = get(a);
put(b, x);
put(c, x);
} else {
assert !fires(a) && !fires(b) && !fires(c);
}
}
}
}
composite sequencer(in x, in y) {
channel ao -> ai;
channel bo -> bi;
channel co -> ci;
channel do -> di;
channel eo -> ei;
channel fo -> fi;
new syncdrain(x, ai);
new syncdrain(y, bi);
new replicator(ei, ao, co);
new replicator(fi, bo, do);
new fifo(ci, fo, null);
new fifo(di, eo, create(0));
}
primitive syncdrain(in a, in b) {
while (true) {
synchronous {
if (fires(a) && fires(b)) {
get(a);
get(b);
} else {
assert !fires(a) && !fires(b);
}
}
}
}
primitive fifo(in a, out b, msg init) {
msg c = init;
while (true) {
synchronous {
if (c != null) {
assert !fires(a);
if (fires(b)) {
put(b, c);
c = null;
}
} else {
assert !fires(b);
if (fires(a)) {
c = get(a);
}
}
}
}
}
primitive sequencer2(in x, in y) {
while (true) {
boolean b = false;
while (!b) {
synchronous {
assert !fires(y);
if (fires(x))
b = true;
}
}
b = false;
while (!b) {
synchronous {
assert !fires(x);
if (fires(y))
b = true;
}
}
}
}
|