Skip to content

Conversation

@joyeecheung
Copy link
Member

This removes the internalBinding('uv') call from the normal
bootstrap for now, and avoids building errmap by default which
expands to a lot of calls into V8.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. errors Issues and PRs related to JavaScript errors originated in Node.js core. libuv Issues and PRs related to the libuv dependency or the uv binding. util Issues and PRs related to the built-in util module. labels Dec 19, 2018
@joyeecheung
Copy link
Member Author

Copy link
Member

@addaleax addaleax left a comment

Choose a reason for hiding this comment

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

Btw, I’ve also thought about creating a static array from the macro here, instead of generating the full code for each entry… that might make things a bit easier as well?

@joyeecheung
Copy link
Member Author

creating a static array from the macro here

I don't think I follow..what do you mean by creating a static array?

@addaleax
Copy link
Member

@joyeecheung This might not compile because I wrote it here in Github, but I think you get the idea:

static const struct { int value; const char* name; const char* message; } errors[] = { #define V(name, msg) { UV_##name, #name, msg }, UV_ERRNO_MAP(V) #undef V { 0, nullptr, nullptr } }; for (const auto* error = errors; error->name != nullptr; error++) { Local<Value> arr[] = { OneByteString(isolate, error->name), OneByteString(isolate, error->msg) }; if (err_map->Set(context, Integer::New(isolate, error->value), Array::New(isolate, arr, arraysize(arr))).IsEmpty()) { return; } } The major advantage would probably be that the code isn’t several kilobytes large in this case. No strong feelings about it, though :)
@joyeecheung joyeecheung added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. and removed author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Dec 20, 2018
This removes the `internalBinding('uv')` call from the normal bootstrap for now, and avoids building `errmap` by default which expands to a lot of calls into V8.
@joyeecheung
Copy link
Member Author

Rebased and used the static struct array based the suggestion from @addaleax (thanks!), @addaleax @danbev @jasnell @BridgeAR PTAL.

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

@joyeecheung joyeecheung added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 29, 2018
@joyeecheung
Copy link
Member Author

Landed in c66c073

joyeecheung added a commit that referenced this pull request Dec 29, 2018
This removes the `internalBinding('uv')` call from the normal bootstrap for now, and avoids building `errmap` by default which expands to a lot of calls into V8. PR-URL: #25143 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
targos pushed a commit that referenced this pull request Jan 1, 2019
This removes the `internalBinding('uv')` call from the normal bootstrap for now, and avoids building `errmap` by default which expands to a lot of calls into V8. PR-URL: #25143 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
refack pushed a commit to refack/node that referenced this pull request Jan 14, 2019
This removes the `internalBinding('uv')` call from the normal bootstrap for now, and avoids building `errmap` by default which expands to a lot of calls into V8. PR-URL: nodejs#25143 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
@BridgeAR BridgeAR mentioned this pull request Jan 16, 2019
@MylesBorins MylesBorins mentioned this pull request Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs 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++. errors Issues and PRs related to JavaScript errors originated in Node.js core. libuv Issues and PRs related to the libuv dependency or the uv binding. util Issues and PRs related to the built-in util module.

6 participants