VM: refactoring to get rid of the megamorphic_call_stub and check_code_pointer() words
parent
885b5c7043
commit
423e983514
|
@ -7,8 +7,6 @@ void factor_vm::init_inline_caching(int max_size) { max_pic_size = max_size; }
|
|||
void factor_vm::deallocate_inline_cache(cell return_address) {
|
||||
/* Find the call target. */
|
||||
void* old_entry_point = get_call_target(return_address);
|
||||
check_code_pointer((cell)old_entry_point);
|
||||
|
||||
code_block* old_block = (code_block*)old_entry_point - 1;
|
||||
|
||||
/* Free the old PIC since we know its unreachable */
|
||||
|
@ -131,11 +129,6 @@ code_block* factor_vm::compile_inline_cache(fixnum index, cell generic_word_,
|
|||
return code;
|
||||
}
|
||||
|
||||
/* A generic word's definition performs general method lookup. */
|
||||
void* factor_vm::megamorphic_call_stub(cell generic_word) {
|
||||
return untag<word>(generic_word)->entry_point;
|
||||
}
|
||||
|
||||
cell factor_vm::inline_cache_size(cell cache_entries) {
|
||||
return array_capacity(untag_check<array>(cache_entries)) / 2;
|
||||
}
|
||||
|
@ -173,7 +166,6 @@ void factor_vm::update_pic_transitions(cell pic_size) {
|
|||
/* Allocates memory */
|
||||
void* factor_vm::inline_cache_miss(cell return_address_) {
|
||||
code_root return_address(return_address_, this);
|
||||
check_code_pointer(return_address.value);
|
||||
bool tail_call_site = tail_call_site_p(return_address.value);
|
||||
|
||||
#ifdef PIC_DEBUG
|
||||
|
@ -196,7 +188,7 @@ void* factor_vm::inline_cache_miss(cell return_address_) {
|
|||
void* xt;
|
||||
|
||||
if (pic_size >= max_pic_size)
|
||||
xt = megamorphic_call_stub(generic_word.value());
|
||||
xt = generic_word->entry_point;
|
||||
else {
|
||||
cell klass = object_class(object.value());
|
||||
cell method = lookup_method(object.value(), methods.value());
|
||||
|
|
|
@ -598,8 +598,6 @@ struct factor_vm {
|
|||
cell literals_, cell frame_size_untagged);
|
||||
|
||||
//code heap
|
||||
inline void check_code_pointer(cell ptr) {}
|
||||
|
||||
template <typename Iterator> void each_code_block(Iterator& iter) {
|
||||
code->allocator->iterate(iter);
|
||||
}
|
||||
|
@ -710,7 +708,6 @@ struct factor_vm {
|
|||
code_block* compile_inline_cache(fixnum index, cell generic_word_,
|
||||
cell methods_, cell cache_entries_,
|
||||
bool tail_call_p);
|
||||
void* megamorphic_call_stub(cell generic_word);
|
||||
cell inline_cache_size(cell cache_entries);
|
||||
cell add_inline_cache_entry(cell cache_entries_, cell klass_, cell method_);
|
||||
void update_pic_transitions(cell pic_size);
|
||||
|
|
Loading…
Reference in New Issue