[JS IR] Drop TemporaryAssignmentElimination optimization
Enable TemporaryAssignment tests
This commit is contained in:
committed by
Space Team
parent
a79282cec1
commit
25f7b81d51
+6
-5
@@ -1,11 +1,12 @@
|
||||
function test(n) {
|
||||
var result;
|
||||
var $tmp;
|
||||
if (n >= 0) {
|
||||
result = n;
|
||||
}
|
||||
else {
|
||||
result = -n;
|
||||
$tmp = n;
|
||||
} else {
|
||||
$tmp = -n;
|
||||
}
|
||||
result = $tmp;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -17,4 +18,4 @@ function box() {
|
||||
if (result != 20) return "fail2: " + result;
|
||||
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
|
||||
+6
-6
@@ -1,11 +1,11 @@
|
||||
function test(n) {
|
||||
var result;
|
||||
var $tmp;
|
||||
if (n >= 0) {
|
||||
result = n;
|
||||
}
|
||||
else {
|
||||
result = -n;
|
||||
$tmp = n;
|
||||
} else {
|
||||
$tmp = -n;
|
||||
}
|
||||
var result = $tmp;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -17,4 +17,4 @@ function box() {
|
||||
if (result != 20) return "fail2: " + result;
|
||||
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
|
||||
+6
-4
@@ -3,17 +3,19 @@ function f(x) {
|
||||
}
|
||||
|
||||
function box() {
|
||||
var result1, result2;
|
||||
var result1, result2, $a, $b;
|
||||
|
||||
if (f(true)) {
|
||||
result1 = "1";
|
||||
$a = "1";
|
||||
}
|
||||
result1 = $a;
|
||||
if (result1 !== "1") return "fail1: " + result1;
|
||||
|
||||
if (f(false)) {
|
||||
result2 = "1";
|
||||
$b = "1";
|
||||
}
|
||||
result2 = $b;
|
||||
if (result2 !== void 0) return "fail2: " + result2;
|
||||
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
|
||||
+6
-5
@@ -1,10 +1,11 @@
|
||||
function test(n) {
|
||||
var $tmp;
|
||||
if (n >= 0) {
|
||||
return n;
|
||||
}
|
||||
else {
|
||||
return -n;
|
||||
$tmp = n;
|
||||
} else {
|
||||
$tmp = -n;
|
||||
}
|
||||
return $tmp;
|
||||
}
|
||||
|
||||
function box() {
|
||||
@@ -15,4 +16,4 @@ function box() {
|
||||
if (result != 20) return "fail2: " + result;
|
||||
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+5
-3
@@ -1,10 +1,12 @@
|
||||
function test(param) {
|
||||
var $a;
|
||||
var result;
|
||||
if (param > 0) {
|
||||
result = param;
|
||||
$a = param;
|
||||
} else {
|
||||
result = -param;
|
||||
$a = -param;
|
||||
}
|
||||
result = $a;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -16,4 +18,4 @@ function box() {
|
||||
if (result != 20) return "fail2: " + result;
|
||||
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
|
||||
+5
-9
@@ -3,22 +3,19 @@ function f(x) {
|
||||
}
|
||||
|
||||
function testRegular() {
|
||||
var result;
|
||||
result = f("testRegular");
|
||||
var result = f("testRegular");
|
||||
return result;
|
||||
}
|
||||
|
||||
function testIrregular() {
|
||||
var result;
|
||||
result = f("testIrregular");
|
||||
var result = f("testIrregular");
|
||||
return result;
|
||||
}
|
||||
|
||||
function testDoubleUse1() {
|
||||
var result;
|
||||
var $b;
|
||||
$b = f("testDoubleUse1");
|
||||
result = $b;
|
||||
var result = $b;
|
||||
f($b);
|
||||
return result;
|
||||
}
|
||||
@@ -32,10 +29,9 @@ function testDoubleUse2() {
|
||||
}
|
||||
|
||||
function testDoubleUse3() {
|
||||
var result;
|
||||
var $a;
|
||||
$a = f("testDoubleUse3");
|
||||
result = $a;
|
||||
var result = $a;
|
||||
f($a);
|
||||
return result;
|
||||
}
|
||||
@@ -68,4 +64,4 @@ function box() {
|
||||
if (result != "testCircular") return "failCircular: " + result;
|
||||
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
|
||||
+10
-7
@@ -3,40 +3,43 @@ function f(x) {
|
||||
}
|
||||
|
||||
function testCatch1() {
|
||||
var $tmp;
|
||||
var result;
|
||||
try {
|
||||
result = f("testCatch1");
|
||||
$tmp = f("testCatch1");
|
||||
throw new Error();
|
||||
} catch (e) {
|
||||
result = $tmp;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function testCatch2() {
|
||||
var $tmp;
|
||||
var result;
|
||||
try {
|
||||
throw new Error();
|
||||
} catch (e) {
|
||||
result = $tmp;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function testFinally() {
|
||||
var result;
|
||||
try {
|
||||
result = f("testFinally");
|
||||
} finally {
|
||||
}
|
||||
result = f("testFinally");
|
||||
return result;
|
||||
}
|
||||
|
||||
function testOuter() {
|
||||
var $tmp;
|
||||
var result;
|
||||
try {
|
||||
result = f("testOuter");
|
||||
$tmp = f("testOuter");
|
||||
} finally {
|
||||
f("23")
|
||||
}
|
||||
result = $tmp;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -54,4 +57,4 @@ function box() {
|
||||
if (result !== "testOuter") return "testOuter: " + result;
|
||||
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user