From bc8525eb0206e11d335cc01bf14c93d95f7979ba Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Lindqvist?= Date: Sat, 10 Sep 2016 03:17:00 +0200 Subject: [PATCH] VM: the small return_address_index function can be implemented in the header --- GNUmakefile | 1 - Nmakefile | 1 - vm/gc_info.cpp | 16 ---------------- vm/gc_info.hpp | 11 ++++++++++- 4 files changed, 10 insertions(+), 19 deletions(-) delete mode 100644 vm/gc_info.cpp diff --git a/GNUmakefile b/GNUmakefile index 5176cd2d1c..aa6155207b 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -46,7 +46,6 @@ ifdef CONFIG vm/free_list.o \ vm/full_collector.o \ vm/gc.o \ - vm/gc_info.o \ vm/image.o \ vm/inline_cache.o \ vm/instruction_operands.o \ diff --git a/Nmakefile b/Nmakefile index efc91c5b07..eeb13bf952 100644 --- a/Nmakefile +++ b/Nmakefile @@ -70,7 +70,6 @@ DLL_OBJS = $(PLAF_DLL_OBJS) \ vm\free_list.obj \ vm\full_collector.obj \ vm\gc.obj \ - vm/gc_info.obj \ vm\image.obj \ vm\inline_cache.obj \ vm\instruction_operands.obj \ diff --git a/vm/gc_info.cpp b/vm/gc_info.cpp deleted file mode 100644 index 3e3e81938d..0000000000 --- a/vm/gc_info.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "master.hpp" - -namespace factor { - -cell gc_info::return_address_index(cell return_address) { - uint32_t* return_address_array = return_addresses(); - - for (cell i = 0; i < return_address_count; i++) { - if (return_address == return_address_array[i]) - return i; - } - - return (cell)-1; -} - -} diff --git a/vm/gc_info.hpp b/vm/gc_info.hpp index f5a25d2e3d..4a8bf84908 100644 --- a/vm/gc_info.hpp +++ b/vm/gc_info.hpp @@ -53,7 +53,16 @@ struct gc_info { return base_pointer_map()[index * derived_root_count + derived_root]; } - cell return_address_index(cell return_address); + cell return_address_index(cell return_address) { + uint32_t* return_address_array = return_addresses(); + + for (cell i = 0; i < return_address_count; i++) { + if (return_address == return_address_array[i]) + return i; + } + + return (cell)-1; + } }; } -- 2.34.1