Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upsrc: store onread callback in internal field #26837
Conversation
This comment has been minimized.
This comment has been minimized.
nodejs-github-bot
added
C++
lib / src
labels
Mar 21, 2019
joyeecheung
approved these changes
Mar 21, 2019
src/base_object-inl.h Outdated
jasnell
approved these changes
Mar 21, 2019
|
Nice. I've been curious about doing something like this. Glad to see there's an actual benefit |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
bnoordhuis
approved these changes
Mar 21, 2019
src/base_object-inl.h
Outdated
| v8::Local<v8::Value> value, | ||
| const v8::PropertyCallbackInfo<void>& info) { | ||
| // This could be e.g. value->IsFunction(). | ||
| CHECK_IMPLIES(typecheck != nullptr, ((*value)->*typecheck)()); |
This comment has been minimized.
This comment has been minimized.
bnoordhuis
Mar 21, 2019
Member
Since typecheck is never nullptr currently, maybe change the CHECK_IMPLIES into a simple CHECK?
You could also remove the default template argument and have a second, single-arg InternalFieldSet() without a check.
This comment has been minimized.
This comment has been minimized.
addaleax
Mar 26, 2019
Author
Member
Yeah, I’ve turned it into a simple CHECK and removed the nullptr default. We can always adjust this if we want.
addaleax
added
the
author ready
label
Mar 26, 2019
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Landed in 3018441 |
addaleax
closed this
Mar 26, 2019
addaleax
added a commit
that referenced
this pull request
Mar 26, 2019
addaleax
deleted the
addaleax:onread-internal
branch
Mar 26, 2019
targos
added a commit
to targos/node
that referenced
this pull request
Mar 27, 2019
targos
added a commit
to targos/node
that referenced
this pull request
Mar 27, 2019
targos
added a commit
to targos/node
that referenced
this pull request
Mar 27, 2019
targos
added a commit
that referenced
this pull request
Mar 27, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
addaleax commentedMar 21, 2019
This gives a slight performance improvement. At 2000 runs:
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes