fix(library/vm): profiler was not including builtin functions

This commit is contained in:
Leonardo de Moura 2017-02-13 16:12:25 -08:00
parent c37634c815
commit 4d765fa25b
2 changed files with 13 additions and 1 deletions

View file

@ -2692,6 +2692,18 @@ void vm_state::invoke_global(vm_decl const & d) {
#endif
}
void vm_state::invoke_cfun(vm_decl const & d) {
if (m_profiling) {
unique_lock<mutex> lk(m_call_stack_mtx);
push_frame_core(0, 0, d.get_idx());
}
invoke_fn(d.get_cfn(), d.get_arity());
if (m_profiling) {
unique_lock<mutex> lk(m_call_stack_mtx);
m_call_stack.pop_back();
}
}
void vm_state::invoke(vm_decl const & d) {
switch (d.kind()) {
case vm_decl_kind::Bytecode:

View file

@ -636,7 +636,7 @@ class vm_state {
unsigned pop_frame();
void invoke_builtin(vm_decl const & d);
void invoke_fn(vm_cfunction fn, unsigned arity);
void invoke_cfun(vm_decl const & d) { invoke_fn(d.get_cfn(), d.get_arity()); }
void invoke_cfun(vm_decl const & d);
void invoke_global(vm_decl const & d);
void invoke(vm_decl const & d);
void run();