-
Notifications
You must be signed in to change notification settings - Fork 2
Port #4963 #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port #4963 #23
Conversation
|
Passed the tests on scala/scala3#3115 |
|
Needs review |
smarter
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For each ported commit, it would be nice to edit the message to give the hash of the corresponding original commit
|
|
||
| object BCodeHelpers { | ||
|
|
||
| class InvokeStyle(val style: Int) extends AnyVal { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you port this, I think it would also make sense to port the rest of 7a12e81 if it's not too hard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smarter It is done
2e272b1 to
2e3214c
Compare
Port of 7a12e81
2e3214c to
136c562
Compare
GenBCode used to generate more bytecode for branching instructions than
GenASM. A simple method
def f(x: Int, b: Boolean) = if (b) 1 else 2
would generate
ILOAD 2
IFNE L1
GOTO L2
L1
ICONST_1
GOTO L3
L2
ICONST_2
L3
IRETURN
If the conditional branch is negated (IFEQ) the GOTO is unnecessary.
While -Yopt:l:method would clean this up, it's also not too hard to
generate the leaner bytecode in the first place.
Port of f70c77e
When loading a value of type scala.runtime.Null$ we need to add POP; ACONST_NULL, see comment in BCodeBodyBuilder.adapt. This is however not necessary if the null value is a simple ACONST_NULL. This patch eliminates that redundancy. Port of 9b334b2
136c562 to
040ccf2
Compare
allanrenucci
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM provided that the tests pass
|
Passed the tests on scala/scala3#3115 |
No description provided.