mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 08:14:09 -08:00
Fix bug in phi updater. Fix tests
This commit is contained in:
parent
e82518b88f
commit
6196dc80ed
|
@ -13,7 +13,7 @@
|
|||
<option name="MAIN_CLASS_NAME" value="" />
|
||||
<option name="METHOD_NAME" value="" />
|
||||
<option name="TEST_OBJECT" value="package" />
|
||||
<option name="VM_PARAMETERS" value="-ea -Dteavm.junit.target=out -Dteavm.junit.js.runner=htmlunit -Dteavm.junit.js.threads=2" />
|
||||
<option name="VM_PARAMETERS" value="-ea -Dteavm.junit.target=target/js-tests -Dteavm.junit.js.runner=htmlunit -Dteavm.junit.js.threads=2" />
|
||||
<option name="PARAMETERS" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="file://$MODULE_DIR$" />
|
||||
<option name="ENV_VARIABLES" />
|
||||
|
|
|
@ -305,6 +305,9 @@ public class PhiUpdater {
|
|||
|
||||
for (int frontier : frontiers) {
|
||||
BasicBlock frontierBlock = program.basicBlockAt(frontier);
|
||||
if (frontierBlock.getExceptionVariable() == var) {
|
||||
continue;
|
||||
}
|
||||
|
||||
boolean exists = frontierBlock.getPhis().stream()
|
||||
.flatMap(phi -> phi.getIncomings().stream())
|
||||
|
|
|
@ -598,7 +598,7 @@ public class TeaVM implements TeaVMHost, ServiceRepository {
|
|||
if (wasCancelled()) {
|
||||
return;
|
||||
}
|
||||
final Devirtualization devirtualization = new Devirtualization(dependency, classes);
|
||||
Devirtualization devirtualization = new Devirtualization(dependency, classes);
|
||||
int index = 0;
|
||||
for (String className : classes.getClassNames()) {
|
||||
ClassHolder cls = classes.get(className);
|
||||
|
@ -613,7 +613,7 @@ public class TeaVM implements TeaVMHost, ServiceRepository {
|
|||
}
|
||||
}
|
||||
|
||||
final Inlining inlining = new Inlining();
|
||||
Inlining inlining = new Inlining();
|
||||
for (String className : classes.getClassNames()) {
|
||||
ClassHolder cls = classes.get(className);
|
||||
for (final MethodHolder method : cls.getMethods()) {
|
||||
|
|
|
@ -81,25 +81,25 @@ if (typeof 'ArrayBuffer' !== 'undefined') {
|
|||
return new ($rt_arraycls(cls))(nativeArray);
|
||||
};
|
||||
$rt_createCharArray = function(sz) {
|
||||
return $rt_createNumericArray($rt_charcls(), new Uint16Array(new ArrayBuffer(sz << 1)), 0);
|
||||
return $rt_createNumericArray($rt_charcls(), new Uint16Array(sz));
|
||||
};
|
||||
$rt_createByteArray = function(sz) {
|
||||
return $rt_createNumericArray($rt_bytecls(), new Int8Array(new ArrayBuffer(sz)), 0);
|
||||
return $rt_createNumericArray($rt_bytecls(), new Int8Array(sz));
|
||||
};
|
||||
$rt_createShortArray = function(sz) {
|
||||
return $rt_createNumericArray($rt_shortcls(), new Int16Array(new ArrayBuffer(sz << 1)), 0);
|
||||
return $rt_createNumericArray($rt_shortcls(), new Int16Array(sz));
|
||||
};
|
||||
$rt_createIntArray = function(sz) {
|
||||
return $rt_createNumericArray($rt_intcls(), new Int32Array(new ArrayBuffer(sz << 2)), 0);
|
||||
return $rt_createNumericArray($rt_intcls(), new Int32Array(sz));
|
||||
};
|
||||
$rt_createBooleanArray = function(sz) {
|
||||
return $rt_createNumericArray($rt_booleancls(), new Int8Array(new ArrayBuffer(sz)), 0);
|
||||
return $rt_createNumericArray($rt_booleancls(), new Int8Array(sz));
|
||||
};
|
||||
$rt_createFloatArray = function(sz) {
|
||||
return $rt_createNumericArray($rt_floatcls(), new Float32Array(new ArrayBuffer(sz << 2)), 0);
|
||||
return $rt_createNumericArray($rt_floatcls(), new Float32Array(sz));
|
||||
};
|
||||
$rt_createDoubleArray = function(sz) {
|
||||
return $rt_createNumericArray($rt_doublecls(), new Float64Array(new ArrayBuffer(sz << 3)), 0);
|
||||
return $rt_createNumericArray($rt_doublecls(), new Float64Array(sz));
|
||||
};
|
||||
} else {
|
||||
$rt_createNumericArray = function(cls, sz) {
|
||||
|
|
2
tests/out/.gitignore
vendored
2
tests/out/.gitignore
vendored
|
@ -1,2 +0,0 @@
|
|||
*.js
|
||||
run-test.html
|
|
@ -23,10 +23,6 @@ import org.junit.Test;
|
|||
import org.junit.runner.RunWith;
|
||||
import org.teavm.junit.TeaVMTestRunner;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Alexey Andreev
|
||||
*/
|
||||
@RunWith(TeaVMTestRunner.class)
|
||||
public class BufferedReaderTest {
|
||||
@Test
|
||||
|
|
|
@ -19,11 +19,10 @@ import static org.junit.Assert.*;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.teavm.junit.TeaVMTestRunner;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Alexey Andreev
|
||||
*/
|
||||
@RunWith(TeaVMTestRunner.class)
|
||||
public class ThreadTest {
|
||||
@Test
|
||||
public void sleeps() throws InterruptedException {
|
||||
|
|
|
@ -27,10 +27,6 @@ import org.junit.Test;
|
|||
import org.junit.runner.RunWith;
|
||||
import org.teavm.junit.TeaVMTestRunner;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Alexey Andreev
|
||||
*/
|
||||
@RunWith(TeaVMTestRunner.class)
|
||||
public class TimeZoneTest {
|
||||
private static final int ONE_HOUR = 3600000;
|
||||
|
|
|
@ -23,10 +23,6 @@ import org.junit.Test;
|
|||
import org.junit.runner.RunWith;
|
||||
import org.teavm.junit.TeaVMTestRunner;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Alexey Andreev
|
||||
*/
|
||||
@RunWith(TeaVMTestRunner.class)
|
||||
public class GZIPInputStreamTest {
|
||||
@Test
|
||||
|
|
|
@ -21,10 +21,6 @@ import org.junit.runner.RunWith;
|
|||
import org.teavm.junit.SkipJVM;
|
||||
import org.teavm.junit.TeaVMTestRunner;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Alexey Andreev
|
||||
*/
|
||||
@RunWith(TeaVMTestRunner.class)
|
||||
@SkipJVM
|
||||
public class MetadataGeneratorTest {
|
||||
|
|
|
@ -19,8 +19,11 @@ import static org.hamcrest.CoreMatchers.*;
|
|||
import static org.junit.Assert.*;
|
||||
import java.util.List;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.teavm.diagnostics.Problem;
|
||||
import org.teavm.jso.JSBody;
|
||||
import org.teavm.junit.SkipJVM;
|
||||
import org.teavm.junit.TeaVMTestRunner;
|
||||
import org.teavm.model.MethodReference;
|
||||
import org.teavm.model.ValueType;
|
||||
import org.teavm.vm.TeaVM;
|
||||
|
|
Loading…
Reference in New Issue
Block a user