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=

  R=bmeurer@chromium.org

PR: #2974
PR-URL: https://github.com/nodejs/node/pull/2974
Reviewed-By: Rod Vagg <r@va.gg>
Reviewed-By: Ben Noordhuis <ben@strongloop.com>
This commit is contained in:
Julien Gilli 2015-09-20 21:39:37 -07:00
Родитель 451acc7559
Коммит 75fe7739e6
2 изменённых файлов: 10 добавлений и 1 удалений

2
deps/v8/src/objects.h поставляемый
Просмотреть файл

@ -4086,7 +4086,6 @@ class ScopeInfo : public FixedArray {
FOR_EACH_NUMERIC_FIELD(FIELD_ACCESSORS) FOR_EACH_NUMERIC_FIELD(FIELD_ACCESSORS)
#undef FIELD_ACCESSORS #undef FIELD_ACCESSORS
private:
enum { enum {
#define DECL_INDEX(name) k##name, #define DECL_INDEX(name) k##name,
FOR_EACH_NUMERIC_FIELD(DECL_INDEX) FOR_EACH_NUMERIC_FIELD(DECL_INDEX)
@ -4095,6 +4094,7 @@ class ScopeInfo : public FixedArray {
kVariablePartIndex kVariablePartIndex
}; };
private:
// The layout of the variable part of a ScopeInfo is as follows: // The layout of the variable part of a ScopeInfo is as follows:
// 1. ParameterEntries: // 1. ParameterEntries:
// This part stores the names of the parameters for function scopes. One // This part stores the names of the parameters for function scopes. One

9
deps/v8/tools/gen-postmortem-metadata.py поставляемый
Просмотреть файл

@ -132,6 +132,15 @@ consts_misc = [
'value': 'JavaScriptFrameConstants::kFunctionOffset' }, 'value': 'JavaScriptFrameConstants::kFunctionOffset' },
{ 'name': 'off_fp_args', { 'name': 'off_fp_args',
'value': 'JavaScriptFrameConstants::kLastParameterOffset' }, 'value': 'JavaScriptFrameConstants::kLastParameterOffset' },
{ 'name': 'scopeinfo_idx_nparams',
'value': 'ScopeInfo::kParameterCount' },
{ 'name': 'scopeinfo_idx_nstacklocals',
'value': 'ScopeInfo::kStackLocalCount' },
{ 'name': 'scopeinfo_idx_ncontextlocals',
'value': 'ScopeInfo::kContextLocalCount' },
{ 'name': 'scopeinfo_idx_first_vars',
'value': 'ScopeInfo::kVariablePartIndex' },
]; ];
# #