Skip to content

Commit

Permalink
Simply track MachineCode execution.
Browse files Browse the repository at this point in the history
  • Loading branch information
brixen committed May 9, 2016
1 parent 8f5e2dc commit 531ac3a
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 45 deletions.
12 changes: 1 addition & 11 deletions machine/builtin/block_environment.cpp
Expand Up @@ -383,17 +383,7 @@ namespace rubinius {
return 0;
}

if(mcode->call_count >= 0) {
// TODO: JIT
if(false /*mcode->call_count >= state->shared().config.jit_threshold_compile*/) {
OnStack<1> os(state, env);

G(jit)->compile_soon(state, env->compiled_code(),
invocation.self->direct_class(state), env, true);
} else {
mcode->call_count++;
}
}
mcode->call_count++;

StackVariables* scope = ALLOCA_STACKVARIABLES(mcode->number_of_locals);

Expand Down
6 changes: 0 additions & 6 deletions machine/instructions.def
Expand Up @@ -1760,12 +1760,6 @@ section "Miscellaneous. TODO: better categorize these"
instruction check_interrupts() [ -- ]
flush_ip();

// This is used in loops, and allows loops to heat a method up.
if(mcode->call_count >= 0) {
mcode->loop_count++;
mcode->call_count++;
}

state->vm()->checkpoint(state);
end

Expand Down
24 changes: 1 addition & 23 deletions machine/machine_code.cpp
Expand Up @@ -59,7 +59,6 @@ namespace rubinius {
, stack_size(code->stack_size()->to_native())
, number_of_locals(code->number_of_locals())
, call_count(0)
, loop_count(0)
, uncommon_count(0)
, _call_site_count_(0)
, _constant_cache_count_(0)
Expand All @@ -85,14 +84,6 @@ namespace rubinius {
splat_position = pos->to_native();
}

/* TODO: JIT
// Disable JIT for large methods
if(state->shared().config.jit_disabled ||
total > (size_t)state->shared().config.jit_limit_method_size) {
call_count = -1;
}
*/

for(int i = 0; i < cMaxSpecializations; i++) {
specializations[i].class_data.raw = 0;
specializations[i].execute = 0;
Expand Down Expand Up @@ -762,20 +753,7 @@ namespace rubinius {
return NULL;
}

// A negative call_count means we've disabled usage based JIT
// for this method.
if(mcode->call_count >= 0) {
/* TODO: JIT
if(mcode->call_count >= state->shared().config.jit_threshold_compile) {
OnStack<3> os(state, exec, mod, code);
G(jit)->compile_callframe(state, code);
} else {
mcode->call_count++;
}
*/
mcode->call_count++;
}
mcode->call_count++;

Object* value = 0;

Expand Down
5 changes: 0 additions & 5 deletions machine/machine_code.hpp
Expand Up @@ -70,7 +70,6 @@ namespace rubinius {
native_int number_of_locals;

native_int call_count;
native_int loop_count;
native_int uncommon_count;

attr_field(call_site_count, size_t);
Expand Down Expand Up @@ -140,10 +139,6 @@ namespace rubinius {
flags |= eNoInline;
}

native_int method_call_count() const {
return call_count - loop_count;
}

CallSite* call_site(STATE, int ip);
ConstantCache* constant_cache(STATE, int ip);

Expand Down

0 comments on commit 531ac3a

Please sign in to comment.