gave up the idea of constants.

enhanced namespace handling with selfns and self
uniformified identifier handling related to namespacing
This commit is contained in:
hyunghwan.chung
2017-06-01 15:42:05 +00:00
parent 36c48a8daf
commit 34a5e0cab8
7 changed files with 428 additions and 433 deletions

View File

@ -3944,6 +3944,18 @@ static int start_method (moo_t* moo, moo_oop_method_t method, moo_oow_t nargs)
MOO_STACK_SETTOP (moo, (moo_oop_t)moo->processor->active);
break;
case MOO_METHOD_PREAMBLE_RETURN_RECEIVER_NS:
{
moo_oop_t c;
LOG_INST_0 (moo, "preamble_return_receiver_ns");
MOO_STACK_POPS (moo, nargs); /* pop arguments only*/
c = MOO_STACK_GETTOP (moo); /* get receiver */
c = (moo_oop_t)MOO_CLASSOF(moo, c);
if (c == (moo_oop_t)moo->_class) c = MOO_STACK_GETTOP (moo);
MOO_STACK_SETTOP (moo, (moo_oop_t)((moo_oop_class_t)c)->nsup);
break;
}
case MOO_METHOD_PREAMBLE_RETURN_NIL:
LOG_INST_0 (moo, "preamble_return_nil");
MOO_STACK_POPS (moo, nargs);
@ -5030,6 +5042,16 @@ int moo_execute (moo_t* moo)
MOO_STACK_PUSH (moo, (moo_oop_t)moo->processor->active);
break;
case BCODE_PUSH_RECEIVER_NS:
{
register moo_oop_t c;
LOG_INST_0 (moo, "push_receiver_ns");
c = (moo_oop_t)MOO_CLASSOF(moo, moo->active_context->origin->receiver_or_source);
if (c == (moo_oop_t)moo->_class) c = moo->active_context->origin->receiver_or_source;
MOO_STACK_PUSH (moo, (moo_oop_t)((moo_oop_class_t)c)->nsup);
break;
}
case BCODE_PUSH_NEGONE:
LOG_INST_0 (moo, "push_negone");
MOO_STACK_PUSH (moo, MOO_SMOOI_TO_OOP(-1));