Skip to content

Commit

Permalink
Always internalize methods before JIT'ing them.
Browse files Browse the repository at this point in the history
Without doing this one would not be able to manually compile a method (using
Rubinius::JIT.compile) without first calling the method. Doing this would result
in the JIT trying to compile a NULL pointer instead of a rubinius::CompiledCode
object.
  • Loading branch information
Yorick Peterse committed Jan 16, 2015
1 parent 94cd3ba commit d198fb3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions vm/llvm/state.cpp
Expand Up @@ -463,6 +463,11 @@ namespace rubinius {
return;
}

// In case the method hasn't been internalized yet
if(!code->machine_code()) {
code->internalize(state, gct, call_frame);
}

JITCompileRequest* req = JITCompileRequest::create(state, code, receiver_class,
0, block_env, is_block);

Expand Down

0 comments on commit d198fb3

Please sign in to comment.