Skip to content

Commit 75fe773

Browse files
author
Julien Gilli
committed
deps: backport 357e6b9 from V8's upstream
Backport 357e6b99ee3927cc075dd8d27c99b89d858f9dd5 from V8's upstream. Original commit message: Add ScopeInfo constants to post-mortem metadata mdb_v8, a post-mortem debugging tool for Node.js, allows users to inspect ScopeInfo structures in order to get more information about closures. Currently, it hardcodes the metadata it uses to find this information. This change allows it to get this metadata from the node binary itself, and thus to adapt to future changes made to the layout of the ScopeInfo data structure. BUG= [email protected] PR: #2974 PR-URL: #2974 Reviewed-By: Rod Vagg <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 451acc7 commit 75fe773

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

deps/v8/src/objects.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -4086,7 +4086,6 @@ class ScopeInfo : public FixedArray {
40864086
FOR_EACH_NUMERIC_FIELD(FIELD_ACCESSORS)
40874087
#undef FIELD_ACCESSORS
40884088

4089-
private:
40904089
enum {
40914090
#define DECL_INDEX(name) k##name,
40924091
FOR_EACH_NUMERIC_FIELD(DECL_INDEX)
@@ -4095,6 +4094,7 @@ class ScopeInfo : public FixedArray {
40954094
kVariablePartIndex
40964095
};
40974096

4097+
private:
40984098
// The layout of the variable part of a ScopeInfo is as follows:
40994099
// 1. ParameterEntries:
41004100
// This part stores the names of the parameters for function scopes. One

deps/v8/tools/gen-postmortem-metadata.py

+9
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,15 @@
132132
'value': 'JavaScriptFrameConstants::kFunctionOffset' },
133133
{ 'name': 'off_fp_args',
134134
'value': 'JavaScriptFrameConstants::kLastParameterOffset' },
135+
136+
{ 'name': 'scopeinfo_idx_nparams',
137+
'value': 'ScopeInfo::kParameterCount' },
138+
{ 'name': 'scopeinfo_idx_nstacklocals',
139+
'value': 'ScopeInfo::kStackLocalCount' },
140+
{ 'name': 'scopeinfo_idx_ncontextlocals',
141+
'value': 'ScopeInfo::kContextLocalCount' },
142+
{ 'name': 'scopeinfo_idx_first_vars',
143+
'value': 'ScopeInfo::kVariablePartIndex' },
135144
];
136145

137146
#

0 commit comments

Comments
 (0)