Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make debugging of global serial bumping easier

This gives us an option to see where the global serial is increased, to
find for example cases where this causes constant lookup caches to
invalidate.
  • Loading branch information...
commit 4d029101608faa6164391f6aba192f2fd5198dff 1 parent ce3aa52
@dbussink dbussink authored
View
3  lib/rubinius/configuration.rb
@@ -164,6 +164,9 @@
c.vm_variable "ic.debug", false,
"Print out when inline caches are reset"
+ c.vm_variable "serial.debug", false,
+ "Print out when the global serial increases"
+
c.vm_variable "allocation_tracking", false,
"Enable allocation tracking for new objects"
View
1  vm/agent_components.cpp
@@ -527,6 +527,7 @@ namespace agent {
Tree* jit = system_->get_tree("jit");
jit->add(new ReadAtomicInteger("cache_resets", state->shared().stats.methods_cache_resets));
+ jit->add(new ReadInteger<int>("global_serial", state->shared().global_serial_address()));
jit->add(new ReadAtomicInteger("methods", state->shared().stats.jitted_methods));
jit->add(new ReadAtomicInteger("time", state->shared().stats.jit_time_spent));
View
6 vm/builtin/system.cpp
@@ -1066,7 +1066,11 @@ namespace rubinius {
return obj->kind_of_p(state, mod) ? cTrue : cFalse;
}
- Object* System::vm_inc_global_serial(STATE) {
+ Object* System::vm_inc_global_serial(STATE, CallFrame* calling_environment) {
+ if(state->shared().config.serial_debug) {
+ std::cout << "[Global serial increased from " << state->shared().global_serial() << "]" << std::endl;
+ calling_environment->print_backtrace(state, 6, true);
+ }
return Fixnum::from(state->shared().inc_global_serial(state));
}
View
2  vm/builtin/system.hpp
@@ -249,7 +249,7 @@ namespace rubinius {
// Increment the internal global serial number, used for caching
// Rubinius.primitive :vm_inc_global_serial
- static Object* vm_inc_global_serial(STATE);
+ static Object* vm_inc_global_serial(STATE, CallFrame* calling_environment);
// Print out the current backtrace of ruby code
// Rubinius.primitive :vm_show_backtrace
Please sign in to comment.
Something went wrong with that request. Please try again.