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

build: allow enabling the --trace-maps flag in V8 #14018

Merged
merged 1 commit into from
Jul 7, 2017

Conversation

evanlucas
Copy link
Contributor

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

build

This can be useful for tracing map creation.

@nodejs-github-bot nodejs-github-bot added the build Issues and PRs related to build files or the CI. label Jul 1, 2017
@refack
Copy link
Contributor

refack commented Jul 1, 2017

Context please?

node.gyp Outdated
@@ -1,6 +1,7 @@
{
'variables': {
'v8_use_snapshot%': 'false',
'v8_trace_maps%': '0',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0, not '0'.

configure Outdated
parser.add_option('--enable-trace-maps',
action='store_true',
dest='trace_maps',
help='Enable the --trace-maps flag in v8')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider undocumenting this or add a (use at your own risk) because it introduces an incompatibility between builds with and without the flag.

It adds a field to SharedFunctionInfo that ends up in the code cache so the result of new vm.Script(source, { produceCachedData: true }) from a -DTRACE_MAPS build won't be loadable in a normal build and vice versa. I didn't test but I expect it segfaults.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm +1 to documenting with a warning. Quite a few of configure's switches have wide reaching results...

@bnoordhuis
Copy link
Member

@refack It's a tool for tracing hidden class transitions. ('hidden class' == 'map' in V8 parlance.)

@evanlucas
Copy link
Contributor Author

Updated, PTAL

configure Outdated
parser.add_option('--enable-trace-maps',
action='store_true',
dest='trace_maps',
help='Enable the --trace-maps flag in v8 (use at your own risk)')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, one nit: V8 with a capital V, since we started disambiguating due to Node (v)8 ;)

Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mhdawson
Copy link
Member

mhdawson commented Jul 6, 2017

This can be useful for tracing map creation.

PR-URL: nodejs#14018
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
@evanlucas evanlucas closed this Jul 7, 2017
@evanlucas evanlucas deleted the tracemaps branch July 7, 2017 14:32
@evanlucas
Copy link
Contributor Author

Landed in 49d13a1. Thanks!

@evanlucas evanlucas merged commit 49d13a1 into nodejs:master Jul 7, 2017
@addaleax
Copy link
Member

@evanlucas This seems to conflict with the snapshot change, can you backport to v8.x?

evanlucas added a commit to evanlucas/node that referenced this pull request Jul 18, 2017
This can be useful for tracing map creation.

PR-URL: nodejs#14018
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
@addaleax addaleax mentioned this pull request Jul 18, 2017
addaleax pushed a commit that referenced this pull request Jul 18, 2017
This can be useful for tracing map creation.

Backport-PR-URL: #14344
Backport-Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Backport-Reviewed-By: Refael Ackermann <refack@gmail.com>
PR-URL: #14018
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Fishrock123 pushed a commit that referenced this pull request Jul 19, 2017
This can be useful for tracing map creation.

Backport-PR-URL: #14344
Backport-Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Backport-Reviewed-By: Refael Ackermann <refack@gmail.com>
PR-URL: #14018
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
@MylesBorins
Copy link
Contributor

Should this have been semver-minor?

Should we backport to lts?

@MylesBorins
Copy link
Contributor

ping @evanlucas

@evanlucas
Copy link
Contributor Author

@MylesBorins sorry I somehow missed your previous comment. I think it could be argued either way that this is semver-minor. It isn't exposed in release builds and can only be done when using ./configure. I'll try to get around to opening a backport PR, although this isn't something extremely pressing to backport.

@bnoordhuis
Copy link
Member

https://chromium-review.googlesource.com/c/v8/v8/+/734648 -- --trace-maps might soon be available by default, no build flags needed.

@MylesBorins
Copy link
Contributor

I've landed on v6.x. Please lmk if there are any concerns

MylesBorins pushed a commit that referenced this pull request Dec 19, 2017
This can be useful for tracing map creation.

PR-URL: #14018
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Dec 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants