-
Notifications
You must be signed in to change notification settings - Fork 30.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
util: avoid leaking arguments
in _deprecate()
.
#10594
Conversation
I'm not sure there is a deopt in this case. I ran this simple test: var util = require('util');
function MyClass(a, b, c) {
this.a = a;
this.b = b;
this.c = c;
}
var Deprecated = util.deprecate(MyClass);
while(true) {
new Deprecated(1, 2, 3);
} Result
/cc @bmeurer |
Interesting. Perhaps |
iirc Edit: https://docs.google.com/document/d/1DvDx3Xursn1ViV5k4rT4KB8HBfBb2GdUy3wzNfJWcKM/edit#heading=h.cd88kfmuxw1k is where I read that |
No, Crankshaft doesn't know about |
Thanks for the clarification @bmeurer |
So here, we don't see a deopt because the function is compiled with TurboFan and it is compiled with TurboFan because it's using |
Yes. |
Interesting, sounds like this is good to close? Lmk if it should be reopened for whatever reason. |
Refs: #10323
I didn't bother to benchmark it, but this probably deopts this function in all calls to a deprecated class / constructor.
CI: https://ci.nodejs.org/job/node-test-pull-request/5685/
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
util