From a7a277a6d1c6b1cad031a4f39c08be0c12436825 Mon Sep 17 00:00:00 2001 From: dzaima Date: Sun, 16 May 2021 18:36:14 +0300 Subject: [PATCH] =?UTF-8?q?fix=20native=20=E2=8C=BE=20under=20rtperf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/load.c | 7 +++++-- src/rtPerf.c | 16 +++++++++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/load.c b/src/load.c index f014b119..e421651e 100644 --- a/src/load.c +++ b/src/load.c @@ -131,9 +131,12 @@ static inline void load_init() { B r = rtComplete[i]? inc(fruntime[i]) : rtObjGet(rtObjRaw, i); #endif if (isNothing(r)) { printf("ยท in runtime!\n"); exit(1); } - r = rtPerf_wrap(r); - runtimeH.a[i] = r; if (isVal(r)) v(r)->flags|= i+1; + #ifdef RT_PERF + r = rtPerf_wrap(r); + if (isVal(r)) v(r)->flags|= i+1; + #endif + runtimeH.a[i] = r; } dec(rtObjRaw); B* runtime = runtimeH.a; diff --git a/src/rtPerf.c b/src/rtPerf.c index 1342d003..b5890e78 100644 --- a/src/rtPerf.c +++ b/src/rtPerf.c @@ -188,13 +188,27 @@ void rtPerf_print() { cm2 = cm2->prev; } } + + +B wfn_uc1(B t, B o, B x) { B t2 = c(WFun,t)->v; return TI(t2).fn_uc1(t2, o, x); } +B wfn_ucw(B t, B o, B w, B x) { B t2 = c(WFun,t)->v; return TI(t2).fn_ucw(t2, o, w, x); } +B wm1_uc1(B t, B o, B f, B x) { B t2 = c(WMd1,t)->v; return TI(t2).m1_uc1(t2, o, f, x); } +B wm1_ucw(B t, B o, B f, B w, B x) { B t2 = c(WMd1,t)->v; return TI(t2).m1_ucw(t2, o, f, w, x); } +B wm2_uc1(B t, B o, B f, B g, B x) { B t2 = c(WMd2,t)->v; return TI(t2).m2_uc1(t2, o, f, g, x); } +B wm2_ucw(B t, B o, B f, B g, B w, B x) { B t2 = c(WMd2,t)->v; return TI(t2).m2_ucw(t2, o, f, g, w, x); } + static inline void rtPerf_init() { ti[t_funPerf].visit = wf_visit; ti[t_funPerf].identity = wf_identity; ti[t_md1Perf].visit = wm1_visit; ti[t_md1Perf].m1_d = m_md1D; ti[t_md2Perf].visit = wm2_visit; ti[t_md2Perf].m2_d = m_md2D; + ti[t_funPerf].fn_uc1 = wfn_uc1; + ti[t_funPerf].fn_ucw = wfn_ucw; + ti[t_md1Perf].m1_uc1 = wm1_uc1; + ti[t_md1Perf].m1_ucw = wm1_ucw; + ti[t_md2Perf].m2_uc1 = wm2_uc1; + ti[t_md2Perf].m2_ucw = wm2_ucw; } #else static inline void rtPerf_init() { } -static inline B rtPerf_wrap(B f) { return f; } static inline void rtPerf_print() { } #endif