v8/test/mjsunit/regress/regress-1154961.js
Ross McIlroy 51401b4be7 [TurboProp] Fix dynamic check maps register saving on x64
BUG=chromium:1155499,chromium:1154961

Change-Id: I29948a63e477ef28b7599eb53db17b127662a641
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2574697
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: Mythri Alle <mythria@chromium.org>
Auto-Submit: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71637}
2020-12-07 10:03:25 +00:00

43 lines
830 B
JavaScript

// Copyright 2020 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.
// Flags: --allow-natives-syntax --turboprop --stack-size=100
function runNearStackLimit(f) {
function t() {
try {
return t();
} catch (e) {
return f();
}
}
return t();
}
function baz(f) {
return [[f(1)], 1, 2, 3, 4, 5, 6, 7, 8];
}
function foo(__v_3) {
try {
var arr = baz(__v_3);
} catch (e) {}
try {
for (var i = 0; i < arr.length; i++) {
function bar() {
return arr[i];
}
try {
throw e;
} catch (e) {}
}
} catch (e) {}
}
%PrepareFunctionForOptimization(foo);
foo(a => a);
foo(a => a);
%OptimizeFunctionOnNextCall(foo);
runNearStackLimit(() => { foo(a => a); });