Skip to content

Conversation

@jasnell
Copy link
Member

/cc @addaleax@mcollina

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Most of the inlines were leftovers from a much older design iteration and are largely pointless or counter productive.
Use of a MaybeStackBuffer was just silly. Fix a long standing todo Reduce code duplication a bit.
@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. labels Mar 16, 2018
};
session->MakeCallback(env->error_string(), arraysize(argv), argv);
Local<Value> argv = Integer::New(isolate, lib_error_code);
session->MakeCallback(env->error_string(), 1, &argv);
Copy link
Member

Choose a reason for hiding this comment

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

You may want to call this arg, since it’s not really a vector any longer :)

(ditto below)

@jasnell
Copy link
MemberAuthor

Copy link
Member

@mcollinamcollina left a comment

Choose a reason for hiding this comment

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

LGTM

// frame. This can be used, for instance, to create the Base64-encoded
// content of an Http2-Settings header field.
inlineLocal<Value> Http2Session::Http2Settings::Pack(){
Local<Value> Http2Session::Http2Settings::Pack(){
Copy link
Member

Choose a reason for hiding this comment

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

is it ok to remove this inline directive here and in the other functions? Wouldn't this impact perf somehow?

Copy link
Member

@addaleaxaddaleaxMar 17, 2018

Choose a reason for hiding this comment

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

@mcollina It’s not only okay, it’s more or less the correct thing to do.

This has a pretty good explanation. tl;dr: Compilers are generally better than humans at judging what functions to inline or not, and will gladly ignore this advice. However, inline does affect the linkage properties of a function, and so its primary use should be to mark functions that are defined in header files (outside of a class definition).

I just tested it with gcc, and the compiler output is the same before and after this commit, byte-for-byte.

jasnell added a commit that referenced this pull request Mar 18, 2018
Most of the inlines were leftovers from a much older design iteration and are largely pointless or counter productive. PR-URL: #19400 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
jasnell added a commit that referenced this pull request Mar 18, 2018
Use of a MaybeStackBuffer was just silly. Fix a long standing todo Reduce code duplication a bit. PR-URL: #19400 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
jasnell added a commit that referenced this pull request Mar 18, 2018
PR-URL: #19400 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
@jasnell
Copy link
MemberAuthor

Landed in 49799f3, 224941b, and d74184c

@jasnelljasnell closed this Mar 18, 2018
MylesBorins pushed a commit that referenced this pull request Mar 20, 2018
Most of the inlines were leftovers from a much older design iteration and are largely pointless or counter productive. PR-URL: #19400 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
MylesBorins pushed a commit that referenced this pull request Mar 20, 2018
Use of a MaybeStackBuffer was just silly. Fix a long standing todo Reduce code duplication a bit. PR-URL: #19400 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
MylesBorins pushed a commit that referenced this pull request Mar 20, 2018
PR-URL: #19400 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
MylesBorins pushed a commit that referenced this pull request Mar 20, 2018
Most of the inlines were leftovers from a much older design iteration and are largely pointless or counter productive. PR-URL: #19400 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
MylesBorins pushed a commit that referenced this pull request Mar 20, 2018
Use of a MaybeStackBuffer was just silly. Fix a long standing todo Reduce code duplication a bit. PR-URL: #19400 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
MylesBorins pushed a commit that referenced this pull request Mar 20, 2018
PR-URL: #19400 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
@targostargos mentioned this pull request Mar 20, 2018
@codebytere
Copy link
Member

codebytere commented Oct 18, 2018

@jasnell could you backport this to v8.x when you have a chance (or mark don't-land otherwise)?

Sign up for freeto 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 / srcIssues 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.

5 participants

@jasnell@codebytere@mcollina@addaleax@nodejs-github-bot