Runtime functions in V8

264 views
Skip to first unread message

dmonji

unread,
Sep 24, 2015, 7:58:02 AM9/24/15
to v8-users
1) In v8, ic.cc, i see functions like  RUNTIME_FUNCTION(Runtime_KeyedLoadIC_Miss)
    I don't understand how are they invoked. Is there some connection with   __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss, arg_count, 1);
    from ic-<arch>.cc? 

2) what is the difference between Runtime_KeyedLoadIC_Miss and Runtime_LoadIC_Miss ?

3)  Can I profile these runtime functions using some c++ profiler? I want to see how much time is spent on subset of these runtime functions.
     

Jakob Kummerow

unread,
Sep 24, 2015, 8:59:23 AM9/24/15
to v8-users
On Thu, Sep 24, 2015 at 1:58 PM, dmonji <monika...@gmail.com> wrote:
1) In v8, ic.cc, i see functions like  RUNTIME_FUNCTION(Runtime_KeyedLoadIC_Miss)
    I don't understand how are they invoked. Is there some connection with   __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss, arg_count, 1);
    from ic-<arch>.cc? 

Yes, that's precisely how they're invoked.
 
2) what is the difference between Runtime_KeyedLoadIC_Miss and Runtime_LoadIC_Miss ?

Essentially, foo.bar is a load and foo[bar] is a keyed load.
 
3)  Can I profile these runtime functions using some c++ profiler? I want to see how much time is spent on subset of these runtime functions.

Sure, C++ profilers can profile C++ functions. 
However, profiling short-running functions is notoriously hard because of the overhead that profiling introduces.
For example, V8's timeline plotter reports time spent handling IC misses; however getting the required timestamps is so expensive compared to what the functions actually do that it tends to over-report them by about 2x.
The sampling profiler's output has a section with "C++ entry points", which include IC miss handlers among other things. It has less (but still non-zero) overhead, and can be rather flaky due to the inherent randomness of sampling.

Reply all
Reply to author
Forward
0 new messages