Skip to content

src: simplify exit code accesses - #45125

Merged
nodejs-github-bot merged 8 commits into
nodejs:mainfrom
daeyeon:main.exitcode-with-accessors-221022.Sat.fefa
Nov 10, 2022
Merged

src: simplify exit code accesses#45125
nodejs-github-bot merged 8 commits into
nodejs:mainfrom
daeyeon:main.exitcode-with-accessors-221022.Sat.fefa

Conversation

@daeyeon

Copy link
Copy Markdown
Member

This simplifies getting the exit code which is set through process.exitCode by removing
manually reading the JS property from the native side.

Addresses this TODO:

node/src/api/hooks.cc

Lines 72 to 75 in 5815e3e

// TODO(addaleax): It might be nice to share process.exitCode via
// getter/setter pairs that pass data directly to the native side, so that we
// don't manually have to read and write JS properties here. These getters
// could use e.g. a typed array for performance.

Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/startup

@nodejs-github-botnodejs-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. needs-ci PRs that need a full CI run. labels Oct 22, 2022
@daeyeondaeyeon added the process Issues and PRs related to the process subsystem. label Oct 22, 2022
@daeyeon

Copy link
Copy Markdown
MemberAuthor

/cc @addaleax @nodejs/cpp-reviewers

@daeyeon
daeyeonforce-pushed the main.exitcode-with-accessors-221022.Sat.fefa branch from bd891da to a107886CompareOctober 22, 2022 12:04
This simplifies getting the exit code which is set through
`process.exitCode` by removing manually reading the JS property
from the native side.
Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com>
@daeyeon
daeyeonforce-pushed the main.exitcode-with-accessors-221022.Sat.fefa branch from a107886 to eef1c86CompareOctober 22, 2022 12:13
Comment threadsrc/node_process_object.cc Outdated
Comment threadsrc/env_properties.h Outdated
Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com>
@daeyeon

Copy link
Copy Markdown
MemberAuthor

Changed the previous commit to use a typed array. PTAL.

@daeyeondaeyeon added the commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. label Oct 29, 2022

@RaisinTenRaisinTen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@daeyeondaeyeon added the request-ci Add this label to start a Jenkins CI on a PR. label Oct 31, 2022
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 31, 2022
@nodejs-github-bot

This comment was marked as outdated.

Comment threadsrc/env.h Outdated
@daeyeon
daeyeonforce-pushed the main.exitcode-with-accessors-221022.Sat.fefa branch from 204ca1e to 3a854d1CompareNovember 4, 2022 15:31
@daeyeon

Copy link
Copy Markdown
MemberAuthor

Updated by removing the new struct in the previous commit and extending the exiting_ buffer. The exiting_ is renamed to exit_info_. PTAL.

Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com>
@daeyeon
daeyeonforce-pushed the main.exitcode-with-accessors-221022.Sat.fefa branch from 3a854d1 to 62819b1CompareNovember 4, 2022 15:45
Comment threadsrc/env.h Outdated
Comment threadlib/internal/bootstrap/node.js Outdated
Comment threadsrc/env-inl.h Outdated
Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com>
Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com>
@daeyeon

Copy link
Copy Markdown
MemberAuthor

Applied the suggestions. PTAL.

Comment threadsrc/env.h Outdated
Comment threadsrc/env.cc Outdated
Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com>

@joyeecheungjoyeecheung left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for. the patience!

@daeyeondaeyeon added the request-ci Add this label to start a Jenkins CI on a PR. label Nov 9, 2022
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Nov 9, 2022
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@daeyeon

Copy link
Copy Markdown
MemberAuthor

Fixed the CI failure. PTAL again. Thanks!

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@joyeecheungjoyeecheung left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Still LGTM, thanks

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@daeyeondaeyeon added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Nov 9, 2022
@daeyeondaeyeon added the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 10, 2022
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 10, 2022
@nodejs-github-bot
nodejs-github-bot merged commit 7b1e153 into nodejs:mainNov 10, 2022
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 7b1e153

@daeyeon
daeyeon deleted the main.exitcode-with-accessors-221022.Sat.fefa branch November 10, 2022 01:11
@RafaelGSS

Copy link
Copy Markdown
Member

Hi @daeyeon. I tried to include this commit to the v19.1.0 proposal, but I got some conflicts. Could you please open a backport PR?

@daeyeon

Copy link
Copy Markdown
MemberAuthor

Hi @RafaelGSS. Sure, I will open it.

@daeyeon

Copy link
Copy Markdown
MemberAuthor

@RafaelGSS Come to think of it, this requires 2d0d997. Since it's a semver-major change, I think it's right not to land this PR to v19.x.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.c++Issues and PRs that require attention from people who are familiar with C++.commit-queue-squashAdd this label to instruct the Commit Queue to squash all the PR commits into the first one.lib / srcIssues and PRs related to general changes in the lib or src directory.needs-ciPRs that need a full CI run.processIssues and PRs related to the process subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@daeyeon@nodejs-github-bot@RafaelGSS@addaleax@joyeecheung@RaisinTen