scmno****@osdn*****
scmno****@osdn*****
Sat Jun 23 06:09:21 JST 2018
changeset 379800647e9f in quipu/quipu details: http://hg.osdn.jp/view/quipu/quipu?cmd=changeset;node=379800647e9f user: Agustina Arzille <avarz****@riseu*****> date: Fri Jun 22 18:09:12 2018 -0300 description: Be more strict when checking for optimization diffstat: compiler.cpp | 4 +++- eval.cpp | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diffs (37 lines): diff -r 040ec1386e73 -r 379800647e9f compiler.cpp --- a/compiler.cpp Fri Jun 22 16:18:36 2018 -0300 +++ b/compiler.cpp Fri Jun 22 18:09:12 2018 -0300 @@ -359,7 +359,9 @@ int ix = this->last_idx (); if (ix >= 0 && (cv[ix] == OPX_(LOADT) || cv[ix] == OPX_(LOADNIL))) { - if (ix >= 2 && cv[ix - 2] == OPX_(LABEL)) + if (ix >= 4 && cv[ix - 2] == OPX_(LABEL) && + cv[cv.size () - 2] == cv[ix - 2] && + cv[ix - 4] == OPX_(JMP) && cv[ix - 3] == cv[ix + 2]) { /* Common pattern: * jmp L1 * ... diff -r 040ec1386e73 -r 379800647e9f eval.cpp --- a/eval.cpp Fri Jun 22 16:18:36 2018 -0300 +++ b/eval.cpp Fri Jun 22 18:09:12 2018 -0300 @@ -469,16 +469,16 @@ OP_(RET): retval = r_stkend (1); - stkend = stack + interp->cur_frame; + stkend = stack + interp->cur_frame - + as_int (stack[interp->cur_frame - 3]) - interpreter::frame_size; + if ((interp->cur_frame = as_int (stack[lastf - 4])) == top_frame) return (retval); - fn = stack[interp->cur_frame - interpreter::frame_size - as_int (stack[interp->cur_frame - 3]) - 1]; lastf = interp->cur_frame - ((fn & EXTRA_BIT) ? as_int (fn) : 0); nargs = as_int (stack[lastf - 3]); - stkend -= nargs + interpreter::frame_size; r_stkend(1) = retval; bp = lastf - (interpreter::frame_size + nargs); fn = stack[bp - 1];