Skip to content

Commit

Permalink
externalizing deoptimize setting
Browse files Browse the repository at this point in the history
  • Loading branch information
qmx committed Aug 24, 2011
1 parent 7ae451a commit 268250b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 5 additions & 0 deletions vm/configuration.hpp
Expand Up @@ -32,6 +32,7 @@ namespace rubinius {
config::Bool jit_debug;
config::Bool jit_sync;
config::Bool jit_show_uncommon;
config::Integer jit_deoptimize_threshold;
config::Bool jit_show_remove;
config::Bool jit_check_debugging;

Expand Down Expand Up @@ -63,6 +64,9 @@ namespace rubinius {
static const int default_jit_dump_code = 0;
static const int default_jit_call_til_compile = 4000;
static const int default_jit_max_method_size = 2048;
// 500 is a number picked after doing some tuning on a specific benchmark.
// Not sure if it's the right value, but it seems to work fine.
static const int default_jit_deoptimize_threshold = 500;
static const bool default_jit_on = true;
static const bool default_gc_autotune = true;

Expand Down Expand Up @@ -94,6 +98,7 @@ namespace rubinius {
, jit_debug(this, "jit.debug", false)
, jit_sync(this, "jit.sync", false)
, jit_show_uncommon(this, "jit.uncommon.print", false)
, jit_deoptimize_threshold(this, "jit.deoptimize_threshold", default_jit_deoptimize_threshold)
, jit_show_remove(this, "jit.removal.print", false)
, jit_check_debugging(this, "jit.check_debugging", false)

Expand Down
4 changes: 1 addition & 3 deletions vm/instructions.cpp
Expand Up @@ -227,9 +227,7 @@ Object* VMMethod::uncommon_interpreter(STATE,

VMMethod* method_vmm = method_call_frame->cm->backend_method();

// 500 is a number picked after doing some tuning on a specific benchmark.
// Not sure if it's the right value, but it seems to work fine.
if(++method_vmm->uncommon_count > 500) {
if(++method_vmm->uncommon_count > state->shared.config.jit_deoptimize_threshold) {
if(state->shared.config.jit_show_uncommon) {
std::cerr << "[[[ Deoptimizing uncommon method ]]]\n";
call_frame->print_backtrace(state);
Expand Down

0 comments on commit 268250b

Please sign in to comment.