跟踪内联缓存未命中v8

时间:2015-03-14 02:29:44

标签: javascript gdb v8

我想找到调用内联缓存未命中的函数(最多一次) 所以,我发现内联缓存未命中功能:

RUNTIME_FUNCTION(StoreIC_Miss) {
TimerEventScope<TimerEventIcMiss> timer(isolate);

HandleScope scope(isolate);
DCHECK(args.length() == 3);
StoreIC ic(IC::NO_EXTRA_FRAME, isolate);
Handle<Object> receiver = args.at<Object>(0);
Handle<Name> key = args.at<Name>(1);
ic.UpdateState(receiver, key);
Handle<Object> result;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
   isolate, result, ic.Store(receiver, key, args.at<Object>(2)));
return *result;
}

我正在GDB中调试上面提到的函数并查看堆栈(回溯)

但是,堆栈在??()

#0  v8::internal::StoreIC::Store (this=0x7fffffffc4d8, object=..., name=...,     
value=..., 
store_mode=v8::internal::Object::CERTAINLY_NOT_STORE_FROM_KEYED) at   
../src/ic/ic.cc:1583
#1  0x0000000000c9e95b in v8::internal::__RT_impl_StoreIC_Miss (args=...,  
isolate=0x2133910) at ../src/ic/ic.cc:2504
#2  0x0000000000c9e792 in v8::internal::StoreIC_Miss (args_length=3,  
args_object=0x7fffffffc620, isolate=0x2133910)
at ../src/ic/ic.cc:2493
#3  0x0000118e1bd060bb in ?? ()
#4  0x0000118e1bd06001 in ?? ()
...
#52 0x0000118e1bd836fb in ?? ()

我想找到调用#2 StoreIC_Miss函数的调用或调用部分。

1 个答案:

答案 0 :(得分:0)

You need to enable gdb jit看到jitted帧。使用gdbjit=on构建,然后使用--gdbjit标志运行V8。