From 6727a19ba8d91bb95b5a316247e289f5e7c67b28 Mon Sep 17 00:00:00 2001 From: Phil Dawes Date: Mon, 17 Aug 2009 21:37:19 +0100 Subject: [PATCH] removed some global functions from dispatch.cpp --- vm/dispatch.cpp | 55 ------------------------------------------------- vm/dispatch.hpp | 9 -------- 2 files changed, 64 deletions(-) diff --git a/vm/dispatch.cpp b/vm/dispatch.cpp index 25f7a2f2ec..85d92f90a0 100755 --- a/vm/dispatch.cpp +++ b/vm/dispatch.cpp @@ -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(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(untag(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(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(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(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(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++; diff --git a/vm/dispatch.hpp b/vm/dispatch.hpp index f5648c7ebe..b9cbcbbd85 100644 --- a/vm/dispatch.hpp +++ b/vm/dispatch.hpp @@ -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); - }