Skip to content

Instantly share code, notes, and snippets.

@zoffixznet
Created December 16, 2017 19:21
Show Gist options
  • Save zoffixznet/f2354880742a51e42520b20568453f66 to your computer and use it in GitHub Desktop.
Save zoffixznet/f2354880742a51e42520b20568453f66 to your computer and use it in GitHub Desktop.
diff --git a/src/core/exceptions.c b/src/core/exceptions.c
index 7917061..d627ef8 100644
--- a/src/core/exceptions.c
+++ b/src/core/exceptions.c
@@ -962,17 +962,20 @@ MVMint32 MVM_get_exception_category(MVMThreadContext *tc, MVMObject *ex) {
MVMObject * MVM_get_exception_payload(MVMThreadContext *tc, MVMObject *ex) {
MVMObject *result;
- if (IS_CONCRETE(ex) && REPR(ex)->ID == MVM_REPR_ID_MVMException)
+ printf("Z1: MVM_get_exception_payload\n");
+ if (ex && IS_CONCRETE(ex) && REPR(ex)->ID == MVM_REPR_ID_MVMException)
result = ((MVMException *)ex)->body.payload;
else
MVM_exception_throw_adhoc(tc, "getexpayload needs a VMException, got %s (%s)", REPR(ex)->name, MVM_6model_get_debug_name(tc, ex));
if (!result)
result = tc->instance->VMNull;
+ printf("Z1: out of MVM_get_exception_payload\n");
return result;
}
void MVM_bind_exception_payload(MVMThreadContext *tc, MVMObject *ex, MVMObject *payload) {
- if (IS_CONCRETE(ex) && REPR(ex)->ID == MVM_REPR_ID_MVMException) {
+ printf("Z1: MVM_bind_exception_payload\n");
+ if (ex && IS_CONCRETE(ex) && REPR(ex)->ID == MVM_REPR_ID_MVMException) {
MVM_ASSIGN_REF(tc, &(ex->header), ((MVMException *)ex)->body.payload,
payload);
}
@@ -982,13 +985,15 @@ void MVM_bind_exception_payload(MVMThreadContext *tc, MVMObject *ex, MVMObject *
}
void MVM_bind_exception_category(MVMThreadContext *tc, MVMObject *ex, MVMint32 category) {
- if (IS_CONCRETE(ex) && REPR(ex)->ID == MVM_REPR_ID_MVMException)
+ printf("Z1: MVM_bind_exception_category\n");
+ if (ex && IS_CONCRETE(ex) && REPR(ex)->ID == MVM_REPR_ID_MVMException)
((MVMException *)ex)->body.category = category;
else
MVM_exception_throw_adhoc(tc, "bindexcategory needs a VMException, got %s (%s)", REPR(ex)->name, MVM_6model_get_debug_name(tc, ex));
}
void MVM_exception_returnafterunwind(MVMThreadContext *tc, MVMObject *ex) {
- if (IS_CONCRETE(ex) && REPR(ex)->ID == MVM_REPR_ID_MVMException)
+ printf("Z1: MVM_exception_returnafterunwind\n");
+ if (ex && IS_CONCRETE(ex) && REPR(ex)->ID == MVM_REPR_ID_MVMException)
((MVMException *)ex)->body.return_after_unwind = 1;
else
MVM_exception_throw_adhoc(tc, "exreturnafterunwind needs a VMException, got %s (%s)", REPR(ex)->name, MVM_6model_get_debug_name(tc, ex));
diff --git a/src/jit/graph.c b/src/jit/graph.c
index 1468589..855418c 100644
--- a/src/jit/graph.c
+++ b/src/jit/graph.c
@@ -1859,8 +1859,10 @@ static MVMint32 consume_ins(MVMThreadContext *tc, MVMJitGraph *jg,
{ MVM_JIT_LITERAL, { category } },
{ MVM_JIT_REG_VAL, { payload } },
{ MVM_JIT_REG_ADDR, { regi } }};
+ printf("ZJIT: MVM_OP_throwpayloadlexcaller in\n");
jg_append_call_c(tc, jg, op_to_func(tc, op),
5, args, MVM_JIT_RV_VOID, -1);
+ printf("ZJIT: MVM_OP_throwpayloadlexcaller out\n");
break;
}
case MVM_OP_getexpayload: {
@@ -1868,7 +1870,9 @@ static MVMint32 consume_ins(MVMThreadContext *tc, MVMJitGraph *jg,
MVMint16 obj = ins->operands[1].reg.orig;
MVMJitCallArg args[] = { { MVM_JIT_INTERP_VAR, { MVM_JIT_INTERP_TC } },
{ MVM_JIT_REG_VAL, { obj } } };
+ printf("ZJIT: MVM_OP_getexpayload in\n");
jg_append_call_c(tc, jg, op_to_func(tc, op), 2, args, MVM_JIT_RV_PTR, dst);
+ printf("ZJIT: MVM_OP_getexpayload out\n");
break;
}
case MVM_OP_bindexpayload: {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment