-
Notifications
You must be signed in to change notification settings - Fork 286
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
Confusing --trace_opt --trace_deopt output #512
Comments
Yes, it's been deoptimized but it's hard to say why without the full output. You may also have to add |
Throws |
Ah, sorry. Yes, either (or both) should work. |
@bnoordhuis Thank you, I've added all the three) Unfortunately, I get only the same 6 mentions of the
|
I half-expected to see "reason: transition" log lines in there. What is probably happening is that some external invariant that Unfortunately, it's very hard to track down such issues. Sometimes If you have a short test case, I can help look into it. |
@bnoordhuis I've found out something strange. Prehistory:
So this code causes deopt: const readFile = require('fs').readFile;
const cb = () => {};
for (let i = 0; i < 1e3; i++) {
readFile(__filename, cb);
} And this one does not causes deopt: const readFile = require('fs').readFile;
const cb = () => {};
for (let i = 0; i < 1e3; i++) {
readFile(__filename, cb);
if (i === 999) process.exit();
} |
You can test this with master if you temporarily callback = maybeCallback(arguments[arguments.length - 1]); with something like this: callback = maybeCallback(callback || options); or this: if (callback)
callback = maybeCallback(callback);
else
callback = maybeCallback(options); I've tested with rebuilt internal module as well. |
Checking different opt/deopt cases, I often stumble on this scheme (the function name is just a one example):
That's all, just these 6 messages concerning the tested function.
Do the last two messages mean the function is deoptimized? If so, how can we detect the cause? If not, what do they mean?
// cc @nodejs/v8
The text was updated successfully, but these errors were encountered: