soywiz-archive / jtransc

Bytecode to source converting Java & Kotlin code into JavaScript, C++, D, C#, PHP, AS3, Dart and Haxe and run it everywhere. Also use JVM code in your favourite language as a library.
https://jtransc.soywiz.com/
Apache License 2.0
632 stars 67 forks source link

Haxe-Cpp synchronized blocks & methods support + Thread improvements in all targets + Kotlin 1.1.4-2 #264

Closed soywiz closed 7 years ago

soywiz commented 7 years ago

Fixed #242 (support synchronized blocks & synchronized methods)

intrigus commented 7 years ago

Will try to have a look at this today/tomorrow :) What's wrong with appveyor btw? I can have a look into it, cause a failing build is ugly :)

codecov[bot] commented 7 years ago

Codecov Report

Merging #264 into master will increase coverage by 0.03%. The diff coverage is 65.95%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #264      +/-   ##
============================================
+ Coverage     17.85%   17.89%   +0.03%     
  Complexity      388      388              
============================================
  Files           313      312       -1     
  Lines         20773    20765       -8     
  Branches       4502     4502              
============================================
+ Hits           3710     3715       +5     
+ Misses        16388    16374      -14     
- Partials        675      676       +1
Impacted Files Coverage Δ Complexity Δ
.../com/jtransc/ast/treeshaking/TemplateReferences.kt 0% <ø> (ø) 0 <0> (ø) :arrow_down:
...e/src/com/jtransc/ast/template/CommonTagHandler.kt 0% <0%> (ø) 0 <0> (ø) :arrow_down:
.../src/com/jtransc/io/JTranscConsolePrintStream.java 0% <0%> (ø) 0 <0> (ø) :arrow_down:
...sc-gen-haxe/src/com/jtransc/gen/haxe/HaxeTarget.kt 79.52% <100%> (+0.15%) 11 <0> (ø) :arrow_down:
...ransc-gen-cpp/src/com/jtransc/gen/cpp/CppTarget.kt 82.03% <93.1%> (-0.37%) 4 <0> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 4670454...bb9774b. Read the comment docs.

codecov-io commented 7 years ago

Codecov Report

Merging #264 into master will increase coverage by 0.03%. The diff coverage is 33.5%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #264      +/-   ##
============================================
+ Coverage     17.85%   17.89%   +0.03%     
  Complexity      388      388              
============================================
  Files           313      312       -1     
  Lines         20773    20749      -24     
  Branches       4502     4495       -7     
============================================
+ Hits           3710     3713       +3     
+ Misses        16388    16360      -28     
- Partials        675      676       +1
Impacted Files Coverage Δ Complexity Δ
.../com/jtransc/ast/treeshaking/TemplateReferences.kt 0% <ø> (ø) 0 <0> (ø) :arrow_down:
...ransc-gen-as3/src/com/jtransc/gen/as3/As3Target.kt 0% <ø> (ø) 0 <0> (ø) :arrow_down:
...ransc-gen-php/src/com/jtransc/gen/php/PhpTarget.kt 0% <ø> (ø) 0 <0> (ø) :arrow_down:
jtransc-gen-js/src/com/jtransc/gen/js/JsTarget.kt 87.36% <ø> (-0.41%) 4 <0> (ø)
...core/src/com/jtransc/gen/common/CommonGenerator.kt 0% <0%> (ø) 0 <0> (ø) :arrow_down:
...ansc-gen-cs/src/com/jtransc/gen/cs/CSharpTarget.kt 0% <0%> (ø) 0 <0> (ø) :arrow_down:
...e/src/com/jtransc/ast/template/CommonTagHandler.kt 0% <0%> (ø) 0 <0> (ø) :arrow_down:
.../src/com/jtransc/io/JTranscConsolePrintStream.java 0% <0%> (ø) 0 <0> (ø) :arrow_down:
...e/src/com/jtransc/plugin/enum/EnumJTranscPlugin.kt 0% <0%> (ø) 0 <0> (ø) :arrow_down:
jtransc-core/src/com/jtransc/ast/ast.kt 3.19% <0%> (+0.01%) 0 <0> (ø) :arrow_down:
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 4670454...f6c97ab. Read the comment docs.

soywiz commented 7 years ago

@intrigus it seems that cinst the chocolatey package manager for windows https://chocolatey.org/ fails installing haxe. But it is not a persistent issue. Maybe they have connection issues or something broke. Now it seems to be working. But maybe again it is temporal. Maybe we should try to cache chocolatey packages to minimize connection issues?

At any rate, I have created this repo: https://github.com/jtransc/jtransc-ci-experiments for doing experiments without having to create PRs. If you want to do experiments related to that, and once you have a good change, you can make a PR here.


In later commits I have implemented haxe synchronized methods. So now Haxe is on par with other targets. I implemented it with a try..catch surrounding the whole body + intercepting all return points, so I am not required to create additional methods.

I have also improved Thread API, simplifying it and supporting some other methods like join, or partial support for ThreadGroup.

@intrigus I have noticed that pure C++ target crashes when other threads are created. After some experiments, the culprit seems to be the GC. Not fixed (though uploaded some comments with the direction I tried, but not sure if it is compatible with C++11 threads; an investigation is required for this), just ignored thread test in C++ target explaining the reason.