diff options
Diffstat (limited to 'Build/source/utils/asymptote/stack.cc')
-rw-r--r-- | Build/source/utils/asymptote/stack.cc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Build/source/utils/asymptote/stack.cc b/Build/source/utils/asymptote/stack.cc index cbd8b5a4998..b1651d2c424 100644 --- a/Build/source/utils/asymptote/stack.cc +++ b/Build/source/utils/asymptote/stack.cc @@ -156,6 +156,10 @@ void stack::run(program *code, vars_t vars) const inst &i = *ip; curPos = i.pos; +#if 0 + //printInst(cout, ip, code->begin()); + cout << i.pos << "\n"; +#endif #ifdef DEBUG_STACK cerr << curPos << "\n"; printInst(cerr, ip, code->begin()); @@ -187,6 +191,20 @@ void stack::run(program *code, vars_t vars) (*vars)[get<Int>(i)] = top(); break; +#ifdef COMBO + case inst::varpop: + (*vars)[get<Int>(i)] = pop(); + break; + + case inst::fieldpop: { + vars_t frame = pop<vars_t>(); + if (!frame) + error("dereference of null pointer"); + (*frame)[get<Int>(i)] = pop(); + break; + } +#endif + case inst::fieldpush: { vars_t frame = pop<vars_t>(); if (!frame) @@ -221,6 +239,16 @@ void stack::run(program *code, vars_t vars) if (!pop<bool>()) { ip = get<program::label>(i); continue; } break; +#ifdef COMBO + case inst::gejmp: { + Int y = pop<Int>(); + Int x = pop<Int>(); + if (x>=y) + { ip = get<program::label>(i); continue; } + break; + } +#endif + case inst::popcall: { /* get the function reference off of the stack */ callable* f = pop<callable*>(); |