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
optimize def f(args) = synchronized { ... } #64
Comments
Imported From: https://issues.scala-lang.org/browse/SI-64?orig=1 |
@dragos said: |
@odersky said: |
@dcsobral said:
I wonder what optimization you have made... or whether this was reverted at some point. I see no difference in the generated code with recent trunk than what was originally posted. |
@dragos said: |
@khernyo said: It can transform a method with synchronized body into a synchronized method, but the inlining of these methods are disabled because it would result in code without proper synchronization. I'm not going to finish it because I can't justify the additional complexity of the inliner. |
@lrytz said: |
@paulp said: public synchronized java.lang.String f();
flags: ACC_PUBLIC, ACC_SYNCHRONIZED
Code:
stack=1, locals=1, args_size=1
0: ldc #12 // String str
2: areturn |
Java:
gets compiled to
Scala:
gets compiled to
Although Java
is also compiled to something like Scala compiler outputs, I think Scalac should optimize special case
The text was updated successfully, but these errors were encountered: