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

[v12.x] deps: V8: backport postmortem metadata fixes #30870

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion common.gypi
Expand Up @@ -38,7 +38,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.21',
'v8_embedder_string': '-node.23',

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

Expand Down
2 changes: 2 additions & 0 deletions deps/v8/BUILD.gn
Expand Up @@ -895,6 +895,8 @@ action("postmortem-metadata") {
"src/objects/code.h",
"src/objects/data-handler.h",
"src/objects/data-handler-inl.h",
"src/objects/descriptor-array.h",
"src/objects/descriptor-array-inl.h",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't we need the same change in v8.gyp?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought so, but it worked on my machine when I built it (metadata was correct in the final binary). I also couldn't find where to change on V8.gyp when I searched using grep. I think we're inferring this parameter from BUILD.gn now?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes I'm sorry, it must be one of the lists that are scraped automatically from build.gn

"src/objects/feedback-cell.h",
"src/objects/feedback-cell-inl.h",
"src/objects/fixed-array-inl.h",
Expand Down
18 changes: 8 additions & 10 deletions deps/v8/tools/gen-postmortem-metadata.py
Expand Up @@ -230,15 +230,6 @@

{ 'name': 'class_SharedFunctionInfo__function_data__Object',
'value': 'SharedFunctionInfo::kFunctionDataOffset' },

{ 'name': 'class_ConsString__first_offset__int',
'value': 'ConsString::kFirstOffset' },
{ 'name': 'class_ConsString__second_offset__int',
'value': 'ConsString::kSecondOffset' },
{ 'name': 'class_SlicedString__offset_offset__int',
'value': 'SlicedString::kOffsetOffset' },
{ 'name': 'class_ThinString__actual_offset__int',
'value': 'ThinString::kActualOffset' },
];

#
Expand Down Expand Up @@ -286,6 +277,12 @@
'Code, instruction_start, uintptr_t, kHeaderSize',
'Code, instruction_size, int, kInstructionSizeOffset',
'String, length, int32_t, kLengthOffset',
'DescriptorArray, header_size, uintptr_t, kHeaderSize',
'ConsString, first, String, kFirstOffset',
'ConsString, second, String, kSecondOffset',
'SlicedString, offset, SMI, kOffsetOffset',
'ThinString, actual, String, kActualOffset',
'Symbol, name, Object, kNameOffset',
];

#
Expand All @@ -296,7 +293,8 @@
expected_classes = [
'ConsString', 'FixedArray', 'HeapNumber', 'JSArray', 'JSFunction',
'JSObject', 'JSRegExp', 'JSPrimitiveWrapper', 'Map', 'Oddball', 'Script',
'SeqOneByteString', 'SharedFunctionInfo', 'ScopeInfo', 'JSPromise'
'SeqOneByteString', 'SharedFunctionInfo', 'ScopeInfo', 'JSPromise',
'DescriptorArray'
];


Expand Down
4 changes: 2 additions & 2 deletions src/v8abbr.h
Expand Up @@ -104,9 +104,9 @@
#define V8_OFF_STR_CHARS \
V8_OFF_HEAP(V8DBG_CLASS_SEQONEBYTESTRING__CHARS__CHAR)
#define V8_OFF_CONSSTR_CAR \
V8_OFF_HEAP(V8DBG_CLASS_CONSSTRING__FIRST_OFFSET__INT)
V8_OFF_HEAP(V8DBG_CLASS_CONSSTRING__FIRST__STRING)
#define V8_OFF_CONSSTR_CDR \
V8_OFF_HEAP(V8DBG_CLASS_CONSSTRING__SECOND_OFFSET__INT)
V8_OFF_HEAP(V8DBG_CLASS_CONSSTRING__SECOND__STRING)
#define V8_OFF_EXTSTR_RSRC \
V8_OFF_HEAP(V8DBG_CLASS_EXTERNALSTRING__RESOURCE__OBJECT)
#define V8_OFF_FA_SIZE \
Expand Down
8 changes: 4 additions & 4 deletions test/v8-updates/test-postmortem-metadata.js
Expand Up @@ -62,8 +62,8 @@ function getExpectedSymbols() {
'v8dbg_bit_field3_number_of_own_descriptors_shift',
'v8dbg_class_Code__instruction_size__int',
'v8dbg_class_Code__instruction_start__uintptr_t',
'v8dbg_class_ConsString__first_offset__int',
'v8dbg_class_ConsString__second_offset__int',
'v8dbg_class_ConsString__first__String',
'v8dbg_class_ConsString__second__String',
'v8dbg_class_FixedArray__data__uintptr_t',
'v8dbg_class_FixedArrayBase__length__SMI',
'v8dbg_class_JSTypedArray__base_pointer__Object',
Expand Down Expand Up @@ -104,10 +104,10 @@ function getExpectedSymbols() {
'v8dbg_class_SharedFunctionInfo__name_or_scope_info__Object',
'v8dbg_class_SharedFunctionInfo__script_or_debug_info__Object',
'v8dbg_class_UncompiledData__start_position__int32_t',
'v8dbg_class_SlicedString__offset_offset__int',
'v8dbg_class_SlicedString__offset__SMI',
'v8dbg_class_SlicedString__parent__String',
'v8dbg_class_String__length__int32_t',
'v8dbg_class_ThinString__actual_offset__int',
'v8dbg_class_ThinString__actual__String',
'v8dbg_context_idx_scope_info',
'v8dbg_context_idx_prev',
'v8dbg_context_min_slots',
Expand Down