Skip to content

Instantly share code, notes, and snippets.

@chuckremes
Created December 28, 2017 22:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuckremes/11612c909b3ac95a606ee24df6cf9231 to your computer and use it in GitHub Desktop.
Save chuckremes/11612c909b3ac95a606ee24df6cf9231 to your computer and use it in GitHub Desktop.
(lldb) up
frame #5: 0x000000010020a365 rbx`rubinius::memory::MarkSweepGC::allocate(this=0x000000010191cd50, bytes=664, collect_now=0x00007000090fcb7f) at mark_sweep.cpp:48
45 }
46
47 Object* MarkSweepGC::allocate(size_t bytes, bool& collect_now) {
-> 48 void* mem = malloc(bytes);
49 if(!mem) return NULL;
50
51 Object* obj = reinterpret_cast<Object*>(mem);
frame #4: 0x0000000100190335 rbx`rubinius::instructions::send_stack(rubinius::State*, rubinius::CallFrame*, long, long) [inlined] rubinius::CallSite::execute(this=<unavailable>, state=0x000070000c6b5c10, args=0x000000000000457e) at call_site.hpp:458 [opt]
455 }
456
457 Object* execute(STATE, Arguments& args) {
-> 458 return _execute_(state, this, args);
459 }
460
461 Object* cache_miss(STATE, Arguments& args) {
(lldb) down
frame #3: 0x0000000100066b67 rbx`rubinius::CallSite::invoke_cached(state=0x000070000c6b5c10, call_site=0x000000011d650e60, args=0x000070000c6b3b60) at call_site.hpp:307
304 InlineCache* cache = 0;
305
306 for(int i = 0; i < max_caches && (cache = call_site->_caches_[i]); i++) {
-> 307 Object* value = cache->execute(state, call_site, args, valid_p);
308
309 if(valid_p) return value;
310 }
(lldb) down
frame #2: 0x000000010006790c rbx`rubinius::CallSite::InlineCache::execute(this=0x00000001152af120, state=0x000070000c6b5c10, call_site=0x000000011d650e60, args=0x000070000c6b3b60, valid_p=0x000070000c6b3b0f) at call_site.hpp:123
120 call_site->hit();
121 hit();
122 valid_p = true;
-> 123 return _execute_(state, call_site, this, args);
124 }
125
126 call_site->miss();
(lldb) down
frame #1: 0x0000000100066d8d rbx`rubinius::CallSite::InlineCache::invoke(state=0x000070000c6b5c10, call_site=0x000000011d650e60, cache=0x00000001152af120, args=0x000070000c6b3b60) at call_site.hpp:138
135 state->vm()->metrics().machine.methods_invoked++;
136 state->vm()->metrics().machine.inline_cache_hits++;
137
-> 138 return cache->prediction()->executable()->execute(state,
139 cache->prediction()->executable(), cache->prediction()->module(), args);
140 }
141
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment