mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mruby-catch/catch.c: add disassembled comment for catch irep
This commit is contained in:
@@ -6,14 +6,14 @@
|
||||
#include <mruby/opcode.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
|
||||
MRB_PRESYM_DEFINE_VAR_AND_INITER(catch_syms_3, 1, MRB_SYM(call))
|
||||
static const mrb_code catch_iseq_3[18] = {
|
||||
OP_ENTER, 0x00, 0x00, 0x00,
|
||||
OP_GETUPVAR, 0x02, 0x02, 0x01,
|
||||
OP_GETUPVAR, 0x03, 0x01, 0x01,
|
||||
OP_SEND, 0x02, 0x00, 0x01,
|
||||
OP_RETURN, 0x02,};
|
||||
OP_ENTER, 0x00, 0x00, 0x00, /* 000 ENTER 0:0:0:0:0:0:0 (0x0) */
|
||||
OP_GETUPVAR, 0x02, 0x02, 0x01, /* 004 GETUPVAR R2 2 1 */
|
||||
OP_GETUPVAR, 0x03, 0x01, 0x01, /* 008 GETUPVAR R3 1 1 */
|
||||
OP_SEND, 0x02, 0x00, 0x01, /* 012 SEND R2 :call n=1 */
|
||||
OP_RETURN, 0x02, /* 016 RETURN R2 */
|
||||
};
|
||||
static const mrb_irep catch_irep_3 = {
|
||||
2,5,0,
|
||||
MRB_IREP_STATIC,catch_iseq_3,
|
||||
@@ -26,10 +26,11 @@ static const mrb_irep *catch_reps_2[1] = {
|
||||
&catch_irep_3,
|
||||
};
|
||||
static const mrb_code catch_iseq_2[13] = {
|
||||
OP_ENTER, 0x00, 0x00, 0x00,
|
||||
OP_LAMBDA, 0x02, 0x00,
|
||||
OP_SEND, 0x02, 0x00, 0x00,
|
||||
OP_RETURN, 0x02,};
|
||||
OP_ENTER, 0x00, 0x00, 0x00, /* 000 ENTER 0:0:0:0:0:0:0 (0x0) */
|
||||
OP_LAMBDA, 0x02, 0x00, /* 004 LAMBDA R2 I(0:0x555556198140) */
|
||||
OP_SEND, 0x02, 0x00, 0x00, /* 007 SEND R2 :call n=0 */
|
||||
OP_RETURN, 0x02, /* 011 RETURN R2 */
|
||||
};
|
||||
static const mrb_irep catch_irep_2 = {
|
||||
2,4,0,
|
||||
MRB_IREP_STATIC,catch_iseq_2,
|
||||
@@ -43,15 +44,16 @@ static const mrb_irep *catch_reps_1[1] = {
|
||||
};
|
||||
MRB_PRESYM_DEFINE_VAR_AND_INITER(catch_syms_1, 3, MRB_SYM(Object), MRB_SYM(new), MRB_SYM(call))
|
||||
static const mrb_code catch_iseq_1[29] = {
|
||||
OP_ENTER, 0x00, 0x20, 0x01,
|
||||
OP_JMP, 0x00, 0x03,
|
||||
OP_JMP, 0x00, 0x0a,
|
||||
OP_GETCONST, 0x03, 0x00,
|
||||
OP_SEND, 0x03, 0x01, 0x00,
|
||||
OP_MOVE, 0x01, 0x03,
|
||||
OP_LAMBDA, 0x03, 0x00,
|
||||
OP_SEND, 0x03, 0x02, 0x00,
|
||||
OP_RETURN, 0x03,};
|
||||
OP_ENTER, 0x00, 0x20, 0x01, /* 000 ENTER 0:1:0:0:0:0:1 (0x2001) */
|
||||
OP_JMP, 0x00, 0x03, /* 004 JMP 010 */
|
||||
OP_JMP, 0x00, 0x0a, /* 007 JMP 020 */
|
||||
OP_GETCONST, 0x03, 0x00, /* 010 GETCONST R3 Object */
|
||||
OP_SEND, 0x03, 0x01, 0x00, /* 013 SEND R3 :new n=0 */
|
||||
OP_MOVE, 0x01, 0x03, /* 017 MOVE R1 R3 */
|
||||
OP_LAMBDA, 0x03, 0x00, /* 020 LAMBDA R3 I(0:0x5555561980c0) */
|
||||
OP_SEND, 0x03, 0x02, 0x00, /* 023 SEND R3 :call n=0 */
|
||||
OP_RETURN, 0x03, /* 027 RETURN R3 */
|
||||
};
|
||||
static const mrb_irep catch_irep = {
|
||||
3,5,0,
|
||||
MRB_IREP_STATIC,catch_iseq_1,
|
||||
@@ -60,7 +62,6 @@ static const mrb_irep catch_irep = {
|
||||
NULL,
|
||||
29,0,3,1,0
|
||||
};
|
||||
|
||||
static const struct RProc catch_proc = {
|
||||
NULL, NULL, MRB_TT_PROC, MRB_GC_RED, MRB_FL_OBJ_IS_FROZEN | MRB_PROC_SCOPE | MRB_PROC_STRICT,
|
||||
{ &catch_irep }, NULL, { NULL }
|
||||
|
||||
Reference in New Issue
Block a user