Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
d965d90e
Unverified
Commit
d965d90e
authored
Oct 19, 2021
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
codedump.c: remove `OP_` prefix from disasm output.
parent
90484cac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
103 additions
and
103 deletions
+103
-103
src/codedump.c
src/codedump.c
+103
-103
No files found.
src/codedump.c
View file @
d965d90e
...
...
@@ -153,10 +153,10 @@ codedump(mrb_state *mrb, const mrb_irep *irep)
ins
=
READ_B
();
switch
(
ins
)
{
CASE
(
OP_NOP
,
Z
)
:
printf
(
"
OP_
NOP
\n
"
);
printf
(
"NOP
\n
"
);
break
;
CASE
(
OP_MOVE
,
BB
)
:
printf
(
"
OP_
MOVE
\t
R%d
\t
R%d
\t
"
,
a
,
b
);
printf
(
"MOVE
\t
R%d
\t
R%d
\t
"
,
a
,
b
);
print_lv_ab
(
mrb
,
irep
,
a
,
b
);
break
;
...
...
@@ -164,41 +164,41 @@ codedump(mrb_state *mrb, const mrb_irep *irep)
switch
(
irep
->
pool
[
b
].
tt
)
{
#ifndef MRB_NO_FLOAT
case
IREP_TT_FLOAT
:
printf
(
"
OP_LOADL
\t
R%d
\t
L(%d)
\t
; %f"
,
a
,
b
,
(
double
)
irep
->
pool
[
b
].
u
.
f
);
printf
(
"
LOADL
\t
\t
R%d
\t
L(%d)
\t
; %f"
,
a
,
b
,
(
double
)
irep
->
pool
[
b
].
u
.
f
);
break
;
#endif
case
IREP_TT_INT32
:
printf
(
"
OP_LOADL
\t
R%d
\t
L(%d)
\t
; %"
PRId32
,
a
,
b
,
irep
->
pool
[
b
].
u
.
i32
);
printf
(
"
LOADL
\t
\t
R%d
\t
L(%d)
\t
; %"
PRId32
,
a
,
b
,
irep
->
pool
[
b
].
u
.
i32
);
break
;
#ifdef MRB_64BIT
case
IREP_TT_INT64
:
printf
(
"
OP_LOADL
\t
R%d
\t
L(%d)
\t
; %"
PRId64
,
a
,
b
,
irep
->
pool
[
b
].
u
.
i64
);
printf
(
"
LOADL
\t
\t
R%d
\t
L(%d)
\t
; %"
PRId64
,
a
,
b
,
irep
->
pool
[
b
].
u
.
i64
);
break
;
#endif
default:
printf
(
"
OP_LOADL
\t
R%d
\t
L(%d)
\t
"
,
a
,
b
);
printf
(
"
LOADL
\t
\t
R%d
\t
L(%d)
\t
"
,
a
,
b
);
break
;
}
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_LOADI
,
BB
)
:
printf
(
"
OP_LOADI
\t
R%d
\t
%d
\t
"
,
a
,
b
);
printf
(
"
LOADI
\t
\t
R%d
\t
%d
\t
"
,
a
,
b
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_LOADINEG
,
BB
)
:
printf
(
"
OP_
LOADI
\t
R%d
\t
-%d
\t
"
,
a
,
b
);
printf
(
"LOADI
\t
R%d
\t
-%d
\t
"
,
a
,
b
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_LOADI16
,
BS
)
:
printf
(
"
OP_
LOADI16
\t
R%d
\t
%d
\t
"
,
a
,
(
int
)(
int16_t
)
b
);
printf
(
"LOADI16
\t
R%d
\t
%d
\t
"
,
a
,
(
int
)(
int16_t
)
b
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_LOADI32
,
BSS
)
:
printf
(
"
OP_
LOADI32
\t
R%d
\t
%d
\t
"
,
a
,
(
int32_t
)(((
uint32_t
)
b
<<
16
)
+
c
));
printf
(
"LOADI32
\t
R%d
\t
%d
\t
"
,
a
,
(
int32_t
)(((
uint32_t
)
b
<<
16
)
+
c
));
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_LOADI__1
,
B
)
:
printf
(
"
OP_
LOADI__1
\t
R%d
\t\t
"
,
a
);
printf
(
"LOADI__1
\t
R%d
\t\t
"
,
a
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_LOADI_0
,
B
)
:
goto
L_LOADI
;
...
...
@@ -210,139 +210,139 @@ codedump(mrb_state *mrb, const mrb_irep *irep)
CASE
(
OP_LOADI_6
,
B
)
:
goto
L_LOADI
;
CASE
(
OP_LOADI_7
,
B
)
:
L_LOADI:
printf
(
"
OP_
LOADI_%d
\t
R%d
\t\t
"
,
ins
-
(
int
)
OP_LOADI_0
,
a
);
printf
(
"LOADI_%d
\t
R%d
\t\t
"
,
ins
-
(
int
)
OP_LOADI_0
,
a
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_LOADSYM
,
BB
)
:
printf
(
"
OP_
LOADSYM
\t
R%d
\t
:%s
\t
"
,
a
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]));
printf
(
"LOADSYM
\t
R%d
\t
:%s
\t
"
,
a
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]));
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_LOADNIL
,
B
)
:
printf
(
"
OP_
LOADNIL
\t
R%d
\t\t
"
,
a
);
printf
(
"LOADNIL
\t
R%d
\t\t
"
,
a
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_LOADSELF
,
B
)
:
printf
(
"
OP_
LOADSELF
\t
R%d
\t\t
"
,
a
);
printf
(
"LOADSELF
\t
R%d
\t\t
"
,
a
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_LOADT
,
B
)
:
printf
(
"
OP_LOADT
\t
R%d
\t\t
"
,
a
);
printf
(
"
LOADT
\t
\t
R%d
\t\t
"
,
a
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_LOADF
,
B
)
:
printf
(
"
OP_LOADF
\t
R%d
\t\t
"
,
a
);
printf
(
"
LOADF
\t
\t
R%d
\t\t
"
,
a
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_GETGV
,
BB
)
:
printf
(
"
OP_GETGV
\t
R%d
\t
%s
\t
"
,
a
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]));
printf
(
"
GETGV
\t
\t
R%d
\t
%s
\t
"
,
a
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]));
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_SETGV
,
BB
)
:
printf
(
"
OP_SETGV
\t
%s
\t
R%d
\t
"
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]),
a
);
printf
(
"
SETGV
\t
\t
%s
\t
R%d
\t
"
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]),
a
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_GETSV
,
BB
)
:
printf
(
"
OP_GETSV
\t
R%d
\t
%s
\t
"
,
a
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]));
printf
(
"
GETSV
\t
\t
R%d
\t
%s
\t
"
,
a
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]));
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_SETSV
,
BB
)
:
printf
(
"
OP_SETSV
\t
%s
\t
R%d
\t
"
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]),
a
);
printf
(
"
SETSV
\t
\t
%s
\t
R%d
\t
"
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]),
a
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_GETCONST
,
BB
)
:
printf
(
"
OP_
GETCONST
\t
R%d
\t
%s
\t
"
,
a
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]));
printf
(
"GETCONST
\t
R%d
\t
%s
\t
"
,
a
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]));
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_SETCONST
,
BB
)
:
printf
(
"
OP_
SETCONST
\t
%s
\t
R%d
\t
"
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]),
a
);
printf
(
"SETCONST
\t
%s
\t
R%d
\t
"
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]),
a
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_GETMCNST
,
BB
)
:
printf
(
"
OP_
GETMCNST
\t
R%d
\t
R%d::%s
\t
"
,
a
,
a
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]));
printf
(
"GETMCNST
\t
R%d
\t
R%d::%s
\t
"
,
a
,
a
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]));
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_SETMCNST
,
BB
)
:
printf
(
"
OP_
SETMCNST
\t
R%d::%s
\t
R%d
\t
"
,
a
+
1
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]),
a
);
printf
(
"SETMCNST
\t
R%d::%s
\t
R%d
\t
"
,
a
+
1
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]),
a
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_GETIV
,
BB
)
:
printf
(
"
OP_GETIV
\t
R%d
\t
%s
\t
"
,
a
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]));
printf
(
"
GETIV
\t
\t
R%d
\t
%s
\t
"
,
a
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]));
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_SETIV
,
BB
)
:
printf
(
"
OP_SETIV
\t
%s
\t
R%d
\t
"
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]),
a
);
printf
(
"
SETIV
\t
\t
%s
\t
R%d
\t
"
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]),
a
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_GETUPVAR
,
BBB
)
:
printf
(
"
OP_
GETUPVAR
\t
R%d
\t
%d
\t
%d
\t
"
,
a
,
b
,
c
);
printf
(
"GETUPVAR
\t
R%d
\t
%d
\t
%d
\t
"
,
a
,
b
,
c
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_SETUPVAR
,
BBB
)
:
printf
(
"
OP_
SETUPVAR
\t
R%d
\t
%d
\t
%d
\t
"
,
a
,
b
,
c
);
printf
(
"SETUPVAR
\t
R%d
\t
%d
\t
%d
\t
"
,
a
,
b
,
c
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_GETCV
,
BB
)
:
printf
(
"
OP_GETCV
\t
R%d
\t
%s
\t
"
,
a
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]));
printf
(
"
GETCV
\t
\t
R%d
\t
%s
\t
"
,
a
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]));
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_SETCV
,
BB
)
:
printf
(
"
OP_SETCV
\t
%s
\t
R%d
\t
"
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]),
a
);
printf
(
"
SETCV
\t
\t
%s
\t
R%d
\t
"
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]),
a
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_GETIDX
,
B
)
:
printf
(
"
OP_
GETIDX
\t
R%d
\t
R%d
\n
"
,
a
,
a
+
1
);
printf
(
"GETIDX
\t
R%d
\t
R%d
\n
"
,
a
,
a
+
1
);
break
;
CASE
(
OP_SETIDX
,
B
)
:
printf
(
"
OP_
SETIDX
\t
R%d
\t
R%d
\t
R%d
\n
"
,
a
,
a
+
1
,
a
+
2
);
printf
(
"SETIDX
\t
R%d
\t
R%d
\t
R%d
\n
"
,
a
,
a
+
1
,
a
+
2
);
break
;
CASE
(
OP_JMP
,
S
)
:
i
=
pc
-
irep
->
iseq
;
printf
(
"
OP_
JMP
\t\t
%03d
\n
"
,
(
int
)
i
+
(
int16_t
)
a
);
printf
(
"JMP
\t\t
%03d
\n
"
,
(
int
)
i
+
(
int16_t
)
a
);
break
;
CASE
(
OP_JMPUW
,
S
)
:
i
=
pc
-
irep
->
iseq
;
printf
(
"
OP_
JMPUW
\t\t
%03d
\n
"
,
(
int
)
i
+
(
int16_t
)
a
);
printf
(
"JMPUW
\t\t
%03d
\n
"
,
(
int
)
i
+
(
int16_t
)
a
);
break
;
CASE
(
OP_JMPIF
,
BS
)
:
i
=
pc
-
irep
->
iseq
;
printf
(
"
OP_JMPIF
\t
R%d
\t
%03d
\t
"
,
a
,
(
int
)
i
+
(
int16_t
)
b
);
printf
(
"
JMPIF
\t
\t
R%d
\t
%03d
\t
"
,
a
,
(
int
)
i
+
(
int16_t
)
b
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_JMPNOT
,
BS
)
:
i
=
pc
-
irep
->
iseq
;
printf
(
"
OP_
JMPNOT
\t
R%d
\t
%03d
\t
"
,
a
,
(
int
)
i
+
(
int16_t
)
b
);
printf
(
"JMPNOT
\t
R%d
\t
%03d
\t
"
,
a
,
(
int
)
i
+
(
int16_t
)
b
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_JMPNIL
,
BS
)
:
i
=
pc
-
irep
->
iseq
;
printf
(
"
OP_
JMPNIL
\t
R%d
\t
%03d
\t
"
,
a
,
(
int
)
i
+
(
int16_t
)
b
);
printf
(
"JMPNIL
\t
R%d
\t
%03d
\t
"
,
a
,
(
int
)
i
+
(
int16_t
)
b
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_SSEND
,
BBB
)
:
printf
(
"
OP_SSEND
\t
R%d
\t
:%s
\t
"
,
a
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]));
printf
(
"
SSEND
\t
\t
R%d
\t
:%s
\t
"
,
a
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]));
print_args
(
c
);
break
;
CASE
(
OP_SSENDB
,
BBB
)
:
printf
(
"
OP_
SSENDB
\t
R%d
\t
:%s
\t
"
,
a
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]));
printf
(
"SSENDB
\t
R%d
\t
:%s
\t
"
,
a
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]));
print_args
(
c
);
break
;
CASE
(
OP_SEND
,
BBB
)
:
printf
(
"
OP_SEND
\t
R%d
\t
:%s
\t
"
,
a
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]));
printf
(
"
SEND
\t
\t
R%d
\t
:%s
\t
"
,
a
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]));
print_args
(
c
);
break
;
CASE
(
OP_SENDB
,
BBB
)
:
printf
(
"
OP_SENDB
\t
R%d
\t
:%s
\t
"
,
a
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]));
printf
(
"
SENDB
\t
\t
R%d
\t
:%s
\t
"
,
a
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]));
print_args
(
c
);
break
;
CASE
(
OP_CALL
,
Z
)
:
printf
(
"
OP_
CALL
\n
"
);
printf
(
"CALL
\n
"
);
break
;
CASE
(
OP_SUPER
,
BB
)
:
printf
(
"
OP_SUPER
\t
R%d
\t
"
,
a
);
printf
(
"
SUPER
\t
\t
R%d
\t
"
,
a
);
print_args
(
b
);
break
;
CASE
(
OP_ARGARY
,
BS
)
:
printf
(
"
OP_
ARGARY
\t
R%d
\t
%d:%d:%d:%d (%d)
\t
"
,
a
,
printf
(
"ARGARY
\t
R%d
\t
%d:%d:%d:%d (%d)
\t
"
,
a
,
(
b
>>
11
)
&
0x3f
,
(
b
>>
10
)
&
0x1
,
(
b
>>
5
)
&
0x1f
,
...
...
@@ -351,40 +351,40 @@ codedump(mrb_state *mrb, const mrb_irep *irep)
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_ENTER
,
W
)
:
printf
(
"
OP_ENTER
\t
%d:%d:%d:%d:%d:%d:%d
\n
"
,
printf
(
"
ENTER
\t\t
%d:%d:%d:%d:%d:%d:%d (0x%x)
\n
"
,
MRB_ASPEC_REQ
(
a
),
MRB_ASPEC_OPT
(
a
),
MRB_ASPEC_REST
(
a
),
MRB_ASPEC_POST
(
a
),
MRB_ASPEC_KEY
(
a
),
MRB_ASPEC_KDICT
(
a
),
MRB_ASPEC_BLOCK
(
a
));
MRB_ASPEC_BLOCK
(
a
)
,
a
);
break
;
CASE
(
OP_KEY_P
,
BB
)
:
printf
(
"
OP_KEY_P
\t
R%d
\t
:%s
\t
"
,
a
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]));
printf
(
"
KEY_P
\t
\t
R%d
\t
:%s
\t
"
,
a
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]));
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_KEYEND
,
Z
)
:
printf
(
"
OP_
KEYEND
\n
"
);
printf
(
"KEYEND
\n
"
);
break
;
CASE
(
OP_KARG
,
BB
)
:
printf
(
"
OP_KARG
\t
R%d
\t
:%s
\t
"
,
a
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]));
printf
(
"
KARG
\t
\t
R%d
\t
:%s
\t
"
,
a
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]));
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_RETURN
,
B
)
:
printf
(
"
OP_
RETURN
\t
R%d
\t\t
"
,
a
);
printf
(
"RETURN
\t
R%d
\t\t
"
,
a
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_RETURN_BLK
,
B
)
:
printf
(
"
OP_
RETURN_BLK
\t
R%d
\t\t
"
,
a
);
printf
(
"RETURN_BLK
\t
R%d
\t\t
"
,
a
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_BREAK
,
B
)
:
printf
(
"
OP_BREAK
\t
R%d
\t\t
"
,
a
);
printf
(
"
BREAK
\t
\t
R%d
\t\t
"
,
a
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_BLKPUSH
,
BS
)
:
printf
(
"
OP_
BLKPUSH
\t
R%d
\t
%d:%d:%d:%d (%d)
\t
"
,
a
,
printf
(
"BLKPUSH
\t
R%d
\t
%d:%d:%d:%d (%d)
\t
"
,
a
,
(
b
>>
11
)
&
0x3f
,
(
b
>>
10
)
&
0x1
,
(
b
>>
5
)
&
0x1f
,
...
...
@@ -393,183 +393,183 @@ codedump(mrb_state *mrb, const mrb_irep *irep)
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_LAMBDA
,
BB
)
:
printf
(
"
OP_
LAMBDA
\t
R%d
\t
I(%d:%p)
\n
"
,
a
,
b
,
(
void
*
)
irep
->
reps
[
b
]);
printf
(
"LAMBDA
\t
R%d
\t
I(%d:%p)
\n
"
,
a
,
b
,
(
void
*
)
irep
->
reps
[
b
]);
break
;
CASE
(
OP_BLOCK
,
BB
)
:
printf
(
"
OP_BLOCK
\t
R%d
\t
I(%d:%p)
\n
"
,
a
,
b
,
(
void
*
)
irep
->
reps
[
b
]);
printf
(
"
BLOCK
\t
\t
R%d
\t
I(%d:%p)
\n
"
,
a
,
b
,
(
void
*
)
irep
->
reps
[
b
]);
break
;
CASE
(
OP_METHOD
,
BB
)
:
printf
(
"
OP_
METHOD
\t
R%d
\t
I(%d:%p)
\n
"
,
a
,
b
,
(
void
*
)
irep
->
reps
[
b
]);
printf
(
"METHOD
\t
R%d
\t
I(%d:%p)
\n
"
,
a
,
b
,
(
void
*
)
irep
->
reps
[
b
]);
break
;
CASE
(
OP_RANGE_INC
,
B
)
:
printf
(
"
OP_
RANGE_INC
\t
R%d
\n
"
,
a
);
printf
(
"RANGE_INC
\t
R%d
\n
"
,
a
);
break
;
CASE
(
OP_RANGE_EXC
,
B
)
:
printf
(
"
OP_
RANGE_EXC
\t
R%d
\n
"
,
a
);
printf
(
"RANGE_EXC
\t
R%d
\n
"
,
a
);
break
;
CASE
(
OP_DEF
,
BB
)
:
printf
(
"
OP_DEF
\t
R%d
\t
:%s
\n
"
,
a
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]));
printf
(
"
DEF
\t
\t
R%d
\t
:%s
\n
"
,
a
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]));
break
;
CASE
(
OP_UNDEF
,
B
)
:
printf
(
"
OP_UNDEF
\t
:%s
\n
"
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
a
]));
printf
(
"
UNDEF
\t
\t
:%s
\n
"
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
a
]));
break
;
CASE
(
OP_ALIAS
,
BB
)
:
printf
(
"
OP_ALIAS
\t
:%s
\t
%s
\n
"
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
a
]),
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]));
printf
(
"
ALIAS
\t
\t
:%s
\t
%s
\n
"
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
a
]),
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]));
break
;
CASE
(
OP_ADD
,
B
)
:
printf
(
"
OP_ADD
\t
R%d
\t
R%d
\n
"
,
a
,
a
+
1
);
printf
(
"
ADD
\t
\t
R%d
\t
R%d
\n
"
,
a
,
a
+
1
);
break
;
CASE
(
OP_ADDI
,
BB
)
:
printf
(
"
OP_ADDI
\t
R%d
\t
%d
\t
"
,
a
,
b
);
printf
(
"
ADDI
\t
\t
R%d
\t
%d
\t
"
,
a
,
b
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_SUB
,
B
)
:
printf
(
"
OP_SUB
\t
R%d
\t
R%d
\n
"
,
a
,
a
+
1
);
printf
(
"
SUB
\t
\t
R%d
\t
R%d
\n
"
,
a
,
a
+
1
);
break
;
CASE
(
OP_SUBI
,
BB
)
:
printf
(
"
OP_SUBI
\t
R%d
\t
%d
\t
"
,
a
,
b
);
printf
(
"
SUBI
\t
\t
R%d
\t
%d
\t
"
,
a
,
b
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_MUL
,
B
)
:
printf
(
"
OP_MUL
\t
R%d
\t
R%d
\n
"
,
a
,
a
+
1
);
printf
(
"
MUL
\t
\t
R%d
\t
R%d
\n
"
,
a
,
a
+
1
);
break
;
CASE
(
OP_DIV
,
B
)
:
printf
(
"
OP_DIV
\t
R%d
\t
R%d
\n
"
,
a
,
a
+
1
);
printf
(
"
DIV
\t
\t
R%d
\t
R%d
\n
"
,
a
,
a
+
1
);
break
;
CASE
(
OP_LT
,
B
)
:
printf
(
"
OP_
LT
\t\t
R%d
\t
R%d
\n
"
,
a
,
a
+
1
);
printf
(
"LT
\t\t
R%d
\t
R%d
\n
"
,
a
,
a
+
1
);
break
;
CASE
(
OP_LE
,
B
)
:
printf
(
"
OP_
LE
\t\t
R%d
\t
R%d
\n
"
,
a
,
a
+
1
);
printf
(
"LE
\t\t
R%d
\t
R%d
\n
"
,
a
,
a
+
1
);
break
;
CASE
(
OP_GT
,
B
)
:
printf
(
"
OP_
GT
\t\t
R%d
\t
R%d
\n
"
,
a
,
a
+
1
);
printf
(
"GT
\t\t
R%d
\t
R%d
\n
"
,
a
,
a
+
1
);
break
;
CASE
(
OP_GE
,
B
)
:
printf
(
"
OP_
GE
\t\t
R%d
\t
R%d
\n
"
,
a
,
a
+
1
);
printf
(
"GE
\t\t
R%d
\t
R%d
\n
"
,
a
,
a
+
1
);
break
;
CASE
(
OP_EQ
,
B
)
:
printf
(
"
OP_
EQ
\t\t
R%d
\t
R%d
\n
"
,
a
,
a
+
1
);
printf
(
"EQ
\t\t
R%d
\t
R%d
\n
"
,
a
,
a
+
1
);
break
;
CASE
(
OP_ARRAY
,
BB
)
:
printf
(
"
OP_ARRAY
\t
R%d
\t
%d
\t
"
,
a
,
b
);
printf
(
"
ARRAY
\t\t
R%d
\t
R%d
\t
%d
\t
"
,
a
,
a
,
b
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_ARRAY2
,
BBB
)
:
printf
(
"
OP_ARRAY
\t
R%d
\t
R%d
\t
%d
\t
"
,
a
,
b
,
c
);
printf
(
"
ARRAY
\t
\t
R%d
\t
R%d
\t
%d
\t
"
,
a
,
b
,
c
);
print_lv_ab
(
mrb
,
irep
,
a
,
b
);
break
;
CASE
(
OP_ARYCAT
,
B
)
:
printf
(
"
OP_
ARYCAT
\t
R%d
\t
R%d
\t
"
,
a
,
a
+
1
);
printf
(
"ARYCAT
\t
R%d
\t
R%d
\t
"
,
a
,
a
+
1
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_ARYPUSH
,
BB
)
:
printf
(
"
OP_
ARYPUSH
\t
R%d
\t
%d
\t
"
,
a
,
b
);
printf
(
"ARYPUSH
\t
R%d
\t
%d
\t
"
,
a
,
b
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_ARYDUP
,
B
)
:
printf
(
"
OP_
ARYDUP
\t
R%d
\t
"
,
a
);
printf
(
"ARYDUP
\t
R%d
\t
"
,
a
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_AREF
,
BBB
)
:
printf
(
"
OP_AREF
\t
R%d
\t
R%d
\t
%d"
,
a
,
b
,
c
);
printf
(
"
AREF
\t
\t
R%d
\t
R%d
\t
%d"
,
a
,
b
,
c
);
print_lv_ab
(
mrb
,
irep
,
a
,
b
);
break
;
CASE
(
OP_ASET
,
BBB
)
:
printf
(
"
OP_ASET
\t
R%d
\t
R%d
\t
%d"
,
a
,
b
,
c
);
printf
(
"
ASET
\t
\t
R%d
\t
R%d
\t
%d"
,
a
,
b
,
c
);
print_lv_ab
(
mrb
,
irep
,
a
,
b
);
break
;
CASE
(
OP_APOST
,
BBB
)
:
printf
(
"
OP_APOST
\t
R%d
\t
%d
\t
%d"
,
a
,
b
,
c
);
printf
(
"
APOST
\t
\t
R%d
\t
%d
\t
%d"
,
a
,
b
,
c
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_INTERN
,
B
)
:
printf
(
"
OP_
INTERN
\t
R%d
\t\t
"
,
a
);
printf
(
"INTERN
\t
R%d
\t\t
"
,
a
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_SYMBOL
,
BB
)
:
mrb_assert
((
irep
->
pool
[
b
].
tt
&
IREP_TT_NFLAG
)
==
0
);
printf
(
"
OP_
SYMBOL
\t
R%d
\t
L(%d)
\t
; %s"
,
a
,
b
,
irep
->
pool
[
b
].
u
.
str
);
printf
(
"SYMBOL
\t
R%d
\t
L(%d)
\t
; %s"
,
a
,
b
,
irep
->
pool
[
b
].
u
.
str
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_STRING
,
BB
)
:
mrb_assert
((
irep
->
pool
[
b
].
tt
&
IREP_TT_NFLAG
)
==
0
);
if
((
irep
->
pool
[
b
].
tt
&
IREP_TT_NFLAG
)
==
0
)
{
printf
(
"
OP_
STRING
\t
R%d
\t
L(%d)
\t
; %s"
,
a
,
b
,
irep
->
pool
[
b
].
u
.
str
);
printf
(
"STRING
\t
R%d
\t
L(%d)
\t
; %s"
,
a
,
b
,
irep
->
pool
[
b
].
u
.
str
);
}
else
{
printf
(
"
OP_
STRING
\t
R%d
\t
L(%d)
\t
"
,
a
,
b
);
printf
(
"STRING
\t
R%d
\t
L(%d)
\t
"
,
a
,
b
);
}
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_STRCAT
,
B
)
:
printf
(
"
OP_
STRCAT
\t
R%d
\t
R%d"
,
a
,
a
+
1
);
printf
(
"STRCAT
\t
R%d
\t
R%d"
,
a
,
a
+
1
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_HASH
,
BB
)
:
printf
(
"
OP_HASH
\t
R%d
\t
%d
\t
"
,
a
,
b
);
printf
(
"
HASH
\t
\t
R%d
\t
%d
\t
"
,
a
,
b
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_HASHADD
,
BB
)
:
printf
(
"
OP_
HASHADD
\t
R%d
\t
%d
\t
"
,
a
,
b
);
printf
(
"HASHADD
\t
R%d
\t
%d
\t
"
,
a
,
b
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_HASHCAT
,
B
)
:
printf
(
"
OP_
HASHCAT
\t
R%d
\t
"
,
a
);
printf
(
"HASHCAT
\t
R%d
\t
"
,
a
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_OCLASS
,
B
)
:
printf
(
"O
P_O
CLASS
\t
R%d
\t\t
"
,
a
);
printf
(
"OCLASS
\t
R%d
\t\t
"
,
a
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_CLASS
,
BB
)
:
printf
(
"
OP_CLASS
\t
R%d
\t
:%s"
,
a
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]));
printf
(
"
CLASS
\t
\t
R%d
\t
:%s"
,
a
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]));
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_MODULE
,
BB
)
:
printf
(
"
OP_
MODULE
\t
R%d
\t
:%s"
,
a
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]));
printf
(
"MODULE
\t
R%d
\t
:%s"
,
a
,
mrb_sym_dump
(
mrb
,
irep
->
syms
[
b
]));
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_EXEC
,
BB
)
:
printf
(
"
OP_EXEC
\t
R%d
\t
I(%d:%p)"
,
a
,
b
,
(
void
*
)
irep
->
reps
[
b
]);
printf
(
"
EXEC
\t
\t
R%d
\t
I(%d:%p)"
,
a
,
b
,
(
void
*
)
irep
->
reps
[
b
]);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_SCLASS
,
B
)
:
printf
(
"
OP_SCLASS
\t
R%d
\t
"
,
a
);
printf
(
"
SCLASS
\t
\t
R%d
\t
"
,
a
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_TCLASS
,
B
)
:
printf
(
"
OP_
TCLASS
\t
R%d
\t\t
"
,
a
);
printf
(
"TCLASS
\t
R%d
\t\t
"
,
a
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_ERR
,
B
)
:
if
((
irep
->
pool
[
a
].
tt
&
IREP_TT_NFLAG
)
==
0
)
{
printf
(
"
OP_ERR
\t
%s
\n
"
,
irep
->
pool
[
a
].
u
.
str
);
printf
(
"
ERR
\t
\t
%s
\n
"
,
irep
->
pool
[
a
].
u
.
str
);
}
else
{
printf
(
"
OP_
ERR
\t
L(%d)
\n
"
,
a
);
printf
(
"ERR
\t
L(%d)
\n
"
,
a
);
}
break
;
CASE
(
OP_EXCEPT
,
B
)
:
printf
(
"
OP_
EXCEPT
\t
R%d
\t\t
"
,
a
);
printf
(
"EXCEPT
\t
R%d
\t\t
"
,
a
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_RESCUE
,
BB
)
:
printf
(
"
OP_
RESCUE
\t
R%d
\t
R%d"
,
a
,
b
);
printf
(
"RESCUE
\t
R%d
\t
R%d"
,
a
,
b
);
print_lv_ab
(
mrb
,
irep
,
a
,
b
);
break
;
CASE
(
OP_RAISEIF
,
B
)
:
printf
(
"
OP_
RAISEIF
\t
R%d
\t\t
"
,
a
);
printf
(
"RAISEIF
\t
R%d
\t\t
"
,
a
);
print_lv_a
(
mrb
,
irep
,
a
);
break
;
CASE
(
OP_DEBUG
,
BBB
)
:
printf
(
"
OP_DEBUG
\t
%d
\t
%d
\t
%d
\n
"
,
a
,
b
,
c
);
printf
(
"
DEBUG
\t
\t
%d
\t
%d
\t
%d
\n
"
,
a
,
b
,
c
);
break
;
CASE
(
OP_STOP
,
Z
)
:
printf
(
"
OP_
STOP
\n
"
);
printf
(
"STOP
\n
"
);
break
;
CASE
(
OP_EXT1
,
Z
)
:
...
...
@@ -598,7 +598,7 @@ codedump(mrb_state *mrb, const mrb_irep *irep)
break
;
default:
printf
(
"
OP_unknown
(0x%x)
\n
"
,
ins
);
printf
(
"
unknown_op
(0x%x)
\n
"
,
ins
);
break
;
}
mrb_gc_arena_restore
(
mrb
,
ai
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment