Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: V8: cherry-pick f915fa4c9f41 #55484

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
27 changes: 27 additions & 0 deletions test/parallel/test-repl-preview-timeout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
'use strict';

const common = require('../common');
const ArrayStream = require('../common/arraystream');
const assert = require('assert');
const repl = require('repl');

common.skipIfInspectorDisabled();

const inputStream = new ArrayStream();
const outputStream = new ArrayStream();
repl.start({
input: inputStream,
output: outputStream,
useGlobal: false,
terminal: true,
useColors: true
});

let output = '';
outputStream.write = (chunk) => output += chunk;

// Input without '\n' triggering actual run.
const input = 'while (true) {}';
inputStream.emit('data', input);
// No preview available when timed out.
assert.strictEqual(output, input);
Loading