Skip to content
This repository has been archived by the owner on Dec 10, 2022. It is now read-only.

Relooper.2018 #291

Open
wants to merge 61 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
1678d02
Added @JTranscRelooper annotation to manual control relooping
soywiz Jan 14, 2018
565962a
Some unfinished work
soywiz Jan 14, 2018
aef4ecf
Merge branch 'master' of github.com:jtransc/jtransc into relooper.2018
soywiz Jan 15, 2018
8092d1c
Not working: Some work on new relooper
soywiz Jan 15, 2018
6e7aba8
Small fix in relooper
soywiz Jan 15, 2018
30c3c28
More work on relooper
soywiz Jan 15, 2018
ad07e44
Some more work on relooper
soywiz Jan 15, 2018
39d89b7
Some more work on relooper
soywiz Jan 15, 2018
ba7e03d
Some Relooper adjustments
soywiz Jan 15, 2018
404e005
Some more work on relooper
soywiz Jan 15, 2018
8ca8e22
Some more work on relooper
soywiz Jan 15, 2018
3ec897c
Some more work on relooper
soywiz Jan 15, 2018
5ff3685
Some more work on relooper
soywiz Jan 15, 2018
ecd691b
Some more work on relooper
soywiz Jan 15, 2018
3f1c637
Some more work on relooper
soywiz Jan 15, 2018
19f8ee1
Some more work on relooper
soywiz Jan 15, 2018
c7ed617
Some more work on relooper
soywiz Jan 16, 2018
1f5e449
Some more work on relooper
soywiz Jan 16, 2018
829393d
Remove old annotations
soywiz Jan 16, 2018
887797b
Output jtransc version with JS for convenience
soywiz Jan 16, 2018
ca3697f
Old comment
soywiz Jan 16, 2018
0f6ece9
Add a flag for generators to specify if they support labels (most of …
soywiz Jan 16, 2018
61d9b81
Optimize DO_WHILE + if continue + break externally
soywiz Jan 16, 2018
f384cd0
Some more work on relooper
soywiz Jan 16, 2018
91b2168
Supported white and for loops
soywiz Jan 16, 2018
f1faab9
Enable relooper in benchmark
soywiz Jan 16, 2018
ce878e2
This PR will start 0.7 branch
soywiz Jan 16, 2018
84a323c
Inline errors
soywiz Jan 16, 2018
009e53d
Added failing test case using relooper + test code generator when deb…
soywiz Jan 16, 2018
dd4dd2e
Remove empty nodes, that were making the strong component contract (t…
soywiz Jan 16, 2018
1679db2
Do not create additional exit node if not required
soywiz Jan 16, 2018
ae6db58
Revert previos: we need end node for this to work properly
soywiz Jan 16, 2018
1e4c067
Fixed some relooper cases
soywiz Jan 16, 2018
90b2fc1
Some loop optimizations
soywiz Jan 16, 2018
fa640a7
Updated version
soywiz Jan 16, 2018
bc1c646
Detects if && chains
soywiz Jan 17, 2018
26b5b0d
Detects if || chains
soywiz Jan 17, 2018
2932f7e
Small fixes
soywiz Jan 17, 2018
2f13dd0
ConcurrentModification fix
soywiz Jan 17, 2018
fea7cf9
Convert recursive functions into normal queues
soywiz Jan 17, 2018
0a1611f
Optimize IF_ELSE with return on both sides
soywiz Jan 17, 2018
d1bf5d4
Optimize some IF_ELSE to act as guard clauses
soywiz Jan 17, 2018
7dd53ef
Kotlin 1.2.20
soywiz Jan 17, 2018
f39d87c
Fixed a problematic bug related to indices not matching in Relooper
soywiz Jan 17, 2018
3bd4e7a
org.gradle.caching=true
soywiz Jan 17, 2018
e7627df
Throw statements can be also guard clauses
soywiz Jan 17, 2018
8e80373
Remove exit node cycle
soywiz Jan 17, 2018
29f92a8
Detect some ifs leading to the exit point (return and throws)
soywiz Jan 17, 2018
7707735
Prepare to support switches in relooper
soywiz Jan 17, 2018
a083765
Some more work on supporting switch on relooper
soywiz Jan 17, 2018
4b04237
First switch implementation with ifs
soywiz Jan 17, 2018
9cbd1bb
Compact else-if chains to reduce indentation
soywiz Jan 17, 2018
b98197f
Disable switch in relooper temporarily
soywiz Jan 17, 2018
2e84278
Some work on fixing switches with a new/better conversor to basic Stm…
soywiz Jan 17, 2018
d1b3f37
switch fixes
soywiz Jan 17, 2018
34521b8
Some switch fixes
soywiz Jan 17, 2018
10a5ed4
Proper switch working (common node finding still requires some work t…
soywiz Jan 17, 2018
4159fcf
Prefer break/continue over return/throw as guard clauses
soywiz Jan 17, 2018
28699bc
Proper generate switch
soywiz Jan 17, 2018
6ef715c
Fix floating point comparisons
soywiz Jan 18, 2018
a8ebb76
Update badges to represent master instead of last build
soywiz Jan 18, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Small fixes
  • Loading branch information
soywiz committed Jan 17, 2018
commit 2932f7efcee4712ea6aabd2467657350da027729
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class GotosFeature : AstMethodFeature() {
try {
return removeRelooper(method, body, settings, types) ?: removeMachineState(body, types)
} catch (t: Throwable) {
System.err.println("Not relooping $method because of exception!:")
t.printStackTrace()
return removeMachineState(body, types)
}
Expand Down
2 changes: 1 addition & 1 deletion jtransc-core/src/com/jtransc/gen/common/CommonGenerator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ abstract class CommonGenerator(val injector: Injector) : IProgramTemplate {

open fun writeClasses(output: SyncVfsFile) {
if (SINGLE_FILE) {
output.removeIfExists()
output[outputFileBaseName].removeIfExists()
if (ADD_UTF8_BOM) {
output[outputFileBaseName] = byteArrayOf(0xEF.toByte(), 0xBB.toByte(), 0xBF.toByte()) + genSingleFileClasses(output).toString().toByteArray()
} else {
Expand Down
2 changes: 1 addition & 1 deletion jtransc-gen-common-tests/src/relooper/RelooperTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static public int simpleIf(int a, int b) {
}
}

@JTranscRelooper(debug = true)
@JTranscRelooper
static public int composedIfAnd(int a, int b) {
if (a < b && a >= 0) {
return -1;
Expand Down
4 changes: 2 additions & 2 deletions jtransc-gen-js/src/com/jtransc/gen/js/JsTarget.kt
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ class JsGenerator(injector: Injector) : CommonGenerator(injector) {

@Suppress("UNCHECKED_CAST")
override fun writeClasses(output: SyncVfsFile) {
output[outputFileBaseName] = ""
output["$outputFileBaseName.map"] = ""
output[outputFileBaseName].remove()
output["$outputFileBaseName.map"].remove()
val concatFilesTrans = copyFiles(output)

val classesIndenter = arrayListOf<Indenter>()
Expand Down