2024-08-14 20:41:00 +02:00
|
|
|
// Copyright 2024 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.
|
|
|
|
|
2025-04-29 08:03:15 +02:00
|
|
|
// Flags: --allow-natives-syntax --turbolev --turbofan
|
2024-08-14 20:41:00 +02:00
|
|
|
// Flags: --no-maglev-inline-api-calls
|
|
|
|
// Flags: --no-rcs
|
|
|
|
|
|
|
|
function g() { }
|
|
|
|
|
|
|
|
function main() {
|
|
|
|
var err = new Error();
|
|
|
|
return err.stack;
|
|
|
|
}
|
|
|
|
|
|
|
|
Error.prepareStackTrace = function() { return "The stack trace\n"; };
|
|
|
|
|
|
|
|
%PrepareFunctionForOptimization(main);
|
|
|
|
let stack = main();
|
|
|
|
%OptimizeFunctionOnNextCall(main);
|
|
|
|
assertEquals(stack, main());
|
|
|
|
assertOptimized(main);
|