removed some global functions from inline_cache.cpp

Phil Dawes 2009-08-17 21:37:19 +01:00
parent 6727a19ba8
commit 23a5207e90
2 changed files with 4 additions and 50 deletions

View File

@ -9,11 +9,6 @@ void factorvm::init_inline_caching(int max_size)
max_pic_size = 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) void factorvm::deallocate_inline_cache(cell return_address)
{ {
/* Find the call target. */ /* Find the call target. */
@ -33,11 +28,6 @@ void factorvm::deallocate_inline_cache(cell return_address)
heap_free(&code,old_block); 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 /* Figure out what kind of type check the PIC needs based on the methods
it contains */ it contains */
cell factorvm::determine_inline_cache_type(array *cache_entries) cell factorvm::determine_inline_cache_type(array *cache_entries)
@ -77,21 +67,11 @@ cell factorvm::determine_inline_cache_type(array *cache_entries)
return 0; 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) void factorvm::update_pic_count(cell type)
{ {
pic_counts[type - PIC_TAG]++; pic_counts[type - PIC_TAG]++;
} }
void update_pic_count(cell type)
{
return vm->update_pic_count(type);
}
struct inline_cache_jit : public jit { struct inline_cache_jit : public jit {
fixnum index; fixnum index;
@ -128,8 +108,8 @@ void inline_cache_jit::compile_inline_cache(fixnum index,
gc_root<array> methods(methods_,myvm); gc_root<array> methods(methods_,myvm);
gc_root<array> cache_entries(cache_entries_,myvm); gc_root<array> cache_entries(cache_entries_,myvm);
cell inline_cache_type = determine_inline_cache_type(cache_entries.untagged()); cell inline_cache_type = myvm->determine_inline_cache_type(cache_entries.untagged());
update_pic_count(inline_cache_type); myvm->update_pic_count(inline_cache_type);
/* Generate machine code to determine the object's class. */ /* Generate machine code to determine the object's class. */
emit_class_lookup(index,inline_cache_type); 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; 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 */ /* A generic word's definition performs general method lookup. Allocates memory */
void *factorvm::megamorphic_call_stub(cell generic_word) void *factorvm::megamorphic_call_stub(cell generic_word)
{ {
return untag<word>(generic_word)->xt; 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) cell factorvm::inline_cache_size(cell cache_entries)
{ {
return array_capacity(untag_check<array>(cache_entries)) / 2; 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 */ /* Allocates memory */
cell factorvm::add_inline_cache_entry(cell cache_entries_, cell klass_, cell method_) 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(); 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) void factorvm::update_pic_transitions(cell pic_size)
{ {
if(pic_size == max_pic_size) if(pic_size == max_pic_size)
@ -231,11 +191,6 @@ void factorvm::update_pic_transitions(cell pic_size)
ic_to_pic_transitions++; 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). /* 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 */ Called from assembly with the actual return address */
void *factorvm::inline_cache_miss(cell return_address) void *factorvm::inline_cache_miss(cell return_address)
@ -290,11 +245,12 @@ void *factorvm::inline_cache_miss(cell return_address)
return xt; 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); return vm->inline_cache_miss(return_address);
} }
inline void factorvm::vmprim_reset_inline_cache_stats() inline void factorvm::vmprim_reset_inline_cache_stats()
{ {
cold_call_to_ic_transitions = ic_to_pic_transitions = pic_to_mega_transitions = 0; cold_call_to_ic_transitions = ic_to_pic_transitions = pic_to_mega_transitions = 0;

View File

@ -1,7 +1,5 @@
namespace factor namespace factor
{ {
void init_inline_caching(int max_size);
PRIMITIVE(reset_inline_cache_stats); PRIMITIVE(reset_inline_cache_stats);
PRIMITIVE(inline_cache_stats); PRIMITIVE(inline_cache_stats);
PRIMITIVE(inline_cache_miss); PRIMITIVE(inline_cache_miss);