VM: factor_vm::compile_inline_cache() can be removed

char-rename
Björn Lindqvist 2016-10-31 16:16:42 +01:00
parent ffab2bb7e0
commit e9cd20604c
2 changed files with 8 additions and 27 deletions

View File

@ -107,22 +107,6 @@ void inline_cache_jit::emit_inline_cache(fixnum index, cell generic_word_,
true); // stack_frame_p true); // stack_frame_p
} }
// Allocates memory
code_block* factor_vm::compile_inline_cache(fixnum index, cell generic_word_,
cell methods_, cell cache_entries_,
bool tail_call_p) {
data_root<word> generic_word(generic_word_, this);
data_root<array> methods(methods_, this);
data_root<array> cache_entries(cache_entries_, this);
inline_cache_jit jit(generic_word.value(), this);
jit.emit_inline_cache(index, generic_word.value(), methods.value(),
cache_entries.value(), tail_call_p);
code_block* code = jit.to_code_block(CODE_BLOCK_PIC, JIT_FRAME_SIZE);
initialize_code_block(code);
return code;
}
// Allocates memory // Allocates memory
cell factor_vm::add_inline_cache_entry(cell cache_entries_, cell klass_, cell factor_vm::add_inline_cache_entry(cell cache_entries_, cell klass_,
cell method_) { cell method_) {
@ -176,20 +160,20 @@ cell factor_vm::inline_cache_miss(cell return_address_) {
update_pic_transitions(pic_size); update_pic_transitions(pic_size);
cell xt; cell xt = generic_word->entry_point;
if (pic_size < max_pic_size) {
if (pic_size >= max_pic_size)
xt = generic_word->entry_point;
else {
cell klass = object_class(object.value()); cell klass = object_class(object.value());
cell method = lookup_method(object.value(), methods.value()); cell method = lookup_method(object.value(), methods.value());
data_root<array> new_cache_entries( data_root<array> new_cache_entries(
add_inline_cache_entry(cache_entries.value(), klass, method), this); add_inline_cache_entry(cache_entries.value(), klass, method), this);
xt = compile_inline_cache(index, generic_word.value(), methods.value(), inline_cache_jit jit(generic_word.value(), this);
new_cache_entries.value(), tail_call_site) jit.emit_inline_cache(index, generic_word.value(), methods.value(),
->entry_point(); new_cache_entries.value(), tail_call_site);
code_block* code = jit.to_code_block(CODE_BLOCK_PIC, JIT_FRAME_SIZE);
initialize_code_block(code);
xt = code->entry_point();
} }
// Install the new stub. // Install the new stub.

View File

@ -660,9 +660,6 @@ struct factor_vm {
// inline cache // inline cache
void deallocate_inline_cache(cell return_address); void deallocate_inline_cache(cell return_address);
void update_pic_count(cell type); void update_pic_count(cell type);
code_block* compile_inline_cache(fixnum index, cell generic_word_,
cell methods_, cell cache_entries_,
bool tail_call_p);
cell add_inline_cache_entry(cell cache_entries_, cell klass_, cell method_); cell add_inline_cache_entry(cell cache_entries_, cell klass_, cell method_);
void update_pic_transitions(cell pic_size); void update_pic_transitions(cell pic_size);
cell inline_cache_miss(cell return_address); cell inline_cache_miss(cell return_address);