Skip to content

Make LazyVals implement non-static modules. Move LV after erasure. #493

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

Merged
merged 47 commits into from
Apr 30, 2015

Conversation

DarkDimius
Copy link
Contributor

Known to fail due data-race in pos/S5.

@DarkDimius
Copy link
Contributor Author

@odersky can you take this over?
This changes seem to reveal a data race due to TreeTypeMap in changeOwner in pos/S5 and pos/t0453.

@DarkDimius
Copy link
Contributor Author

a0bb466 is here to workaround #494, but I believe it's generally better to implement mini-phases without prepareXXX methods.

@odersky
Copy link
Contributor

odersky commented Apr 22, 2015

There's indeed a problem relating Mixin and Memoize. Memoize does not generate the required fields
for getters and setters introduced by Mixin. The transformFollowing would fix that, except it causes other problems. Still investigating...

@DarkDimius
Copy link
Contributor Author

@odersky test is failing as you have lost some of the changes while rewriting history. If you are done, I'll take this PR over.

@odersky
Copy link
Contributor

odersky commented Apr 23, 2015

@DarkDimius OK, over to you,

@DarkDimius
Copy link
Contributor Author

Current state: fails Ychecking after LambdaLift.

@DarkDimius
Copy link
Contributor Author

af680d4 was very tricky to catch. Took two days.
@odersky please review.

@DarkDimius
Copy link
Contributor Author

Two last commits enable compiling down to bytecode for all tests, and compile Dotty itself.
Though it still does not run.

@odersky
Copy link
Contributor

odersky commented Apr 28, 2015

We get an OutOfMemory error on this one. What's our heap size here?

val sym = ctx.newSymbol(owner, nme.WHILE_PREFIX, Flags.Label | Flags.Synthetic,
MethodType(Nil, defn.UnitType), coord = cond.pos)

val call = Apply(ref(sym), Nil)
Copy link
Contributor

Choose a reason for hiding this comment

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

Use ref(sym).appliedToNone? (Not a strong opinion on this).

@odersky
Copy link
Contributor

odersky commented Apr 28, 2015

That's all I have.

@DarkDimius
Copy link
Contributor Author

I'll perform renamings in upcoming commit.

[@DarkDimius] I see no good reason for this, as it creates tight coupling between `ifs` in two methods.
[@odersky] The reason is probably in the deleted comment:

     // allocate field early so that initializer has the right owner for subsequent phases in
     // the group.

We now transform the rhs in subsequent phases with the getter as owner, where before it was the field.
It is not clear to me whether this matters or not.

[Update] We figured out the problem: It was a missing changeOwnerAfter in Constructor. Added to next commit.
@DarkDimius
Copy link
Contributor Author

Out of memory on travis solved.
Now build on travis runs constrained to 1G of memory, 2Mb of stack.
Last fixes were able to decrease needed memory to compile dotc from 1.5Gb to 0.5Gb.
@odersky please have a look.

@odersky
Copy link
Contributor

odersky commented Apr 30, 2015

Can you try again with enteredAfter instead of entered and remove the redundant Flags. prefixes? Otherwise LGTM.

DarkDimius added a commit that referenced this pull request Apr 30, 2015
Make LazyVals implement non-static modules. Move LV after erasure.
@DarkDimius DarkDimius merged commit 3392ef7 into scala:master Apr 30, 2015
@allanrenucci allanrenucci deleted the fix-modules branch December 14, 2017 19:20
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.

2 participants