removed some global functions from inline_cache.cpp
parent
6727a19ba8
commit
23a5207e90
|
|
@ -9,11 +9,6 @@ void factorvm::init_inline_caching(int max_size)
|
|||
max_pic_size = max_size;
|
||||
}
|
||||
|
||||
void init_inline_caching(int max_size)
|
||||
{
|
||||
return vm->init_inline_caching(max_size);
|
||||
}
|
||||
|
||||
void factorvm::deallocate_inline_cache(cell return_address)
|
||||
{
|
||||
/* Find the call target. */
|
||||
|
|
@ -33,11 +28,6 @@ void factorvm::deallocate_inline_cache(cell return_address)
|
|||
heap_free(&code,old_block);
|
||||
}
|
||||
|
||||
void deallocate_inline_cache(cell return_address)
|
||||
{
|
||||
return vm->deallocate_inline_cache(return_address);
|
||||
}
|
||||
|
||||
/* Figure out what kind of type check the PIC needs based on the methods
|
||||
it contains */
|
||||
cell factorvm::determine_inline_cache_type(array *cache_entries)
|
||||
|
|
@ -77,21 +67,11 @@ cell factorvm::determine_inline_cache_type(array *cache_entries)
|
|||
return 0;
|
||||
}
|
||||
|
||||
cell determine_inline_cache_type(array *cache_entries)
|
||||
{
|
||||
return vm->determine_inline_cache_type(cache_entries);
|
||||
}
|
||||
|
||||
void factorvm::update_pic_count(cell type)
|
||||
{
|
||||
pic_counts[type - PIC_TAG]++;
|
||||
}
|
||||
|
||||
void update_pic_count(cell type)
|
||||
{
|
||||
return vm->update_pic_count(type);
|
||||
}
|
||||
|
||||
struct inline_cache_jit : public jit {
|
||||
fixnum index;
|
||||
|
||||
|
|
@ -128,8 +108,8 @@ void inline_cache_jit::compile_inline_cache(fixnum index,
|
|||
gc_root<array> methods(methods_,myvm);
|
||||
gc_root<array> cache_entries(cache_entries_,myvm);
|
||||
|
||||
cell inline_cache_type = determine_inline_cache_type(cache_entries.untagged());
|
||||
update_pic_count(inline_cache_type);
|
||||
cell inline_cache_type = myvm->determine_inline_cache_type(cache_entries.untagged());
|
||||
myvm->update_pic_count(inline_cache_type);
|
||||
|
||||
/* Generate machine code to determine the object's class. */
|
||||
emit_class_lookup(index,inline_cache_type);
|
||||
|
|
@ -176,32 +156,17 @@ code_block *factorvm::compile_inline_cache(fixnum index,cell generic_word_,cell
|
|||
return code;
|
||||
}
|
||||
|
||||
code_block *compile_inline_cache(fixnum index,cell generic_word_,cell methods_,cell cache_entries_,bool tail_call_p)
|
||||
{
|
||||
return vm->compile_inline_cache(index,generic_word_,methods_,cache_entries_,tail_call_p);
|
||||
}
|
||||
|
||||
/* A generic word's definition performs general method lookup. Allocates memory */
|
||||
void *factorvm::megamorphic_call_stub(cell generic_word)
|
||||
{
|
||||
return untag<word>(generic_word)->xt;
|
||||
}
|
||||
|
||||
void *megamorphic_call_stub(cell generic_word)
|
||||
{
|
||||
return vm->megamorphic_call_stub(generic_word);
|
||||
}
|
||||
|
||||
cell factorvm::inline_cache_size(cell cache_entries)
|
||||
{
|
||||
return array_capacity(untag_check<array>(cache_entries)) / 2;
|
||||
}
|
||||
|
||||
cell inline_cache_size(cell cache_entries)
|
||||
{
|
||||
return vm->inline_cache_size(cache_entries);
|
||||
}
|
||||
|
||||
/* Allocates memory */
|
||||
cell factorvm::add_inline_cache_entry(cell cache_entries_, cell klass_, cell method_)
|
||||
{
|
||||
|
|
@ -216,11 +181,6 @@ cell factorvm::add_inline_cache_entry(cell cache_entries_, cell klass_, cell met
|
|||
return new_cache_entries.value();
|
||||
}
|
||||
|
||||
cell add_inline_cache_entry(cell cache_entries_, cell klass_, cell method_)
|
||||
{
|
||||
return vm->add_inline_cache_entry(cache_entries_,klass_,method_);
|
||||
}
|
||||
|
||||
void factorvm::update_pic_transitions(cell pic_size)
|
||||
{
|
||||
if(pic_size == max_pic_size)
|
||||
|
|
@ -231,11 +191,6 @@ void factorvm::update_pic_transitions(cell pic_size)
|
|||
ic_to_pic_transitions++;
|
||||
}
|
||||
|
||||
void update_pic_transitions(cell pic_size)
|
||||
{
|
||||
return vm->update_pic_transitions(pic_size);
|
||||
}
|
||||
|
||||
/* The cache_entries parameter is either f (on cold call site) or an array (on cache miss).
|
||||
Called from assembly with the actual return address */
|
||||
void *factorvm::inline_cache_miss(cell return_address)
|
||||
|
|
@ -290,11 +245,12 @@ void *factorvm::inline_cache_miss(cell return_address)
|
|||
return xt;
|
||||
}
|
||||
|
||||
void *inline_cache_miss(cell return_address)
|
||||
VM_C_API void *inline_cache_miss(cell return_address)
|
||||
{
|
||||
return vm->inline_cache_miss(return_address);
|
||||
}
|
||||
|
||||
|
||||
inline void factorvm::vmprim_reset_inline_cache_stats()
|
||||
{
|
||||
cold_call_to_ic_transitions = ic_to_pic_transitions = pic_to_mega_transitions = 0;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
namespace factor
|
||||
{
|
||||
void init_inline_caching(int max_size);
|
||||
|
||||
PRIMITIVE(reset_inline_cache_stats);
|
||||
PRIMITIVE(inline_cache_stats);
|
||||
PRIMITIVE(inline_cache_miss);
|
||||
|
|
|
|||
Loading…
Reference in New Issue