deps: V8: cherry-pick f915fa4c9f41

Original commit message:

    [osr] Ensure trying to osr does not skip loop interrupts

    Fixed: 374013413
    Change-Id: I52d7b4e165e0abd0bd517a81d2e8ef3f1f802bfb
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5946288
    Commit-Queue: Darius Mercadier <dmercadier@chromium.org>
    Auto-Submit: Olivier Flückiger <olivf@chromium.org>
    Reviewed-by: Darius Mercadier <dmercadier@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#96708}

Refs: f915fa4c9f
PR-URL: https://github.com/nodejs/node/pull/55014
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
This commit is contained in:
Olivier Flückiger 2024-10-21 13:29:28 +02:00 committed by Michaël Zasso
parent 99ffe3555a
commit 52d39441d0
No known key found for this signature in database
GPG Key ID: 770F7A9A5AE15600
3 changed files with 24 additions and 2 deletions

View File

@ -37,7 +37,7 @@
# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.9',
'v8_embedder_string': '-node.10',
##### V8 defaults for Node.js #####

View File

@ -1338,7 +1338,14 @@ MaybeHandle<Code> GetOrCompileOptimized(
}
// Do not optimize when debugger needs to hook into every call.
if (isolate->debug()->needs_check_on_function_call()) return {};
if (isolate->debug()->needs_check_on_function_call()) {
// Reset the OSR urgency to avoid triggering this compilation request on
// every iteration and thereby skipping other interrupts.
if (IsOSR(osr_offset)) {
function->feedback_vector()->reset_osr_urgency();
}
return {};
}
// Do not optimize if we need to be able to set break points.
if (shared->HasBreakInfo(isolate)) return {};

View File

@ -0,0 +1,15 @@
// 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.
// Flags: --enable-inspector
var Debug = debug.Debug;
Debug.sendMessageForMethodChecked('Runtime.enable', {});
const {msgid, msg} = Debug.createMessage('Runtime.evaluate', {
expression: 'while(true) {}',
throwOnSideEffect: true,
timeout: 1000,
})
Debug.sendMessage(msg);
Debug.takeReplyChecked(msgid).toString();