eObjectRelease2,
eGWOP_EXCEPT,
eAllocMember4,
+ eDotMemberMem,
+ eDotMemberMem2,
+ eDotMemberMem4,
eDotMember,
eDotMember2,
eDotMember3,
#define ObjectRelease2 (f_instr)eObjectRelease2
#define GWOP_EXCEPT (f_instr)eGWOP_EXCEPT
#define AllocMember4 (f_instr)eAllocMember4
+#define DotMemberMem (f_instr)eDotMemberMem
+#define DotMemberMem2 (f_instr)eDotMemberMem2
+#define DotMemberMem4 (f_instr)eDotMemberMem4
#define DotMember (f_instr)eDotMember
#define DotMember2 (f_instr)eDotMember2
#define DotMember3 (f_instr)eDotMember3
gw_out(" {-R}%-14"UINT_F"{0}", instr->m_val);
gw_out("\n");
break;
+ case eDotMemberMem:
+ gw_out("{Y}┃{0}{-}% 4lu{0}: DotMemberMem", j);
+ gw_out(" {-R}%-14"UINT_F"{0}", instr->m_val);
+ gw_out("\n");
+ break;
+ case eDotMemberMem2:
+ gw_out("{Y}┃{0}{-}% 4lu{0}: DotMemberMem2", j);
+ gw_out(" {-R}%-14"UINT_F"{0}", instr->m_val);
+ gw_out("\n");
+ break;
+ case eDotMemberMem4:
+ gw_out("{Y}┃{0}{-}% 4lu{0}: DotMemberMem4", j);
+ gw_out(" {-R}%-14"UINT_F"{0}", instr->m_val);
+ gw_out("\n");
+ break;
case eDotMember:
gw_out("{Y}┃{0}{-}% 4lu{0}: DotMember ", j);
gw_out(" {-R}%-14"UINT_F"{0}", instr->m_val);
const m_uint offset = emit_code_offset(emit);
if (f != emit->env->func || !is_static || strcmp(s_name(f->def->base->xid), "new"))
regseti(emit, offset);
- const Instr instr = emit_call(emit, f, is_static);
+ const bool _is_static = !strcmp(s_name(f->def->base->xid), "new") ? true : is_static;
+ const Instr instr = emit_call(emit, f, _is_static);
instr->m_val = f->def->base->ret_type->size;
instr->m_val2 = offset;
}
CHECK_BB(cdef_parent(emit, c));
if (c->body) {
emit_class_code(emit, t->name);
+// if (scanx_body(emit->env, c, (_exp_func)emit_section, emit) > 0 && vector_size(&emit->code->instr) > 1)
if (scanx_body(emit->env, c, (_exp_func)emit_section, emit) > 0)
+{
+// if (vector_size(&emit->code->instr))
+// if (tflag(t, tflag_ctor))
t->nspc->pre_ctor = finalyze(emit, FuncReturn);
- else {
+/*
+else{
+puts("hehe");
+free_code(emit->gwion->mp, emit->code);
+ emit_pop_code(emit);
+}
+*/
+} else {
free_code(emit->gwion->mp, emit->code);
emit_pop_code(emit);
return GW_ERROR;
&&branchnefloat, &&unroll, &&arrayappend, &&autounrollinit, &&autoloop,
&&arraytop, &&arrayaccess, &&arrayget, &&arrayaddr, &&newobj, &&addref,
&&addrefaddr, &&structaddref, &&structaddrefaddr, &&objassign, &&assign,
- &&remref, &&remref2, &&except, &&allocmemberaddr, &&dotmember, &&dotfloat,
- &&dotother, &&dotaddr, &&unioncheck, &&unionint, &&unionfloat,
+ &&remref, &&remref2, &&except, &&allocmemberaddr,
+ &&dotmembermem, &&dotmembermem2, /*&&dotmembermem3, */&&dotmembermem4,
+ &&dotmember, &&dotfloat, &&dotother, &&dotaddr,
+ &&unioncheck, &&unionint, &&unionfloat,
&&unionother, &&unionaddr, &&staticint, &&staticfloat, &&staticother,
&&dotfunc, &&gacktype, &&gackend, &&gack, &&try_ini,
&&try_end, &&handleeffect, &&performeffect, &&noop, &&debugline,
*(m_bit **)reg = (*(M_Object *)mem)->data + VAL;
reg += SZ_INT;
DISPATCH()
+ dotmembermem:
+ reg += SZ_INT;
+ *(m_uint *)(reg - SZ_INT) =
+ *(m_uint *)((*(M_Object *)(mem + VAL2))->data + VAL);
+ DISPATCH()
+ dotmembermem2:
+ reg += SZ_INT - SZ_FLOAT;
+ *(m_float *)(reg - SZ_FLOAT) =
+ *(m_float *)((*(M_Object *)(mem + VAL2))->data + VAL);
+ DISPATCH()
+// dotmembermem3:
+ dotmembermem4:
+ reg += SZ_INT;
+ *(m_bit **)(reg - SZ_INT) =
+ ((*(M_Object *)(mem + VAL2))->data + VAL);
+ DISPATCH()
dotmember:
*(m_uint *)(reg - SZ_INT) =
*(m_uint *)((*(M_Object *)(reg - SZ_INT))->data + VAL);
&&_branchnefloat, &&_unroll, &&_arrayappend, &&_autounrollinit, &&_autoloop,
&&_arraytop, &&_arrayaccess, &&_arrayget, &&_arrayaddr, &&_newobj, &&_addref,
&&_addrefaddr, &&_structaddref, &&_structaddrefaddr, &&_objassign, &&_assign,
- &&_remref, &&_remref2, &&_except, &&_allocmemberaddr, &&_dotmember, &&_dotfloat,
- &&_dotother, &&_dotaddr, &&_unioncheck, &&_unionint, &&_unionfloat,
+ &&_remref, &&_remref2, &&_except, &&_allocmemberaddr,
+ &&_dotmembermem, &&_dotmembermem2, /*&&_dotmembermem3, */&&_dotmembermem4,
+ &&_dotmember, &&_dotfloat, &&_dotother, &&_dotaddr,
+ &&_unioncheck, &&_unionint, &&_unionfloat,
&&_unionother, &&_unionaddr, &&_staticint, &&_staticfloat, &&_staticother,
&&_dotfunc, &&_gacktype, &&_gackend, &&_gack, &&_try_ini,
&&_try_end, &&_handleeffect, &&_performeffect, &&_noop, &&_debugline,
PREPARE(remref2);
PREPARE(except);
PREPARE(allocmemberaddr);
+ PREPARE(dotmembermem);
+ PREPARE(dotmembermem2);
+ //PREPARE(dotmembermem3);
+ PREPARE(dotmembermem4);
PREPARE(dotmember);
PREPARE(dotfloat);
PREPARE(dotother);
}
i += j;
continue;
+ } else if (instr->opcode == eRegPushMem) {
+ const Instr next = (Instr)vector_at(v, i+1);
+ if(next->opcode == eDotMember) {
+ instr->opcode = eDotMemberMem;
+ instr->m_val2 = instr->m_val;
+ instr->m_val = next->m_val;
+ next->opcode = eNoOp;
+ } else if(next->opcode == eDotMember2) {
+ instr->opcode = eDotMemberMem2;
+ instr->m_val2 = instr->m_val;
+ instr->m_val = next->m_val;
+ next->opcode = eNoOp;
+ } else if(next->opcode == eDotMember4) {
+ instr->opcode = eDotMemberMem4;
+ instr->m_val2 = instr->m_val;
+ instr->m_val = next->m_val;
+ next->opcode = eNoOp;
+ }
} else if (instr->opcode == eUnroll2) {
const Instr unroll = (Instr)instr->m_val;
const m_uint pc = vector_find(v, (m_uint)unroll);