-
Notifications
You must be signed in to change notification settings - Fork 396
Use standard loading mechanism for jl.Object in Analyzer #4890
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
Conversation
@@ -216,8 +215,6 @@ object Analysis { | |||
|
|||
def logError(error: Error, logger: Logger, level: Level): Unit = { | |||
val headMsg = error match { | |||
case MissingJavaLangObjectClass(_) => | |||
"Fatal error: java.lang.Object is missing" |
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.
@sjrd, if you feel we need to keep this error, we have two alternatives:
- Emit it in addition when the lookup of
ObjectClass
returns anonExistentClass
- Special case
ClassInfo#link
to emit a different error ifclassName == ObjectClass
(there is precedent forClassInfo
to behave differently if it is jlO, so it's not that bad).
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.
The special error was only there because I thought it would crash the rest of the Analyzer if Object
was missing. If it doesn't crash, it's fine.
Perhaps add a test where jl.Object
is missing but there actually is another class? Currently the only test we have has no class at all.
7fbac61
to
5ae12d4
Compare
5ae12d4
to
4fe66ec
Compare
FWIW: Maybe we should split this into two commits. LMK if you'd like me to do this. |
4fe66ec
to
c58c82b
Compare
I have:
|
The Analyzer is built with the assumption that the number of pending tasks never drops to zero until the whole analysis is completed. However, our loading sequence violated this assumption: since the constructor of LoadingClass scheduled info loading immediately, it was possible for info loading to complete before linking is requested on the class. If this condition happens on the initial calling thread (which itself is not tracked as a "task"), the pending task count would drop to zero.
Discovered as a simplification while working on scala-js#1626.
c58c82b
to
42cd08d
Compare
|
Discovered as a simplification while working on #1626.
This also exposes a latent bug in the class loading sequence: the
Analyzer is built with the assumption that pending tasks never drop to
zero until the whole analysis is completed.
However, our loading sequence violated this assumption: since the
constructor of LoadingClass scheduled info loading immediately, it was
possible for info loading to complete before linking is requested on
the class. If this condition happens on the initial calling
thread (which itself is not tracked as a "task"), the pending task
count would drop to zero.