scmno****@osdn*****
scmno****@osdn*****
Tue Jun 12 13:35:57 JST 2018
changeset 803a3da59f2a in quipu/quipu details: http://hg.osdn.jp/view/quipu/quipu?cmd=changeset;node=803a3da59f2a user: Agustina Arzille <avarz****@riseu*****> date: Tue Jun 12 04:35:45 2018 +0000 description: Simplify compiler's variable frames diffstat: compiler.cpp | 18 ++++++------------ 1 files changed, 6 insertions(+), 12 deletions(-) diffs (50 lines): diff -r e9096f643ded -r 803a3da59f2a compiler.cpp --- a/compiler.cpp Tue Jun 12 03:48:19 2018 +0000 +++ b/compiler.cpp Tue Jun 12 04:35:45 2018 +0000 @@ -87,13 +87,9 @@ class frame_data { public: - int nargs; - int stkdisp; - int acc; - bool done; - - frame_data (bool d) : nargs (0), stkdisp (interpreter::frame_size), - acc (0), done (d) {} + int nargs = 0; + int stkdisp = interpreter::frame_size; + int acc = 0; }; typedef sorted_list<xcmp_call> ctable_t; @@ -126,9 +122,9 @@ return (f.acc + f.nargs + f.stkdisp); } - void push_f (bool done = true) + void push_f () { - frame_data fr (done); + frame_data fr; if (!this->frames.empty ()) fr.acc = this->cur_stkpos (); @@ -1847,7 +1843,7 @@ this->emit (OPX_(MKFRAME), intobj (0)); aarg = (int)this->code.size () - 1; ++this->cur_f().stkdisp; - this->push_f (false); + this->push_f (); first = false; } @@ -1884,8 +1880,6 @@ this->code[aarg] = intobj (nlex); if (nlex > 0xff) this->code[aarg - 1] = OPX_(MKFRAMEL); - - this->cur_f().done = true; } int r = this->compile_do (t1.as_obj (), tail && !dbind, xcdr (expr));