2016-09-20 09:35:16 +00:00
|
|
|
// Copyright 2016 the V8 project authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2017-04-28 13:09:31 +00:00
|
|
|
// Flags: --allow-natives-syntax --lazy-inner-functions
|
2016-09-20 09:35:16 +00:00
|
|
|
|
|
|
|
// Test that the information on which variables to allocate in context doesn't
|
|
|
|
// change when recompiling.
|
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestVarInInnerFunction() {
|
2016-09-20 09:35:16 +00:00
|
|
|
// Introduce variables which would potentially be context allocated, depending
|
|
|
|
// on whether an inner function refers to them or not.
|
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
function inner() {
|
|
|
|
var a; // This will make "a" actually not be context allocated.
|
|
|
|
a; b; c;
|
|
|
|
}
|
|
|
|
// Force recompilation.
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-09-20 09:35:16 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestVarInInnerFunction);
|
|
|
|
TestVarInInnerFunction();
|
2016-09-20 09:35:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
// Other tests are the same, except that the shadowing variable "a" in inner
|
|
|
|
// functions is declared differently.
|
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestLetInInnerFunction() {
|
2016-09-20 09:35:16 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
function inner() {
|
|
|
|
let a;
|
|
|
|
a; b; c;
|
|
|
|
}
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-09-20 09:35:16 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestLetInInnerFunction);
|
|
|
|
TestLetInInnerFunction();
|
2016-09-20 09:35:16 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestConstInInnerFunction() {
|
2016-10-10 09:22:22 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
function inner() {
|
|
|
|
const a = 0;
|
|
|
|
a; b; c;
|
|
|
|
}
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestConstInInnerFunction);
|
|
|
|
TestConstInInnerFunction();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestInnerFunctionParameter() {
|
2016-09-20 09:35:16 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
function inner(a) {
|
|
|
|
a; b; c;
|
|
|
|
}
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-09-20 09:35:16 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestInnerFunctionParameter);
|
|
|
|
TestInnerFunctionParameter();
|
2016-09-20 09:35:16 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestInnerFunctionRestParameter() {
|
2016-10-10 09:22:22 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
function inner(...a) {
|
|
|
|
a; b; c;
|
|
|
|
}
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestInnerFunctionRestParameter);
|
|
|
|
TestInnerFunctionRestParameter();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestInnerFunctionDestructuredParameter_1() {
|
2016-11-16 14:50:23 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
function inner([d, a]) {
|
|
|
|
a; b; c;
|
|
|
|
}
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-11-16 14:50:23 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestInnerFunctionDestructuredParameter_1);
|
|
|
|
TestInnerFunctionDestructuredParameter_1();
|
2016-11-16 14:50:23 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestInnerFunctionDestructuredParameter_2() {
|
2016-11-16 14:50:23 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
function inner({d, a}) {
|
|
|
|
a; b; c;
|
|
|
|
}
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-11-16 14:50:23 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestInnerFunctionDestructuredParameter_2);
|
|
|
|
TestInnerFunctionDestructuredParameter_2();
|
2016-11-16 14:50:23 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestInnerArrowFunctionParameter() {
|
2016-11-16 14:50:23 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
(a) => { a; b; c; }
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-11-16 14:50:23 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestInnerArrowFunctionParameter);
|
|
|
|
TestInnerArrowFunctionParameter();
|
2016-11-16 14:50:23 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestInnerArrowFunctionRestParameter() {
|
2016-11-16 14:50:23 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
(...a) => { a; b; c; }
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-11-16 14:50:23 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestInnerArrowFunctionRestParameter);
|
|
|
|
TestInnerArrowFunctionRestParameter();
|
2016-11-16 14:50:23 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestInnerArrowFunctionDestructuredParameter_1() {
|
2016-11-16 14:50:23 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
([d, a]) => { a; b; c; }
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-11-16 14:50:23 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestInnerArrowFunctionDestructuredParameter_1);
|
|
|
|
TestInnerArrowFunctionDestructuredParameter_1();
|
2016-11-16 14:50:23 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestInnerArrowFunctionDestructuredParameter_2() {
|
2016-11-16 14:50:23 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
({d, a}) => { a; b; c; }
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-11-16 14:50:23 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestInnerArrowFunctionDestructuredParameter_2);
|
|
|
|
TestInnerArrowFunctionDestructuredParameter_2();
|
2016-11-16 14:50:23 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestInnerInnerFunctionParameter() {
|
2016-09-20 09:35:16 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
function inner() {
|
|
|
|
function innerinner(a) { a; b; c; }
|
|
|
|
}
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-09-20 09:35:16 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestInnerInnerFunctionParameter);
|
|
|
|
TestInnerInnerFunctionParameter();
|
2016-09-20 09:35:16 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestInnerInnerFunctionRestParameter() {
|
2016-10-10 09:22:22 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
function inner() {
|
|
|
|
function innerinner(...a) { a; b; c; }
|
|
|
|
}
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestInnerInnerFunctionRestParameter);
|
|
|
|
TestInnerInnerFunctionRestParameter();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestInnerInnerFunctionDestructuredParameter_1() {
|
2016-11-16 14:50:23 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
function inner() {
|
|
|
|
function innerinner({d, a}) { a; b; c; }
|
|
|
|
}
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-11-16 14:50:23 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestInnerInnerFunctionDestructuredParameter_1);
|
|
|
|
TestInnerInnerFunctionDestructuredParameter_1();
|
2016-11-16 14:50:23 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestInnerInnerFunctionDestructuredParameter_2() {
|
2016-11-16 14:50:23 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
function inner() {
|
|
|
|
function innerinner([d, a]) { a; b; c; }
|
|
|
|
}
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-11-16 14:50:23 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestInnerInnerFunctionDestructuredParameter_2);
|
|
|
|
TestInnerInnerFunctionDestructuredParameter_2();
|
2016-11-16 14:50:23 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestInnerInnerArrowFunctionParameter() {
|
2016-09-20 09:35:16 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
function inner() {
|
|
|
|
var f = a => a + b + c;
|
|
|
|
}
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-09-20 09:35:16 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestInnerInnerArrowFunctionParameter);
|
|
|
|
TestInnerInnerArrowFunctionParameter();
|
2016-09-20 09:35:16 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestInnerInnerArrowFunctionRestParameter() {
|
2016-10-10 09:22:22 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
function inner() {
|
|
|
|
var f = (...a) => a + b + c;
|
|
|
|
}
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestInnerInnerArrowFunctionRestParameter);
|
|
|
|
TestInnerInnerArrowFunctionRestParameter();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestInnerInnerArrowFunctionDestructuredParameter_1() {
|
2016-11-16 14:50:23 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
function inner() {
|
|
|
|
var f = ([d, a]) => a + b + c;
|
|
|
|
}
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-11-16 14:50:23 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestInnerInnerArrowFunctionDestructuredParameter_1);
|
|
|
|
TestInnerInnerArrowFunctionDestructuredParameter_1();
|
2016-11-16 14:50:23 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestInnerInnerArrowFunctionDestructuredParameter_2() {
|
2016-11-16 14:50:23 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
function inner() {
|
|
|
|
var f = ({d, a}) => a + b + c;
|
|
|
|
}
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-11-16 14:50:23 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestInnerInnerArrowFunctionDestructuredParameter_2);
|
|
|
|
TestInnerInnerArrowFunctionDestructuredParameter_2();
|
2016-11-16 14:50:23 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestInnerFunctionInnerFunction() {
|
2016-09-20 09:35:16 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
function inner() {
|
|
|
|
function a() { }
|
|
|
|
a; b; c;
|
|
|
|
}
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-09-20 09:35:16 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestInnerFunctionInnerFunction);
|
|
|
|
TestInnerFunctionInnerFunction();
|
2016-09-20 09:35:16 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestInnerFunctionSloppyBlockFunction() {
|
2016-09-20 09:35:16 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
function inner() {
|
|
|
|
if (true) { function a() { } }
|
|
|
|
a; b; c;
|
|
|
|
}
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-09-20 09:35:16 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestInnerFunctionSloppyBlockFunction);
|
|
|
|
TestInnerFunctionSloppyBlockFunction();
|
2016-09-20 09:35:16 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestInnerFunctionCatchVariable() {
|
2016-09-20 09:35:16 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
function inner() {
|
|
|
|
try {
|
|
|
|
}
|
|
|
|
catch(a) {
|
|
|
|
a; b; c;
|
|
|
|
}
|
|
|
|
}
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-09-20 09:35:16 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
};
|
|
|
|
%PrepareFunctionForOptimization(TestInnerFunctionCatchVariable);
|
|
|
|
TestInnerFunctionCatchVariable();
|
2016-09-20 09:35:16 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestInnerFunctionLoopVariable1() {
|
2016-09-20 09:35:16 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
function inner() {
|
|
|
|
for (var a in {}) {
|
|
|
|
a; b; c;
|
|
|
|
}
|
|
|
|
}
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-09-20 09:35:16 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestInnerFunctionLoopVariable1);
|
|
|
|
TestInnerFunctionLoopVariable1();
|
2016-09-20 09:35:16 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestInnerFunctionLoopVariable2() {
|
2016-09-20 09:35:16 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
function inner() {
|
|
|
|
for (let a in {}) {
|
|
|
|
a; b; c;
|
|
|
|
}
|
|
|
|
}
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-09-20 09:35:16 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestInnerFunctionLoopVariable2);
|
|
|
|
TestInnerFunctionLoopVariable2();
|
2016-09-20 09:35:16 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestInnerFunctionLoopVariable3() {
|
2016-09-20 09:35:16 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
function inner() {
|
|
|
|
for (var a of []) {
|
|
|
|
a; b; c;
|
|
|
|
}
|
|
|
|
}
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-09-20 09:35:16 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestInnerFunctionLoopVariable3);
|
|
|
|
TestInnerFunctionLoopVariable3();
|
2016-09-20 09:35:16 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestInnerFunctionLoopVariable4() {
|
2016-09-20 09:35:16 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
function inner() {
|
|
|
|
for (let a of []) {
|
|
|
|
a; b; c;
|
|
|
|
}
|
|
|
|
}
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-09-20 09:35:16 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestInnerFunctionLoopVariable4);
|
|
|
|
TestInnerFunctionLoopVariable4();
|
2016-09-20 09:35:16 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestInnerFunctionClass() {
|
2016-09-20 09:35:16 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
function inner() {
|
|
|
|
class a {}
|
|
|
|
a; b; c;
|
|
|
|
}
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-09-20 09:35:16 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestInnerFunctionClass);
|
|
|
|
TestInnerFunctionClass();
|
2016-10-04 09:38:23 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestInnerFunctionDestructuring1() {
|
2016-10-10 09:22:22 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
function inner() {
|
|
|
|
var [a, a2] = [1, 2];
|
|
|
|
a; b; c;
|
|
|
|
}
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestInnerFunctionDestructuring1);
|
|
|
|
TestInnerFunctionDestructuring1();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestInnerFunctionDestructuring2() {
|
2016-10-10 09:22:22 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
function inner() {
|
|
|
|
let [a, a2] = [1, 2];
|
|
|
|
a; b; c;
|
|
|
|
}
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestInnerFunctionDestructuring2);
|
|
|
|
TestInnerFunctionDestructuring2();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestInnerFunctionDestructuring3() {
|
2016-10-10 09:22:22 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
function inner() {
|
|
|
|
const [a, a2] = [1, 2];
|
|
|
|
a; b; c;
|
|
|
|
}
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestInnerFunctionDestructuring3);
|
|
|
|
TestInnerFunctionDestructuring3();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestInnerFunctionDestructuring4() {
|
2016-10-10 09:22:22 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
function inner() {
|
|
|
|
var [a2, ...a] = [1, 2];
|
|
|
|
a; b; c;
|
|
|
|
}
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestInnerFunctionDestructuring4);
|
|
|
|
TestInnerFunctionDestructuring4();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestInnerFunctionDestructuring5() {
|
2016-10-10 09:22:22 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
function inner() {
|
|
|
|
let [a2, ...a] = [1, 2];
|
|
|
|
a; b; c;
|
|
|
|
}
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestInnerFunctionDestructuring5);
|
|
|
|
TestInnerFunctionDestructuring5();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestInnerFunctionDestructuring6() {
|
2016-10-10 09:22:22 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
function inner() {
|
|
|
|
const [a2, ...a] = [1, 2];
|
|
|
|
a; b; c;
|
|
|
|
}
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestInnerFunctionDestructuring6);
|
|
|
|
TestInnerFunctionDestructuring6();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestInnerFunctionDestructuring7() {
|
2016-10-10 09:22:22 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
function inner() {
|
|
|
|
var {a, a2} = {a: 1, a2: 2};
|
|
|
|
a; b; c;
|
|
|
|
}
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestInnerFunctionDestructuring7);
|
|
|
|
TestInnerFunctionDestructuring7();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestInnerFunctionDestructuring8() {
|
2016-10-10 09:22:22 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
function inner() {
|
|
|
|
let {a, a2} = {a: 1, a2: 2};
|
|
|
|
a; b; c;
|
|
|
|
}
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestInnerFunctionDestructuring8);
|
|
|
|
TestInnerFunctionDestructuring8();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestInnerFunctionDestructuring9() {
|
2016-10-10 09:22:22 +00:00
|
|
|
var a = 1;
|
|
|
|
var b = 2;
|
|
|
|
var c = 3;
|
|
|
|
function inner() {
|
|
|
|
const {a, a2} = {a: 1, a2: 2};
|
|
|
|
a; b; c;
|
|
|
|
}
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
assertEquals(1, a);
|
|
|
|
assertEquals(2, b);
|
|
|
|
assertEquals(3, c);
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestInnerFunctionDestructuring9);
|
|
|
|
TestInnerFunctionDestructuring9();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2016-10-04 09:38:23 +00:00
|
|
|
// A cluster of similar tests where the inner function only declares a variable
|
|
|
|
// whose name clashes with an outer function variable name, but doesn't use it.
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_1_var() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-04 09:38:23 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
|
|
|
var a;
|
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_1_var);
|
|
|
|
TestRegress650969_1_var();
|
2016-10-04 09:38:23 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_1_let() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-04 09:38:23 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
2016-10-10 09:22:22 +00:00
|
|
|
let a;
|
2016-10-04 09:38:23 +00:00
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_1_let);
|
|
|
|
TestRegress650969_1_let();
|
2016-10-04 09:38:23 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_2_var() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-04 09:38:23 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
2016-10-10 09:22:22 +00:00
|
|
|
var a = 6;
|
2016-10-04 09:38:23 +00:00
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_2_var);
|
|
|
|
TestRegress650969_2_var();
|
2016-10-04 09:38:23 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_2_let() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-04 09:38:23 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
2016-10-10 09:22:22 +00:00
|
|
|
let a = 6;
|
2016-10-04 09:38:23 +00:00
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_2_let);
|
|
|
|
TestRegress650969_2_let();
|
2016-10-04 09:38:23 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_2_const() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-04 09:38:23 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
2016-10-10 09:22:22 +00:00
|
|
|
const a = 6;
|
2016-10-04 09:38:23 +00:00
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_2_const);
|
|
|
|
TestRegress650969_2_const();
|
2016-10-04 09:38:23 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_3_var() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-04 09:38:23 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
2016-10-10 09:22:22 +00:00
|
|
|
var a, b;
|
2016-10-04 09:38:23 +00:00
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_3_var);
|
|
|
|
TestRegress650969_3_var();
|
2016-10-04 09:38:23 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_3_let() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-04 09:38:23 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
|
|
|
let a, b;
|
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_3_let);
|
|
|
|
TestRegress650969_3_let();
|
2016-10-04 09:38:23 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_4_var() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
|
|
|
var a = 6, b;
|
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_4_var);
|
|
|
|
TestRegress650969_4_var();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_4_let() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-04 09:38:23 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
|
|
|
let a = 6, b;
|
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_4_let);
|
|
|
|
TestRegress650969_4_let();
|
2016-10-04 09:38:23 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_4_const() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
|
|
|
const a = 0, b = 0;
|
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_4_const);
|
|
|
|
TestRegress650969_4_const();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_9_parameter() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-11-16 14:50:23 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner(a) {}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_9_parameter);
|
|
|
|
TestRegress650969_9_parameter();
|
2016-11-16 14:50:23 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_9_restParameter() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-11-16 14:50:23 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner(...a) {}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_9_restParameter);
|
|
|
|
TestRegress650969_9_restParameter();
|
2016-11-16 14:50:23 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_9_destructuredParameter_1() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-11-16 14:50:23 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner([d, a]) {}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_9_destructuredParameter_1);
|
|
|
|
TestRegress650969_9_destructuredParameter_1();
|
2016-11-16 14:50:23 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_9_destructuredParameter_2() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-11-16 14:50:23 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner({d, a}) {}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_9_destructuredParameter_2);
|
|
|
|
TestRegress650969_9_destructuredParameter_2();
|
2016-11-16 14:50:23 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_10_parameter() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-11-16 14:50:23 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
|
|
|
function innerinner(a) {}
|
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_10_parameter);
|
|
|
|
TestRegress650969_10_parameter();
|
2016-11-16 14:50:23 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_10_restParameter() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-04 09:38:23 +00:00
|
|
|
}
|
|
|
|
var a;
|
2016-11-16 14:50:23 +00:00
|
|
|
function inner() {
|
|
|
|
function innerinner(...a) {}
|
2016-10-04 09:38:23 +00:00
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_10_restParameter);
|
|
|
|
TestRegress650969_10_restParameter();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_10_destructuredParameter_1() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
var a;
|
2016-11-16 14:50:23 +00:00
|
|
|
function inner() {
|
|
|
|
function innerinner([d, a]) {}
|
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization( TestRegress650969_10_destructuredParameter_1);
|
|
|
|
TestRegress650969_10_destructuredParameter_1();
|
2016-11-16 14:50:23 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_10_destructuredParameter_2() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-11-16 14:50:23 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
|
|
|
function innerinner({d, a}) {}
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_10_destructuredParameter_2);
|
|
|
|
TestRegress650969_10_destructuredParameter_2();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_11_var() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
|
|
|
var [a, b] = [1, 2];
|
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_11_var);
|
|
|
|
TestRegress650969_11_var();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
|
|
|
|
function TestRegress650969_11_let() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
|
|
|
let [a, b] = [1, 2];
|
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_11_let);
|
|
|
|
TestRegress650969_11_let();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_11_const() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
|
|
|
const [a, b] = [1, 2];
|
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_11_const);
|
|
|
|
TestRegress650969_11_const();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_12_var() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
|
|
|
var [b, a] = [1, 2];
|
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_12_var);
|
|
|
|
TestRegress650969_12_var();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_12_let() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
|
|
|
let [b, a] = [1, 2];
|
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_12_let);
|
|
|
|
TestRegress650969_12_let();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_12_const() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
|
|
|
const [b, a] = [1, 2];
|
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_12_const);
|
|
|
|
TestRegress650969_12_const();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_13_var() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
|
|
|
var [b, ...a] = [1, 2];
|
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_13_var);
|
|
|
|
TestRegress650969_13_var();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_13_let() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
|
|
|
let [b, ...a] = [1, 2];
|
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_13_let);
|
|
|
|
TestRegress650969_13_let();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_13_const() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
|
|
|
const [b, ...a] = [1, 2];
|
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_13_const);
|
|
|
|
TestRegress650969_13_const();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_14_var() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
|
|
|
var {a, b} = {a: 1, b: 2};
|
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_14_var);
|
|
|
|
TestRegress650969_14_var();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_14_let() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
|
|
|
let {a, b} = {a: 1, b: 2};
|
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_14_let);
|
|
|
|
TestRegress650969_14_let();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_14_const() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
|
|
|
const {a, b} = {a: 1, b: 2};
|
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_14_const);
|
|
|
|
TestRegress650969_14_const();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_15_var() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
|
|
|
var {b: {a}, c} = {b: {a: 1}, c: 2};
|
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_15_var);
|
|
|
|
TestRegress650969_15_var();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_15_let() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
|
|
|
let {b: {a}, c} = {b: {a: 1}, c: 2};
|
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_15_let);
|
|
|
|
TestRegress650969_15_let();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_15_const() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
|
|
|
const {b: {a}, c} = {b: {a: 1}, c: 2};
|
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_15_const);
|
|
|
|
TestRegress650969_15_const();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_16_var() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
|
|
|
var {a: {b}, c} = {a: {b: 1}, c: 2};
|
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_16_var);
|
|
|
|
TestRegress650969_16_var();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_16_let() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
|
|
|
let {a: {b}, c} = {a: {b: 1}, c: 2};
|
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_16_let);
|
|
|
|
TestRegress650969_16_let();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_16_const() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
|
|
|
const {a: {b}, c} = {a: {b: 1}, c: 2};
|
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_16_const);
|
|
|
|
TestRegress650969_16_const();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_17_var() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
|
|
|
for (var a = 0; 0 == 1; ) { }
|
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_17_var);
|
|
|
|
TestRegress650969_17_var();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_17_let() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
|
|
|
for (let a = 0; 0 == 1; ) { }
|
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_17_let);
|
|
|
|
TestRegress650969_17_let();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_17_const() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
|
|
|
for (const a = 0; 0 == 1; ) { }
|
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_17_const);
|
|
|
|
TestRegress650969_17_const();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_18() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-11-16 14:50:23 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
|
|
|
function innerinner([a, b]) {}
|
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_18);
|
|
|
|
TestRegress650969_18();
|
2016-11-16 14:50:23 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_18() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-11-16 14:50:23 +00:00
|
|
|
}
|
|
|
|
var a;
|
|
|
|
function inner() {
|
|
|
|
function innerinner(a) {}
|
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_18);
|
|
|
|
TestRegress650969_18();
|
2016-11-16 14:50:23 +00:00
|
|
|
|
2016-10-10 09:22:22 +00:00
|
|
|
// Regression tests for an intermediate stage where unresolved references were
|
|
|
|
// discarded too aggressively.
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_sidetrack_var() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
var a = 0;
|
|
|
|
function inner() {
|
|
|
|
return a;
|
|
|
|
var {b: {a}, c} = {b: {a: 1}, c: 2};
|
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_sidetrack_var);
|
|
|
|
TestRegress650969_sidetrack_var();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_sidetrack_let() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
var a = 0;
|
|
|
|
function inner() {
|
|
|
|
return a;
|
|
|
|
let {b: {a}, c} = {b: {a: 1}, c: 2};
|
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_sidetrack_let);
|
|
|
|
TestRegress650969_sidetrack_let();
|
2016-10-10 09:22:22 +00:00
|
|
|
|
2019-05-03 14:32:12 +00:00
|
|
|
function TestRegress650969_sidetrack_const() {
|
2022-02-21 14:01:31 +00:00
|
|
|
for (var i = 0; i < 3; ++i) {
|
|
|
|
if (i == 1) {
|
|
|
|
%OptimizeOsr();
|
2016-10-10 09:22:22 +00:00
|
|
|
}
|
|
|
|
var a = 0;
|
|
|
|
function inner() {
|
|
|
|
return a;
|
|
|
|
const {b: {a}, c} = {b: {a: 1}, c: 2};
|
|
|
|
}
|
|
|
|
}
|
2019-05-03 14:32:12 +00:00
|
|
|
}
|
|
|
|
%PrepareFunctionForOptimization(TestRegress650969_sidetrack_const);
|
|
|
|
TestRegress650969_sidetrack_const();
|