polyglot-compiler / JLang

JLang: Ahead-of-time compilation of Java programs to LLVM
http://polyglot-compiler.github.io/JLang/
Other
284 stars 29 forks source link

Implement `synchronized` keyword in the compiler frontend #50

Closed guoyiteng closed 4 years ago

guoyiteng commented 4 years ago

This PR is still WIP. What's left is to desugar synchronized keyword in the method signature.

guoyiteng commented 4 years ago

Now, the compiler emits synchronized method call in the caller site. The logic is not exactly the same as a try-finally code to avoid the dominate all uses error. I also added a simple monitor in runtime to check the correctness of the implementation.

dz333 commented 4 years ago

Add something like this to the test suite as well: SynchronizedTest.txt

Currently this passes, which is good :)

dz333 commented 4 years ago

LGTM