|
@@ -44,14 +44,16 @@ class TestJs {
|
|
for (v in a) { }
|
|
for (v in a) { }
|
|
}
|
|
}
|
|
|
|
|
|
- @:js("var a = 1;var tmp;var v2 = a;tmp = a + v2;tmp;")
|
|
|
|
|
|
+ @:js('var a = 1;var v2 = a;if(a + v2 > 0) TestJs["use"](a);')
|
|
@:analyzer(no_const_propagation)
|
|
@:analyzer(no_const_propagation)
|
|
@:analyzer(no_copy_propagation)
|
|
@:analyzer(no_copy_propagation)
|
|
@:analyzer(no_check_has_effect)
|
|
@:analyzer(no_check_has_effect)
|
|
@:analyzer(no_local_dce)
|
|
@:analyzer(no_local_dce)
|
|
static function testInlineWithArgumentUsedMoreThanOnce() {
|
|
static function testInlineWithArgumentUsedMoreThanOnce() {
|
|
var a = 1;
|
|
var a = 1;
|
|
- if (_inlineWithArgumentUsedMoreThanOnce(a) > 0) { }
|
|
|
|
|
|
+ if (_inlineWithArgumentUsedMoreThanOnce(a) > 0) {
|
|
|
|
+ use(a);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
inline static function _inlineWithArgumentUsedMoreThanOnce(v) {
|
|
inline static function _inlineWithArgumentUsedMoreThanOnce(v) {
|
|
@@ -228,10 +230,8 @@ class TestJs {
|
|
|
|
|
|
@:js('
|
|
@:js('
|
|
var map = new haxe_ds_StringMap();
|
|
var map = new haxe_ds_StringMap();
|
|
- var tmp;
|
|
|
|
if(__map_reserved.some != null) map.setReserved("some",2); else map.h["some"] = 2;
|
|
if(__map_reserved.some != null) map.setReserved("some",2); else map.h["some"] = 2;
|
|
- tmp = 2;
|
|
|
|
- var i = tmp;
|
|
|
|
|
|
+ var i = 2;
|
|
TestJs["use"](i);
|
|
TestJs["use"](i);
|
|
')
|
|
')
|
|
static function testIssue4731() {
|
|
static function testIssue4731() {
|
|
@@ -243,10 +243,8 @@ class TestJs {
|
|
|
|
|
|
@:js('
|
|
@:js('
|
|
var x = TestJs.getInt();
|
|
var x = TestJs.getInt();
|
|
- var tmp;
|
|
|
|
TestJs.getInt();
|
|
TestJs.getInt();
|
|
- tmp = TestJs.getInt();
|
|
|
|
- TestJs.call([x,"foo"],tmp);
|
|
|
|
|
|
+ TestJs.call([x,"foo"],TestJs.getInt());
|
|
')
|
|
')
|
|
static function testMightBeAffected1() {
|
|
static function testMightBeAffected1() {
|
|
var x = getInt();
|
|
var x = getInt();
|
|
@@ -259,10 +257,8 @@ class TestJs {
|
|
@:js('
|
|
@:js('
|
|
var x = TestJs.getInt();
|
|
var x = TestJs.getInt();
|
|
var tmp = [x,"foo"];
|
|
var tmp = [x,"foo"];
|
|
- var tmp1;
|
|
|
|
x = TestJs.getInt();
|
|
x = TestJs.getInt();
|
|
- tmp1 = TestJs.getInt();
|
|
|
|
- TestJs.call(tmp,tmp1);
|
|
|
|
|
|
+ TestJs.call(tmp,TestJs.getInt());
|
|
')
|
|
')
|
|
static function testMightBeAffected2() {
|
|
static function testMightBeAffected2() {
|
|
var x = getInt();
|
|
var x = getInt();
|
|
@@ -275,10 +271,8 @@ class TestJs {
|
|
@:js('
|
|
@:js('
|
|
var x = TestJs.getInt();
|
|
var x = TestJs.getInt();
|
|
var tmp = x;
|
|
var tmp = x;
|
|
- var tmp1;
|
|
|
|
++x;
|
|
++x;
|
|
- tmp1 = TestJs.getInt();
|
|
|
|
- TestJs.call(tmp,tmp1);
|
|
|
|
|
|
+ TestJs.call(tmp,TestJs.getInt());
|
|
')
|
|
')
|
|
static function testMightBeAffected3() {
|
|
static function testMightBeAffected3() {
|
|
var x = getInt();
|
|
var x = getInt();
|
|
@@ -518,26 +512,20 @@ class TestJs {
|
|
}
|
|
}
|
|
|
|
|
|
@:js('
|
|
@:js('
|
|
- var d1;
|
|
|
|
- var d11 = TestJs.call(1,2);
|
|
|
|
- d1 = TestJs.call(TestJs.call(3,4),d11);
|
|
|
|
- var d2;
|
|
|
|
|
|
+ var d1 = TestJs.call(1,2);
|
|
|
|
+ var d11 = TestJs.call(TestJs.call(3,4),d1);
|
|
var d12 = TestJs.call(5,6);
|
|
var d12 = TestJs.call(5,6);
|
|
- d2 = TestJs.call(TestJs.call(7,8),d12);
|
|
|
|
- TestJs.call(d2,d1);
|
|
|
|
|
|
+ TestJs.call(TestJs.call(TestJs.call(7,8),d12),d11);
|
|
')
|
|
')
|
|
static function testInlineRebuilding7() {
|
|
static function testInlineRebuilding7() {
|
|
inlineCall(inlineCall(call(1, 2), call(3, 4)), inlineCall(call(5, 6), call(7, 8)));
|
|
inlineCall(inlineCall(call(1, 2), call(3, 4)), inlineCall(call(5, 6), call(7, 8)));
|
|
}
|
|
}
|
|
|
|
|
|
@:js('
|
|
@:js('
|
|
- var d1;
|
|
|
|
- var d11 = TestJs.call(1,2);
|
|
|
|
- d1 = TestJs.call(TestJs.intField,d11);
|
|
|
|
- var d2;
|
|
|
|
|
|
+ var d1 = TestJs.call(1,2);
|
|
|
|
+ var d11 = TestJs.call(TestJs.intField,d1);
|
|
var d12 = TestJs.intField;
|
|
var d12 = TestJs.intField;
|
|
- d2 = TestJs.call(TestJs.call(5,6),d12);
|
|
|
|
- TestJs.call(d2,d1);
|
|
|
|
|
|
+ TestJs.call(TestJs.call(TestJs.call(5,6),d12),d11);
|
|
')
|
|
')
|
|
static function testInlineRebuilding8() {
|
|
static function testInlineRebuilding8() {
|
|
inlineCall(inlineCall(call(1, 2), intField), inlineCall(intField, call(5, 6)));
|
|
inlineCall(inlineCall(call(1, 2), intField), inlineCall(intField, call(5, 6)));
|