Skip to content

Conversation

@nicolasstucki
Copy link

No description provided.

@nicolasstucki
Copy link
Author

Passed the tests on scala/scala3#3115

@nicolasstucki
Copy link
Author

Needs review

@nicolasstucki nicolasstucki requested review from allanrenucci and removed request for smarter September 14, 2017 08:50
Copy link
Member

@smarter smarter left a 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 {
Copy link
Member

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smarter It is done

lrytz and others added 3 commits September 15, 2017 13:49
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
Copy link

@allanrenucci allanrenucci left a 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

@nicolasstucki
Copy link
Author

Passed the tests on scala/scala3#3115

@nicolasstucki nicolasstucki merged commit 2d90208 into lampepfl:sharing-backend Sep 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants