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
0923ff63
Commit
0923ff63
authored
Aug 16, 2019
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimize bytecode for `Class#new`.
parent
61763129
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
src/class.c
src/class.c
+10
-12
No files found.
src/class.c
View file @
0923ff63
...
...
@@ -2119,17 +2119,15 @@ inspect_main(mrb_state *mrb, mrb_value mod)
static
mrb_code
new_iseq
[]
=
{
OP_ENTER
,
0x0
,
0x10
,
0x1
,
/* OP_ENTER 0:0:1:0:0:0:1 */
OP_LOADSELF
,
0x4
,
/* OP_LOADSELF R4 */
OP_SEND
,
0x4
,
0x0
,
0x0
,
/* OP_SEND R4 :allocate 0 */
OP_MOVE
,
0x3
,
0x4
,
/* OP_MOVE R0 R3 */
OP_LOADNIL
,
0x5
,
/* OP_LOADNIL R5 */
OP_MOVE
,
0x6
,
0x1
,
/* OP_MOVE R6 R1 */
OP_ARYCAT
,
0x5
,
/* OP_ARYCAT R5 */
OP_MOVE
,
0x6
,
0x2
,
/* OP_MOVE R6 R2 */
OP_SENDVB
,
0x4
,
0x1
,
/* OP_SENDVB R4 :initialize */
OP_RETURN
,
0x3
/* OP_RETURN R0 */
OP_LOADSELF
,
0x3
,
/* OP_LOADSELF R3 */
OP_SEND
,
0x3
,
0x0
,
0x0
,
/* OP_SEND R3 :allocate 0 */
OP_MOVE
,
0x0
,
0x3
,
/* OP_MOVE R0 R3 */
OP_MOVE
,
0x4
,
0x1
,
/* OP_MOVE R4 R1 */
OP_MOVE
,
0x5
,
0x2
,
/* OP_MOVE R5 R2 */
OP_SENDVB
,
0x3
,
0x1
,
/* OP_SENDVB R4 :initialize */
OP_RETURN
,
0x0
/* OP_RETURN R0 */
};
static
void
init_class_new
(
mrb_state
*
mrb
,
struct
RClass
*
cls
)
{
...
...
@@ -2146,8 +2144,8 @@ init_class_new(mrb_state *mrb, struct RClass *cls)
new_irep
->
flags
=
MRB_ISEQ_NO_FREE
;
new_irep
->
iseq
=
new_iseq
;
new_irep
->
ilen
=
sizeof
(
new_iseq
);
new_irep
->
nregs
=
7
;
new_irep
->
nlocals
=
4
;
new_irep
->
nregs
=
6
;
new_irep
->
nlocals
=
3
;
p
=
mrb_proc_new
(
mrb
,
new_irep
);
MRB_METHOD_FROM_PROC
(
m
,
p
);
mrb_define_method_raw
(
mrb
,
cls
,
mrb_intern_lit
(
mrb
,
"new"
),
m
);
...
...
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