v8/test/mjsunit/maglev/set-pending-message.js
jameslahm 28ee240b20 [maglev] Support SetPendingMessage
Bug: v8:7700
Change-Id: Ib3f799f37110ea6ba56417d868a25794abbfa08b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3813071
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82245}
2022-08-08 07:38:02 +00:00

23 lines
637 B
JavaScript

// Copyright 2022 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 --maglev --no-stress-opt --no-always-turbofan
function foo() {
try {
} finally {
return 1;
}
}
%PrepareFunctionForOptimization(foo);
assertEquals(foo(), 1);
assertEquals(foo(), 1);
%OptimizeMaglevOnNextCall(foo);
assertEquals(foo(), 1)
// Maglev will not compile this function now because it has handler table.
// After exceptions are supported in Maglev, we could enable the assert below.
// assertTrue(isMaglevved(foo));