aboutsummaryrefslogtreecommitdiff
path: root/src/compiler/types.zc
diff options
context:
space:
mode:
authorGravatar zinc <zinc@downsta.ir> 2026-10-15 02:42:53 +0330
committerGravatar zinc <zinc@downsta.ir> 2026-10-15 02:42:53 +0330
commit1aa0215b6e3139c6f1ea49e9a9b1266f5850b51b (patch)
treedb648d1a197bc44e7c803e2631f05c475c96ffb1 /src/compiler/types.zc
parento3: break and continue out of an o3 { } block call rt.o3_leave for each block... (diff)
o3: an o3 function called from normal code as a receiver method (run.method) enters and leaves the region and fattens its result, like a direct call; spec 4.10.3, o3_receiver_method_enter.zc
Diffstat (limited to 'src/compiler/types.zc')
-rw-r--r--src/compiler/types.zc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/types.zc b/src/compiler/types.zc
index ca31248..81547a5 100644
--- a/src/compiler/types.zc
+++ b/src/compiler/types.zc
@@ -873,7 +873,8 @@ int methcall(int s, word rst, word receiver_fact, int receiver, word receiver_ma
}
if ((sflag[s] & F_SIG) && np != ((ssig[s] >> 1) & 31)) serrn(sname[s], "wrong number of arguments");
if (sflag[s] & F_GEN) { s = ginstance(s, bs); effect_specialize(original, s, requirements, edges); }
- fnref(s); op(O_CALL);
+ if (!o3on && (sflag[s] & F_O3)) { o3_enter_code(); fnref(s); op(O_CALL); callname(intern("rt.o3_leave")); op(O_DROP); } // into o3 from normal code, as call() does
+ else { fnref(s); op(O_CALL); }
lv = 0;
lvk = LV_NONE;
xzero = 0;
@@ -885,6 +886,7 @@ int methcall(int s, word rst, word receiver_fact, int receiver, word receiver_ma
xstamp = 0;
xty = tword;
if (ft) xty = subst(ft[4], bs);
+ if (!o3on && (sflag[s] & F_O3) && ft && hasptr(xty)) { lit(xty); callname(s_fatten); } // non-o3 called o3: fatten the result here
if (isfl(xty)) xfloat = 1;
effect_value = 0;
if (!ret && (isptr(xty) || xty == tword)) {