-
Notifications
You must be signed in to change notification settings - Fork 18
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
joyent/mdb_v8#23 support V8 4.4.x and 4.5.x #24
joyent/mdb_v8#23 support V8 4.4.x and 4.5.x #24
Conversation
06a61da
to
daf91c6
Compare
This looks great! My only issue is in src/v8dbg.h, lines 52-53 (the definition of V8_STRENC_ASCII()). My concern is that we're always checking both cases, even though we know which one it should be (based on whether V8_AsciiStringTag or V8_OneByteStringTag is uninitialized). The case I'm worried about is where a garbage object's tag accidentally matches whichever of these is uninitialized. I think it would be better to check whether the corresponding tag is actually initialized before using it, as we do at for V8_IS_FAILURE() at https://github.com/misterdjules/mdb_v8/blob/update-for-v8-4.5/src/v8dbg.h#L31-L33. |
@davepacheco Absolutely, sorry for missing that in the first place. I updated this PR with a separate commit that hopefully does what you had in mind. Please let me know what you think. |
Tested these changes with node v0.10.40, v0.12.7, nodejs/node master with V8 4.4.x and 4.5.x, and both 32bits and 64bits for all these versions and all mdb_v8 tests passed. I also verified manually that the output from |
Actually, I had run only the tests that used to be included in node when mdb_v8 was in I'll get to that on Tuesday, since Monday is a holiday. |
1fed56b
to
ccda2ad
Compare
@davepacheco The latest commit in this PR fixes I'd like to get your feedback on these latest changes before moving forward. One of the things I'm not a big fan of is having a constant hardcoded in |
The change looks good overall. But we can't wait for postmortem metadata to show up in the binary before support works. We've always provided fallback values to handle that situation. Can we not do that here? As for the constant value: is it a constant in the V8 source? If so, I wouldn't bother adding metadata for it. Metadata is only useful to the extent that it will update automatically when V8 changes. If there's no way to do that, then we may as well hardcode it in mdb_v8 (with a comment explaining that). We could update the V8 change so that it is a constant...but I think that gets a little hairy if the V8 team isn't that excited about it. Nitty notes on a few comments: lines 389 - 403: this comment seems a little redundant with mdb_v8_dbg.h lines 86 - 94. My worry is that if someone updates one in the future, they'll end up forgetting to update the other one. Maybe consolidate these notes into one place, or add a reference from one to the other? line 428: Should probably start with "If". Also, this sentence is a comma splice. I think you want a period before "we're done." The comment at 435-441 has an extra line break. |
If we consider the case of The same applies to All other constants (
Thank you! I updated these comments and will push the changes shortly. |
d008a1d
to
b438426
Compare
With the latest changes added to this PR, all tests pass for node (32 and 64 bits) v0.10, v0.12, nodejs/node master and nodejs/node master with metadata added.
|
LGTM! |
b438426
to
5a189dd
Compare
@davepacheco Thank you! Squashed all commits into one. Let me know if you need anything else. |
This PR updates mdb_v8 to support V8 4.4.x and 4.5.x.
v8dbg_propindex_mask
instead ofv8dbg_fieldindex_mask
, andv8dbg_propindex_shift
instead ofv8dbg_fieldindex_shift
. Thev8dbg_propindex*
values were already present when thev8dbg_fieldindex
values were added, and they represented the same values. So instead of going back to naming these valuesfieldindex_*
and having to usptream these changes to V8, I chose to change what values we use in mdb_v8.c instead.V8_CONSTANT_ADDED_SINCE
macro and a function namedv8_version_at_least
to mark and determine when a constant or an offset was added by a given V8 version. It's used to support the newOneByteStringTag
constant, andMaps
'constructor
offset that has been renamed toconstructor_or_backpointer
.struct v8_offset
now also has aflags
member so that we can determine whenMaps
'constructor
offset was renamed toconstructor_or_backpointer
usingV8_CONSTANT_ADDED_SINCE
.tst.postmortem_details.js
andtst.postmortem_findjsobjects.js
were failing because of a race condition between the child process'exit
event and the stdin'send
event.These changes have been tested with core files generated from 32 and 64 bits versions of nodejs/node master that use V8 4.4.x and 4.5.x, as well as with node v0.12.7 64 bits. All tests pass.
I will perform more testing, specifically with node v0.10.x 32bits and 64bits, and with node v0.12.7 32 bits. In the meantime, any feedback would be very much appreciated.