// prevent invalid access to global variables
if(!exp_getvar(exp_self(prim_self(data))) &&
isa(v->type, emit->gwion->type[et_object]) > 0) {
- const Instr instr = emit_add_instr(emit, GWOP_EXCEPT);
+// const Instr instr = emit_add_instr(emit, GWOP_EXCEPT);
+ const Instr instr = emit_add_instr(emit, fast_except);
instr->m_val = -SZ_INT;
// use m_val2 to set some info?
}
if (GET_FLAG(v, late) && !exp_getvar(prim_exp(data)) &&
(isa(v->type, emit->gwion->type[et_object]) > 0 ||
is_fptr(emit->gwion, v->type))) {
- const Instr instr = emit_add_instr(emit, GWOP_EXCEPT);
+// const Instr instr = emit_add_instr(emit, GWOP_EXCEPT);
+ const Instr instr = emit_add_instr(emit, fast_except);
instr->m_val = -SZ_INT;
}
return GW_OK;
.data = (uintptr_t)info};
if (!info->is_var &&
(GET_FLAG(info->array.type, abstract) || type_ref(info->array.type))) {
- const Instr instr = emit_add_instr(emit, GWOP_EXCEPT);
+// const Instr instr = emit_add_instr(emit, GWOP_EXCEPT);
+ const Instr instr = emit_add_instr(emit, fast_except);
instr->m_val = -SZ_INT;
}
return op_emit(emit, &opi);
if (vector_size(&emit->code->instr) && vflag(f->value_ref, vflag_member) &&
is_fptr(emit->gwion, f->value_ref->type)) {
const Instr back = (Instr)vector_back(&emit->code->instr);
- const bool is_except = back->opcode == eGWOP_EXCEPT;
+ const bool is_except = back->opcode == eGWOP_EXCEPT || (back->opcode == eOP_MAX && back->execute == fast_except);
const Instr base =
!is_except ? back
: (Instr)vector_at(&emit->code->instr,
exp_getuse(e) && !exp_getvar(e) &&
GET_FLAG(e->d.exp_decl.list->self->value, late)) {
// e->exp_type == ae_exp_decl && !exp_getvar(e)) {
- const Instr instr = emit_add_instr(emit, GWOP_EXCEPT);
+// const Instr instr = emit_add_instr(emit, GWOP_EXCEPT);
+ const Instr instr = emit_add_instr(emit, fast_except);
instr->m_val = -SZ_INT;
}
} while ((exp = exp->next));
if((isa(value->type, emit->gwion->type[et_object]) > 0 || is_fptr(emit->gwion, value->type)) &&
!exp_getvar(exp_self(member)) &&
(GET_FLAG(value, static) || GET_FLAG(value, late))) {
- const Instr instr = emit_add_instr(emit, GWOP_EXCEPT);
+// const Instr instr = emit_add_instr(emit, GWOP_EXCEPT);
+ const Instr instr = emit_add_instr(emit, fast_except);
instr->m_val = -SZ_INT;
}
return GW_OK;
if (back->opcode == eGWOP_EXCEPT) {
back->opcode = eIntNot;
return GW_OK;
+ } else if (back->opcode == eOP_MAX && back->execute == fast_except) {
+ back->opcode = eIntNot;
+ return GW_OK;
}
const Instr instr = emit_add_instr(emit, RegSetImm);
instr->m_val2 = -SZ_INT;
static OP_EMIT(opem_uncond_object) {
const Vector v = &emit->code->instr;
const Instr back = (Instr)vector_at(v, vector_size(v) -2);
- if (back->opcode == eGWOP_EXCEPT) {
+ if (back->opcode == eGWOP_EXCEPT || (back->opcode == eOP_MAX && back->execute == fast_except)) {
free_instr(emit->gwion, back);
vector_rem(v, vector_size(v) - 2);
}
static OP_EMIT(opem_cond_object) {
const Vector v = &emit->code->instr;
const Instr back = (Instr)vector_at(v, vector_size(v) -2);
- if (back->opcode == eGWOP_EXCEPT) {
+ if (back->opcode == eGWOP_EXCEPT || (back->opcode == eOP_MAX && back->execute == fast_except)) {
free_instr(emit->gwion, back);
vector_rem(v, vector_size(v) - 2);
}