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

Update mdb_v8 for V8 4.6.x #36

Closed
misterdjules opened this issue Sep 22, 2015 · 2 comments
Closed

Update mdb_v8 for V8 4.6.x #36

misterdjules opened this issue Sep 22, 2015 · 2 comments

Comments

@misterdjules
Copy link
Contributor

nodejs/node will likely ship node v5.x with V8 4.6.x, and currently mdb_v8's tests (from a build of #33, that is with mdb_v8 updates for V8 4.5.x) do not pass with that version of V8:

[root@dev ~/mdb_v8]# node -p 'process.versions'
{ http_parser: '2.5.0',
  node: '5.0.0-pre',
  v8: '4.6.85.19',
  uv: '1.7.4',
  zlib: '1.2.8',
  ares: '1.10.1-DEV',
  modules: '46',
  openssl: '1.0.2d' }
[root@dev ~/mdb_v8]# make test
tools/catest -a
Configuration:
    SRC:                         /root/mdb_v8
    Output directory:            /var/tmp/catest.89202
    Temp directory:              /var/tmp/catest.89202_tmpfiles
    Keep successful test output: false
    Found 4 test(s) to run

===================================================

Executing test test/standalone/tst.jsclosure.js ... success.
Executing test test/standalone/tst.postmortem_details.js ... FAILED.
>>> failure details in /var/tmp/catest.89202/failure.0

Executing test test/standalone/tst.postmortem_findjsobjects.js ... FAILED.
>>> failure details in /var/tmp/catest.89202/failure.1

Executing test test/standalone/tst.postmortem_jsstack.js ... success.

===================================================

Results:
    Tests passed:    2/ 4
    Tests failed:    2/ 4

===================================================
Cleaning up output from successful tests ... done.
GNUmakefile:120: recipe for target 'test' failed
make: *** [test] Error 2
[root@dev ~/mdb_v8]#

It seems that these failures are due to recent changes in the objects' Map data structure to replace the inobject_properties field with inobject_properties_or_constructor_function_index:

[root@dev ~/mdb_v8]#`  cat /var/tmp/catest.89323/failure.0/89323.out 
mdb stderr: mdb: couldn't find class "Map", field "inobject_properties"
mdb: failed to autoconfigure from target; commands may have incorrect results!

mdb stderr: mdb: 3af1f096fd1: didn't find expected class

mdb stderr: mdb: 3af1f096fd1: didn't find expected class

mdb stderr: mdb: 3af1f096fd1: didn't find expected class

[root@dev ~/mdb_v8]# cat /var/tmp/catest.89323/failure.1/89323.out 
mdb stderr: mdb: couldn't find class "Map", field "inobject_properties"
mdb: failed to autoconfigure from target; commands may have incorrect results!

[root@dev ~/mdb_v8]#

There could be other breaking changes in V4.6.x, but it's a starting point.

@misterdjules
Copy link
Contributor Author

Metadata was updated with https://codereview.chromium.org/1308113007.

misterdjules pushed a commit to misterdjules/mdb_v8 that referenced this issue Sep 25, 2015
This change makes mdb_v8's test suite pass with
https://github.com/nodejs/node/tree/vee-eight-4.6, which is the branch
where V8 4.6.x is integrated into node's master.

There are two main changes. The first one is that Map's
"inobject_properties" property has been renamed to
"inobject_properties_or_constructor_function_index". Since mdb_v8's
doesn't support new V8 primitives yet, we only care about using the
proper name for this property, not about the fact that it has a
different semantic for these new V8 primitives.

The second one is that typed arrays, which are used to represent Buffer
instances since node v4.0.0, store their underlying storage slightly
differently. For V8 versions 4.6 and later, we know use the
JSArrayBufferView and the JSArrayBuffer properties to get access to that
underlying storage, as it seems more reliable and less likely to change
than accessing the first elements' slot, whose representation has
changed between V8 4.5 and 4.6. It used to be a ExternalUint8Array, and
it is now a FixedTypedArray casted as a FixedTypedArrayBase.
misterdjules pushed a commit to misterdjules/mdb_v8 that referenced this issue Sep 25, 2015
This change makes mdb_v8's test suite pass with
https://github.com/nodejs/node/tree/vee-eight-4.6, which is the branch
where V8 4.6.x is integrated into node's master.

There are two main changes. The first one is that Map's
"inobject_properties" property has been renamed to
"inobject_properties_or_constructor_function_index". Since mdb_v8's
doesn't support new V8 primitives yet, we only care about using the
proper name for this property, not about the fact that it has a
different semantic for these new V8 primitives.

The second one is that typed arrays, which are used to represent Buffer
instances since node v4.0.0, store their underlying storage slightly
differently. For V8 versions 4.6 and later, we now use the
JSArrayBufferView and the JSArrayBuffer properties to get access to that
underlying storage, as it seems more reliable and less likely to change
than accessing the first elements' slot, whose representation has
changed between V8 4.5 and 4.6. It used to be a ExternalUint8Array, and
it is now a FixedTypedArray casted as a FixedTypedArrayBase.
misterdjules pushed a commit to misterdjules/mdb_v8 that referenced this issue Oct 2, 2015
@davepacheco
Copy link
Contributor

Merged via #37.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants