-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
[v24.x] deps: cherry-pick 5ba9200 from V8 upstream #60620
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
base: v24.x-staging
Are you sure you want to change the base?
Conversation
|
Review requested:
|
93c8e26 to
2f4af40
Compare
Original commit message:
Fix crash when pausing in for-of loop header
Given a for-of loop:
for (const each of subject) {
The bytecode generator emits the iterator.next call + done check +
assigning to `each` all into the source position of `const each`.
The pseudo-desugared code looks something like:
var tmp;
loop {
var result = iterator.next();
if (result.done) break;
tmp = result.value;
PushBlockContext;
const each = tmp;
// rest of the loop.
}
This is a problem, as the parser starts the block scope already on
the `const each`. If the scope requires a context we can pause on
bytecode that has or has not pushed the block context yet, while
the source position looks the same.
The recent addition of per-script unique scope IDs lets us fix
this problem in the debugger: We can check if the scope ID of
the runtime scope matches the parser scope. If not, the context
was not pushed yet.
The debugger already has a `HasContext` helper. We extend it to
also check for matching scope IDs and then use `HasContext` where
we would read variable values off the context. If the context was
not pushed yet, we report them as 'unavailable'.
[email protected]
Fixed: 384413079,399002824
Change-Id: Ia2d0008d574e7eaf6c06b640053df696014d37f8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6507402
Reviewed-by: Leszek Swirski <[email protected]>
Commit-Queue: Simon Zünd <[email protected]>
Cr-Commit-Position: refs/heads/main@{#100029}
Refs: v8/v8@5ba9200
Fixes: nodejs#60580
PR-URL: nodejs#60620
Signed-off-by: Juan José Arboleda <[email protected]>
targos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look like a cherry-pick of v8/v8@5ba9200, which should already be on main anyway since it landed in V8 13.8
Whoops, that's right, wrong base branch. |
2f4af40 to
92a5707
Compare
Original commit message:
Fix crash when pausing in for-of loop header
Given a for-of loop:
for (const each of subject) {
The bytecode generator emits the iterator.next call + done check +
assigning to `each` all into the source position of `const each`.
The pseudo-desugared code looks something like:
var tmp;
loop {
var result = iterator.next();
if (result.done) break;
tmp = result.value;
PushBlockContext;
const each = tmp;
// rest of the loop.
}
This is a problem, as the parser starts the block scope already on
the `const each`. If the scope requires a context we can pause on
bytecode that has or has not pushed the block context yet, while
the source position looks the same.
The recent addition of per-script unique scope IDs lets us fix
this problem in the debugger: We can check if the scope ID of
the runtime scope matches the parser scope. If not, the context
was not pushed yet.
The debugger already has a `HasContext` helper. We extend it to
also check for matching scope IDs and then use `HasContext` where
we would read variable values off the context. If the context was
not pushed yet, we report them as 'unavailable'.
[email protected]
Fixed: 384413079,399002824
Change-Id: Ia2d0008d574e7eaf6c06b640053df696014d37f8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6507402
Reviewed-by: Leszek Swirski <[email protected]>
Commit-Queue: Simon Zünd <[email protected]>
Cr-Commit-Position: refs/heads/main@{#100029}
Refs: v8/v8@5ba9200
Fixes: nodejs#60580
PR-URL: nodejs#60620
Signed-off-by: Juan José Arboleda <[email protected]>
|
Still not a cherry-pick. I highly recommend you use |
Original commit message:
Fix crash when pausing in for-of loop header
Given a for-of loop:
for (const each of subject) {
The bytecode generator emits the iterator.next call + done check +
assigning to `each` all into the source position of `const each`.
The pseudo-desugared code looks something like:
var tmp;
loop {
var result = iterator.next();
if (result.done) break;
tmp = result.value;
PushBlockContext;
const each = tmp;
// rest of the loop.
}
This is a problem, as the parser starts the block scope already on
the `const each`. If the scope requires a context we can pause on
bytecode that has or has not pushed the block context yet, while
the source position looks the same.
The recent addition of per-script unique scope IDs lets us fix
this problem in the debugger: We can check if the scope ID of
the runtime scope matches the parser scope. If not, the context
was not pushed yet.
The debugger already has a `HasContext` helper. We extend it to
also check for matching scope IDs and then use `HasContext` where
we would read variable values off the context. If the context was
not pushed yet, we report them as 'unavailable'.
[email protected]
Fixed: 384413079,399002824
Change-Id: Ia2d0008d574e7eaf6c06b640053df696014d37f8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6507402
Reviewed-by: Leszek Swirski <[email protected]>
Commit-Queue: Simon Zünd <[email protected]>
Cr-Commit-Position: refs/heads/main@{#100029}
Refs: v8/v8@5ba9200
Fixes: nodejs#60580
PR-URL: nodejs#60620
Signed-off-by: Juan José Arboleda <[email protected]>
92a5707 to
fa32f3f
Compare
Original commit message:
Fix crash when pausing in for-of loop header
Given a for-of loop:
for (const each of subject) {
The bytecode generator emits the iterator.next call + done check +
assigning to `each` all into the source position of `const each`.
The pseudo-desugared code looks something like:
var tmp;
loop {
var result = iterator.next();
if (result.done) break;
tmp = result.value;
PushBlockContext;
const each = tmp;
// rest of the loop.
}
This is a problem, as the parser starts the block scope already on
the `const each`. If the scope requires a context we can pause on
bytecode that has or has not pushed the block context yet, while
the source position looks the same.
The recent addition of per-script unique scope IDs lets us fix
this problem in the debugger: We can check if the scope ID of
the runtime scope matches the parser scope. If not, the context
was not pushed yet.
The debugger already has a `HasContext` helper. We extend it to
also check for matching scope IDs and then use `HasContext` where
we would read variable values off the context. If the context was
not pushed yet, we report them as 'unavailable'.
[email protected]
Fixed: 384413079,399002824
Change-Id: Ia2d0008d574e7eaf6c06b640053df696014d37f8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6507402
Reviewed-by: Leszek Swirski <[email protected]>
Commit-Queue: Simon Zünd <[email protected]>
Cr-Commit-Position: refs/heads/main@{#100029}
Refs: v8/v8@5ba9200
Fixes: nodejs#60580
PR-URL: nodejs#60620
Signed-off-by: Juan José Arboleda <[email protected]>
fa32f3f to
7586563
Compare
yes yes, I'm just a mess with git! Thanks! Also, is it possible to send my "fork" of v8 to node core utils? I don't want to fetch that again, I've my own tree. Seems ready now, sorry for the noise. |
Yes, with |
Original commit message:
[debug] Fix crash when pausing in for-of loop header
Given a for-of loop:
for (const each of subject) {
The bytecode generator emits the iterator.next call + done check +
assigning to `each` all into the source position of `const each`.
The pseudo-desugared code looks something like:
var tmp;
loop {
var result = iterator.next();
if (result.done) break;
tmp = result.value;
PushBlockContext;
const each = tmp;
// rest of the loop.
}
This is a problem, as the parser starts the block scope already on
the `const each`. If the scope requires a context we can pause on
bytecode that has or has not pushed the block context yet, while
the source position looks the same.
The recent addition of per-script unique scope IDs lets us fix
this problem in the debugger: We can check if the scope ID of
the runtime scope matches the parser scope. If not, the context
was not pushed yet.
The debugger already has a `HasContext` helper. We extend it to
also check for matching scope IDs and then use `HasContext` where
we would read variable values off the context. If the context was
not pushed yet, we report them as 'unavailable'.
[email protected]
Fixed: 384413079,399002824
Change-Id: Ia2d0008d574e7eaf6c06b640053df696014d37f8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6507402
Reviewed-by: Leszek Swirski <[email protected]>
Commit-Queue: Simon Zünd <[email protected]>
Cr-Commit-Position: refs/heads/main@{#100029}
Refs: v8/v8@5ba9200
Fixes: nodejs#60580
PR-URL: nodejs#60620
Signed-off-by: Juan José Arboleda <[email protected]>
7586563 to
d8e7ab5
Compare
Thanks! PTAL :) |
$ curl -L https://github.com/v8/v8/commit/5ba9200cd04602c486ff5a5fc4f9e0d4ab19606b.patch | head -3
From 5ba9200cd04602c486ff5a5fc4f9e0d4ab19606b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Simon=20Z=C3=BCnd?= <[email protected]>
Date: Fri, 2 May 2025 10:44:42 +0000
$ curl -L https://github.com/nodejs/node/pull/60620/commits/d8e7ab5d77e85ff0257314acfd43546ae1a4ff2f.patch | head -3
From d8e7ab5d77e85ff0257314acfd43546ae1a4ff2f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juan=20Jos=C3=A9=20Arboleda?= <[email protected]>
Date: Fri, 7 Nov 2025 14:26:58 -0500Is it expected that the date and author do not match? |
Yes, it is expected
|
Original commit message:
Fix crash when pausing in for-of loop header
Given a for-of loop:
The bytecode generator emits the iterator.next call + done check +
assigning to
eachall into the source position ofconst each.The pseudo-desugared code looks something like:
This is a problem, as the parser starts the block scope already on
the
const each. If the scope requires a context we can pause onbytecode that has or has not pushed the block context yet, while
the source position looks the same.
The recent addition of per-script unique scope IDs lets us fix
this problem in the debugger: We can check if the scope ID of
the runtime scope matches the parser scope. If not, the context
was not pushed yet.
The debugger already has a
HasContexthelper. We extend it toalso check for matching scope IDs and then use
HasContextwherewe would read variable values off the context. If the context was
not pushed yet, we report them as 'unavailable'.
R=[email protected]
Fixed: 384413079,399002824
Change-Id: Ia2d0008d574e7eaf6c06b640053df696014d37f8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6507402
Reviewed-by: Leszek Swirski [email protected]
Commit-Queue: Simon Zünd [email protected]
Cr-Commit-Position: refs/heads/main@{#100029}
Refs: v8/v8@5ba9200
Fixes: #60580
PR-URL: #60620