locate corresponding JS source of code which is not optimized by V8

走远了吗. 提交于 2019-12-06 04:37:30

问题


I try to optimize the performance of a node.js application and therefore I am analyzing the behavior of V8's JIT compiler.

When running the application via node --trace_deopt --trace_opt --code_comments --print_optcode ..., the output contains many recurring lines like the following:

[didn't find optimized code in optimized code map for 0x490a8b4aa69 <SharedFunctionInfo>]

How can I find out which javascript code corresponds to 0x490a8b4aa69?

The full output is available here.


回答1:


That error message used to be around line 10200 of v8/src/objects.cc, but is no more. It basically means no optimization was currently employed for a particular trace. Possibly because it was unused, or used sufficiently infrequently. It may have likely been a Node.js library function. The address provided is in memory. You'd have to have attached a debugger to v8 and load the symbol for the SharedFunctionInfo at that location. Possibly breakpoint on the line that produces the message too.

I don't think it is that useful to know what was not optimized, as there are lots of things that don't get optimized... just take the output from --trace_opt and assume everything else isn't. It was kind of just a hint that a check was performed for optimized code, and none was there are the time. Maybe try --trace_codegen and work backwards.

This looks to be a very time consuming thing to research.
Thorsten Lorenz would be the guy to ask about this.



来源:https://stackoverflow.com/questions/39576177/locate-corresponding-js-source-of-code-which-is-not-optimized-by-v8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!