src: add rudimentary Promise support#272
Closed
mmarchini wants to merge 1 commit intonodejs:masterfrom
Closed
Conversation
Contributor
Author
|
The metadata landed in v8/v8@8aaa186ed42, it will be available in Node.js v12. We can backport if we want this in Node.js v10. |
Contributor
|
@mmarchini can you also update https://github.com/nodejs/node/blob/master/test/v8-updates/test-postmortem-metadata.js (or just ping me and I can do it). |
This patch allows llnode to list Promise objects with findjsobjects, findjsinstances and findrefs. We can investigate more fancy Promise features in the future (such as listing handlers, Promise status, etc.). For Node.js v10.x, since we don't have the JS_PROMISE type as postmortem metadata, we assume JS_PROMISE is the next type after JS_MESSAGE_OBJECT_TYPE. This is a safe assumption for Node.js v10.x, v12.x has the JS_PROMISE type, and v8.x is not supported anymore. ```console $ git log v10.0.0..v10.17.0 -L :InstanceType:deps/v8/src/objects.h | grep -C2 "JS_PROMISE" JS_MAP_VALUE_ITERATOR_TYPE, JS_MESSAGE_OBJECT_TYPE, JS_PROMISE_TYPE, JS_REGEXP_TYPE, JS_REGEXP_STRING_ITERATOR_TYPE, -- JS_MAP_VALUE_ITERATOR_TYPE, JS_MESSAGE_OBJECT_TYPE, JS_PROMISE_TYPE, JS_REGEXP_TYPE, + JS_REGEXP_STRING_ITERATOR_TYPE, ```
mmarchini
added a commit
to mmarchini/node
that referenced
this pull request
Jan 14, 2020
type_JSPromise__JS_PROMISE_TYPE and type_JSMessageObject__JS_MESSAGE_OBJECT_TYPE will be used on llnode to identify Promises in memory and core dumps: nodejs/llnode#272. Add these to our postmortem test so we're aware of any changes to this metadata.
4 tasks
Contributor
Author
|
@cjihrig done nodejs/node#31357 I also updated the pull request with a presumably safe default for |
mmarchini
added a commit
to nodejs/node
that referenced
this pull request
Jan 16, 2020
type_JSPromise__JS_PROMISE_TYPE and type_JSMessageObject__JS_MESSAGE_OBJECT_TYPE will be used on llnode to identify Promises in memory and core dumps: nodejs/llnode#272. Add these to our postmortem test so we're aware of any changes to this metadata. PR-URL: #31357 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
codebytere
pushed a commit
to nodejs/node
that referenced
this pull request
Feb 17, 2020
type_JSPromise__JS_PROMISE_TYPE and type_JSMessageObject__JS_MESSAGE_OBJECT_TYPE will be used on llnode to identify Promises in memory and core dumps: nodejs/llnode#272. Add these to our postmortem test so we're aware of any changes to this metadata. PR-URL: #31357 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
mmarchini
added a commit
that referenced
this pull request
Mar 25, 2020
This patch allows llnode to list Promise objects with findjsobjects,
findjsinstances and findrefs. We can investigate more fancy Promise
features in the future (such as listing handlers, Promise status, etc.).
For Node.js v10.x, since we don't have the JS_PROMISE type as postmortem
metadata, we assume JS_PROMISE is the next type after
JS_MESSAGE_OBJECT_TYPE. This is a safe assumption for Node.js v10.x,
v12.x has the JS_PROMISE type, and v8.x is not supported anymore.
```console
$ git log v10.0.0..v10.17.0 -L :InstanceType:deps/v8/src/objects.h \
| grep -C2 "JS_PROMISE"
JS_MAP_VALUE_ITERATOR_TYPE,
JS_MESSAGE_OBJECT_TYPE,
JS_PROMISE_TYPE,
JS_REGEXP_TYPE,
JS_REGEXP_STRING_ITERATOR_TYPE,
--
JS_MAP_VALUE_ITERATOR_TYPE,
JS_MESSAGE_OBJECT_TYPE,
JS_PROMISE_TYPE,
JS_REGEXP_TYPE,
+ JS_REGEXP_STRING_ITERATOR_TYPE,
```
PR-URL: #272
Contributor
Author
|
Landed in 991c731 |
Pull Request Test Coverage Report for Build 2b5721172516eef0643525467a6365e913a191d3-PR-272Warning: This coverage report may be inaccurate.We've detected an issue with your CI configuration that might affect the accuracy of this pull request's coverage report.
💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch allows llnode to list Promise objects with findjsobjects,
findjsinstances and findrefs. We can investigate more fancy Promise
features in the future (such as listing handlers, Promise status, etc.).