removed some global functions from dispatch.cpp
parent
0de0d5f256
commit
6234b7957f
|
@ -18,11 +18,6 @@ cell factorvm::search_lookup_alist(cell table, cell klass)
|
|||
return F;
|
||||
}
|
||||
|
||||
cell search_lookup_alist(cell table, cell klass)
|
||||
{
|
||||
return vm->search_lookup_alist(table,klass);
|
||||
}
|
||||
|
||||
cell factorvm::search_lookup_hash(cell table, cell klass, cell hashcode)
|
||||
{
|
||||
array *buckets = untag<array>(table);
|
||||
|
@ -33,33 +28,18 @@ cell factorvm::search_lookup_hash(cell table, cell klass, cell hashcode)
|
|||
return search_lookup_alist(bucket,klass);
|
||||
}
|
||||
|
||||
cell search_lookup_hash(cell table, cell klass, cell hashcode)
|
||||
{
|
||||
return vm->search_lookup_hash(table,klass,hashcode);
|
||||
}
|
||||
|
||||
cell factorvm::nth_superclass(tuple_layout *layout, fixnum echelon)
|
||||
{
|
||||
cell *ptr = (cell *)(layout + 1);
|
||||
return ptr[echelon * 2];
|
||||
}
|
||||
|
||||
cell nth_superclass(tuple_layout *layout, fixnum echelon)
|
||||
{
|
||||
return vm->nth_superclass(layout,echelon);
|
||||
}
|
||||
|
||||
cell factorvm::nth_hashcode(tuple_layout *layout, fixnum echelon)
|
||||
{
|
||||
cell *ptr = (cell *)(layout + 1);
|
||||
return ptr[echelon * 2 + 1];
|
||||
}
|
||||
|
||||
cell nth_hashcode(tuple_layout *layout, fixnum echelon)
|
||||
{
|
||||
return vm->nth_hashcode(layout,echelon);
|
||||
}
|
||||
|
||||
cell factorvm::lookup_tuple_method(cell obj, cell methods)
|
||||
{
|
||||
tuple_layout *layout = untag<tuple_layout>(untag<tuple>(obj)->layout);
|
||||
|
@ -92,11 +72,6 @@ cell factorvm::lookup_tuple_method(cell obj, cell methods)
|
|||
return F;
|
||||
}
|
||||
|
||||
cell lookup_tuple_method(cell obj, cell methods)
|
||||
{
|
||||
return vm->lookup_tuple_method(obj,methods);
|
||||
}
|
||||
|
||||
cell factorvm::lookup_hi_tag_method(cell obj, cell methods)
|
||||
{
|
||||
array *hi_tag_methods = untag<array>(methods);
|
||||
|
@ -107,11 +82,6 @@ cell factorvm::lookup_hi_tag_method(cell obj, cell methods)
|
|||
return array_nth(hi_tag_methods,tag);
|
||||
}
|
||||
|
||||
cell lookup_hi_tag_method(cell obj, cell methods)
|
||||
{
|
||||
return vm->lookup_hi_tag_method(obj,methods);
|
||||
}
|
||||
|
||||
cell factorvm::lookup_hairy_method(cell obj, cell methods)
|
||||
{
|
||||
cell method = array_nth(untag<array>(methods),TAG(obj));
|
||||
|
@ -134,11 +104,6 @@ cell factorvm::lookup_hairy_method(cell obj, cell methods)
|
|||
}
|
||||
}
|
||||
|
||||
cell lookup_hairy_method(cell obj, cell methods)
|
||||
{
|
||||
return vm->lookup_hairy_method(obj,methods);
|
||||
}
|
||||
|
||||
cell factorvm::lookup_method(cell obj, cell methods)
|
||||
{
|
||||
cell tag = TAG(obj);
|
||||
|
@ -148,11 +113,6 @@ cell factorvm::lookup_method(cell obj, cell methods)
|
|||
return array_nth(untag<array>(methods),TAG(obj));
|
||||
}
|
||||
|
||||
cell lookup_method(cell obj, cell methods)
|
||||
{
|
||||
return vm->lookup_method(obj,methods);
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_lookup_method()
|
||||
{
|
||||
cell methods = dpop();
|
||||
|
@ -178,22 +138,12 @@ cell factorvm::object_class(cell obj)
|
|||
}
|
||||
}
|
||||
|
||||
cell object_class(cell obj)
|
||||
{
|
||||
return vm->object_class(obj);
|
||||
}
|
||||
|
||||
cell factorvm::method_cache_hashcode(cell klass, array *array)
|
||||
{
|
||||
cell capacity = (array_capacity(array) >> 1) - 1;
|
||||
return ((klass >> TAG_BITS) & capacity) << 1;
|
||||
}
|
||||
|
||||
cell method_cache_hashcode(cell klass, array *array)
|
||||
{
|
||||
return vm->method_cache_hashcode(klass,array);
|
||||
}
|
||||
|
||||
void factorvm::update_method_cache(cell cache, cell klass, cell method)
|
||||
{
|
||||
array *cache_elements = untag<array>(cache);
|
||||
|
@ -202,11 +152,6 @@ void factorvm::update_method_cache(cell cache, cell klass, cell method)
|
|||
set_array_nth(cache_elements,hashcode + 1,method);
|
||||
}
|
||||
|
||||
void update_method_cache(cell cache, cell klass, cell method)
|
||||
{
|
||||
return vm->update_method_cache(cache,klass,method);
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_mega_cache_miss()
|
||||
{
|
||||
megamorphic_cache_misses++;
|
||||
|
|
|
@ -1,18 +1,9 @@
|
|||
namespace factor
|
||||
{
|
||||
|
||||
cell lookup_method(cell object, cell methods);
|
||||
PRIMITIVE(lookup_method);
|
||||
|
||||
cell object_class(cell object);
|
||||
|
||||
PRIMITIVE(mega_cache_miss);
|
||||
|
||||
PRIMITIVE(reset_dispatch_stats);
|
||||
PRIMITIVE(dispatch_stats);
|
||||
|
||||
void jit_emit_class_lookup(jit *jit, fixnum index, cell type);
|
||||
|
||||
void jit_emit_mega_cache_lookup(jit *jit, cell methods, fixnum index, cell cache);
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue