Skip to content

Commit

Permalink
deps: V8: cherry-pick f915fa4c9f41
Browse files Browse the repository at this point in the history
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: v8/v8@f915fa4
PR-URL: nodejs#55484
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
legendecas authored and louwers committed Nov 2, 2024
1 parent 995a2fe commit ba99119
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,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.10',
'v8_embedder_string': '-node.11',

##### V8 defaults for Node.js #####

Expand Down
9 changes: 8 additions & 1 deletion deps/v8/src/codegen/compiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {};
Expand Down
15 changes: 15 additions & 0 deletions deps/v8/test/debugger/regress/regress-374013413.js
Original file line number Diff line number Diff line change
@@ -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();

0 comments on commit ba99119

Please sign in to comment.