Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 530
m.s. Avatar asked Oct 29 '22 20:10

m.s.


1 Answers

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.

like image 70
TylerY86 Avatar answered Nov 11 '22 06:11

TylerY86