]> gitweb.factorcode.org Git - factor.git/commitdiff
VM: the small return_address_index function can be implemented in the header
authorBjörn Lindqvist <bjourne@gmail.com>
Sat, 10 Sep 2016 01:17:00 +0000 (03:17 +0200)
committerBjörn Lindqvist <bjourne@gmail.com>
Sat, 10 Sep 2016 01:18:18 +0000 (03:18 +0200)
GNUmakefile
Nmakefile
vm/gc_info.cpp [deleted file]
vm/gc_info.hpp

index 5176cd2d1c55f568ffd2944f8f2bcf03ccbb876f..aa6155207b67fddb84bf49c5cf4b053e34500750 100644 (file)
@@ -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 \
index efc91c5b07ec5a391bb9a4ae551939caf061091e..eeb13bf952f62afec9d6abc00217da28d4662661 100644 (file)
--- 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 (file)
index 3e3e819..0000000
+++ /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;
-}
-
-}
index f5a25d2e3dfd200b22fdc2a997f15dab6cdcde8f..4a8bf849085dce1d27607d69c2a97dbfc8b959dd 100644 (file)
@@ -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;
+  }
 };
 
 }