diff --git a/lib/_http_incoming.js b/lib/_http_incoming.js index 6a870a33697a1f..30432a5230fa30 100644 --- a/lib/_http_incoming.js +++ b/lib/_http_incoming.js @@ -151,7 +151,14 @@ IncomingMessage.prototype.setTimeout = function setTimeout(msecs, callback) { return this; }; - +// Argument n cannot be factored out due to the overhead of +// argument adaptor frame creation inside V8 in case that number of actual +// arguments is different from expected arguments. +// Ref: https://bugs.chromium.org/p/v8/issues/detail?id=10201 +// NOTE: Argument adapt frame issue might be solved in V8 engine v8.9. +// Refactoring `n` out might be possible when V8 is upgraded to that +// version. +// Ref: https://v8.dev/blog/v8-release-89 IncomingMessage.prototype._read = function _read(n) { if (!this._consuming) { this._readableState.readingMore = false;