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
90484cac
Unverified
Commit
90484cac
authored
Oct 19, 2021
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
codegen.c: skip `OP_LOADSELF` using `OP_SSEND`.
parent
5d5e4f52
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1005 additions
and
1001 deletions
+1005
-1001
mrbgems/mruby-compiler/core/codegen.c
mrbgems/mruby-compiler/core/codegen.c
+11
-3
mrbgems/mruby-compiler/core/parse.y
mrbgems/mruby-compiler/core/parse.y
+1
-3
mrbgems/mruby-compiler/core/y.tab.c
mrbgems/mruby-compiler/core/y.tab.c
+993
-995
No files found.
mrbgems/mruby-compiler/core/codegen.c
View file @
90484cac
...
...
@@ -1641,10 +1641,15 @@ static void
gen_call
(
codegen_scope
*
s
,
node
*
tree
,
mrb_sym
name
,
int
sp
,
int
val
,
int
safe
)
{
mrb_sym
sym
=
name
?
name
:
nsym
(
tree
->
cdr
->
car
);
int
skip
=
0
;
int
n
=
0
,
nk
=
0
,
noop
=
0
,
blk
=
0
,
sp_save
=
cursp
();
int
skip
=
0
,
n
=
0
,
nk
=
0
,
noop
=
0
,
noself
=
0
,
blk
=
0
,
sp_save
=
cursp
();
codegen
(
s
,
tree
->
car
,
VAL
);
/* receiver */
if
(
!
tree
->
car
)
{
noself
=
noop
=
1
;
push
();
}
else
{
codegen
(
s
,
tree
->
car
,
VAL
);
/* receiver */
}
if
(
safe
)
{
int
recv
=
cursp
()
-
1
;
gen_move
(
s
,
cursp
(),
recv
,
1
);
...
...
@@ -1733,6 +1738,9 @@ gen_call(codegen_scope *s, node *tree, mrb_sym name, int sp, int val, int safe)
else
if
(
!
noop
&&
n
==
1
&&
gen_binop
(
s
,
sym
,
cursp
()))
{
/* constant folding succeeded */
}
else
if
(
noself
){
genop_3
(
s
,
blk
?
OP_SSENDB
:
OP_SSEND
,
cursp
(),
new_sym
(
s
,
sym
),
n
|
(
nk
<<
4
));
}
else
{
genop_3
(
s
,
blk
?
OP_SENDB
:
OP_SEND
,
cursp
(),
new_sym
(
s
,
sym
),
n
|
(
nk
<<
4
));
}
...
...
mrbgems/mruby-compiler/core/parse.y
View file @
90484cac
...
...
@@ -499,9 +499,7 @@ new_call(parser_state *p, node *a, mrb_sym b, node *c, int pass)
static node*
new_fcall(parser_state *p, mrb_sym b, node *c)
{
node *n = new_self(p);
NODE_LINENO(n, c);
n = list4((node*)NODE_FCALL, n, nsym(b), c);
node *n = list4((node*)NODE_FCALL, 0, nsym(b), c);
NODE_LINENO(n, c);
return n;
}
...
...
mrbgems/mruby-compiler/core/y.tab.c
View file @
90484cac
This diff is collapsed.
Click to expand it.
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