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

src: standardise context embedder indices #19135

Closed

Conversation

devsnek
Copy link
Member

@devsnek devsnek commented Mar 4, 2018

i'll be adding another one with #19016 so i'd like to keep track of them all a little better

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

src

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. labels Mar 4, 2018
Copy link
Member

@TimothyGu TimothyGu left a comment

Choose a reason for hiding this comment

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

I'd like someone else more familiar with the postmortem stuff to take a look at that part. Otherwise, LGTM.

@devsnek
Copy link
Member Author

devsnek commented Mar 4, 2018

cc @nodejs/post-mortem

#endif

enum ContextEmbedderIndex {
kEmbedderData = NODE_CONTEXT_EMBEDDER_DATA_INDEX,
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps kEnvironment is a better name now.

@devsnek devsnek force-pushed the refactor/context-embedder-data-indices branch from 6ec91af to fb1844c Compare March 5, 2018 15:08
Copy link
Contributor

@Fishrock123 Fishrock123 left a comment

Choose a reason for hiding this comment

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

CI: https://ci.nodejs.org/job/node-test-pull-request/13515/

Can't comment on the postmortem parts either, but cc @joyeecheung as a heads up to the llnode folks.

@joyeecheung
Copy link
Member

Also @mmarchini

Copy link
Contributor

@mmarchini mmarchini left a comment

Choose a reason for hiding this comment

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

LGTM

@devsnek devsnek added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 6, 2018
@jasnell
Copy link
Member

jasnell commented Mar 6, 2018

Unspecified failure on one of the linux cases, from the failure it's not clear if it's unrelated although looking at the test it should be. Running again just to be safe: https://ci.nodejs.org/job/node-test-commit-linux/16891/

Copy link
Member

@TimothyGu TimothyGu left a comment

Choose a reason for hiding this comment

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

LGTM. I'd rename the node_context_data.h file to just context_data.h.

// Context::SetAlignedPointerInEmbedderData() is backed by a FixedArray,
// worst case we pay a one-time penalty for resizing the array.
#ifndef NODE_CONTEXT_EMBEDDER_DATA_INDEX
#define NODE_CONTEXT_EMBEDDER_DATA_INDEX 32
Copy link
Member

Choose a reason for hiding this comment

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

Could rename this EMBEDDER_DATA to ENVIRONMENT as well?

Copy link
Member Author

@devsnek devsnek Mar 6, 2018

Choose a reason for hiding this comment

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

i suspect renaming this would require a docs deprecation for all of v10 and then landing this pr on v11?

Copy link
Member

Choose a reason for hiding this comment

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

This macro used to be in env.h, which is not a public header.

Copy link
Member

Choose a reason for hiding this comment

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

@devsnek raised the argument of Node.js embedding over IRC. I'm fine with removing this macro after a major bump then.

@devsnek
Copy link
Member Author

devsnek commented Mar 7, 2018

landed in c9b4de5

@devsnek devsnek closed this Mar 7, 2018
@devsnek devsnek deleted the refactor/context-embedder-data-indices branch March 7, 2018 18:20
devsnek added a commit that referenced this pull request Mar 7, 2018
PR-URL: #19135
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matheus Marchini <matheus@sthima.com>
@targos targos removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 17, 2018
@targos
Copy link
Member

targos commented Mar 17, 2018

Is it OK to land this on v9.x? I'm not sure if it changes the public API

@MylesBorins
Copy link
Contributor

when this lands on v9.x it causes compilation to break 😢

/src/node_file.o ../src/node_file.cc
../src/node_contextify.cc:225:41: warning: 'GetDebugContext' is deprecated [-Wdeprecated-declarations]
  Local<Context> debug_context = Debug::GetDebugContext(args.GetIsolate());
                                        ^
../deps/v8/include/v8-debug.h:208:3: note: 'GetDebugContext' has been explicitly marked deprecated here
  V8_DEPRECATED("Use v8-inspector",
  ^
../deps/v8/include/v8config.h:321:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../src/node_contextify.cc:230:12: warning: 'SetDebugEventListener' is deprecated [-Wdeprecated-declarations]
    Debug::SetDebugEventListener(args.GetIsolate(), dummy_event_listener);
           ^
../deps/v8/include/v8-debug.h:145:3: note: 'SetDebugEventListener' has been explicitly marked deprecated here
  V8_DEPRECATED("No longer supported", static bool SetDebugEventListener(
  ^
../deps/v8/include/v8config.h:321:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../src/node_contextify.cc:231:28: warning: 'GetDebugContext' is deprecated [-Wdeprecated-declarations]
    debug_context = Debug::GetDebugContext(args.GetIsolate());
                           ^
../deps/v8/include/v8-debug.h:208:3: note: 'GetDebugContext' has been explicitly marked deprecated here
  V8_DEPRECATED("Use v8-inspector",
  ^
../deps/v8/include/v8config.h:321:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../src/node_contextify.cc:239:23: error: no member named 'kContextEmbedderDataIndex' in 'node::Environment'; did you mean 'v8::internal::Internals::kContextEmbedderDataIndex'?
    const int index = Environment::kContextEmbedderDataIndex;
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                      v8::internal::Internals::kContextEmbedderDataIndex
../deps/v8/include/v8.h:9044:20: note: 'v8::internal::Internals::kContextEmbedderDataIndex' declared here
  static const int kContextEmbedderDataIndex = 5;
                   ^
3 warnings and 1 error generated.
make[1]: *** [/Users/mborins/code/node/v9.x/out/Release/obj.target/node_lib/src/node_contextify.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [node] Error 2

MayaLekova pushed a commit to MayaLekova/node that referenced this pull request May 8, 2018
PR-URL: nodejs#19135
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matheus Marchini <matheus@sthima.com>
@jasnell
Copy link
Member

jasnell commented Aug 17, 2018

Should this be backported to 8.x? If so, a separate backport PR is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.