From 54377a283616be8c4115dfd278240695433a78ad Mon Sep 17 00:00:00 2001 From: Douglas Katzman Date: Thu, 4 May 2017 12:16:40 -0400 Subject: [PATCH] Add hopscotch.c to $(COMMON_SRC) Also fix a warning if built without sb-unicode --- src/runtime/Config.x86-64-bsd | 4 ++-- src/runtime/Config.x86-64-darwin | 4 ++-- src/runtime/Config.x86-64-linux | 4 ++-- src/runtime/Config.x86-64-sunos | 2 +- src/runtime/Config.x86-64-win32 | 2 +- src/runtime/Config.x86-bsd | 2 +- src/runtime/Config.x86-darwin | 2 +- src/runtime/Config.x86-linux | 2 +- src/runtime/Config.x86-sunos | 2 +- src/runtime/Config.x86-win32 | 2 +- src/runtime/GNUmakefile | 2 +- src/runtime/gencgc.c | 12 +++++++----- src/runtime/hopscotch.c | 2 ++ 13 files changed, 23 insertions(+), 19 deletions(-) diff --git a/src/runtime/Config.x86-64-bsd b/src/runtime/Config.x86-64-bsd index 7f8855f4e..423e2fee8 100644 --- a/src/runtime/Config.x86-64-bsd +++ b/src/runtime/Config.x86-64-bsd @@ -23,9 +23,9 @@ CFLAGS += -fno-omit-frame-pointer LINKFLAGS += -Wl,--export-dynamic ifdef LISP_FEATURE_IMMOBILE_SPACE - GC_SRC = gencgc.c hopscotch.c traceroot.c marknsweepgc.c + GC_SRC = gencgc.c traceroot.c marknsweepgc.c else - GC_SRC = gencgc.c hopscotch.c traceroot.c + GC_SRC = gencgc.c traceroot.c endif # Nothing to do for after-grovel-headers. diff --git a/src/runtime/Config.x86-64-darwin b/src/runtime/Config.x86-64-darwin index 582807337..dde5fbed2 100644 --- a/src/runtime/Config.x86-64-darwin +++ b/src/runtime/Config.x86-64-darwin @@ -57,9 +57,9 @@ LINKFLAGS += -arch x86_64 -dynamic -twolevel_namespace -bind_at_load -pagezero_s CFLAGS += -arch x86_64 -fno-omit-frame-pointer ifdef LISP_FEATURE_IMMOBILE_SPACE - GC_SRC = gencgc.c hopscotch.c traceroot.c marknsweepgc.c + GC_SRC = gencgc.c traceroot.c marknsweepgc.c else - GC_SRC = gencgc.c hopscotch.c traceroot.c + GC_SRC = gencgc.c traceroot.c endif # Nothing to do for after-grovel-headers. diff --git a/src/runtime/Config.x86-64-linux b/src/runtime/Config.x86-64-linux index c1caf0c76..1f2a0e821 100644 --- a/src/runtime/Config.x86-64-linux +++ b/src/runtime/Config.x86-64-linux @@ -45,9 +45,9 @@ endif CFLAGS += -fno-omit-frame-pointer ifdef LISP_FEATURE_IMMOBILE_SPACE - GC_SRC = gencgc.c hopscotch.c traceroot.c marknsweepgc.c + GC_SRC = gencgc.c traceroot.c marknsweepgc.c else - GC_SRC = gencgc.c hopscotch.c traceroot.c + GC_SRC = gencgc.c traceroot.c endif ifdef LISP_FEATURE_SB_LINKABLE_RUNTIME diff --git a/src/runtime/Config.x86-64-sunos b/src/runtime/Config.x86-64-sunos index 43c906f7f..828781438 100644 --- a/src/runtime/Config.x86-64-sunos +++ b/src/runtime/Config.x86-64-sunos @@ -18,7 +18,7 @@ ifdef LISP_FEATURE_SB_CORE_COMPRESSION OS_LIBS += -lz endif -GC_SRC= gencgc.c hopscotch.c traceroot.c +GC_SRC= gencgc.c traceroot.c # Nothing to do for after-grovel-headers. .PHONY: after-grovel-headers diff --git a/src/runtime/Config.x86-64-win32 b/src/runtime/Config.x86-64-win32 index a8a5f6485..e4258a855 100644 --- a/src/runtime/Config.x86-64-win32 +++ b/src/runtime/Config.x86-64-win32 @@ -45,7 +45,7 @@ ifdef LISP_FEATURE_SB_CORE_COMPRESSION OS_LIBS += -lz endif -GC_SRC = gencgc.c hopscotch.c traceroot.c +GC_SRC = gencgc.c traceroot.c CFLAGS = -g -W -Wall \ -Wno-unused-function \ diff --git a/src/runtime/Config.x86-bsd b/src/runtime/Config.x86-bsd index 50f897df8..a75db93a5 100644 --- a/src/runtime/Config.x86-bsd +++ b/src/runtime/Config.x86-bsd @@ -21,7 +21,7 @@ ifdef LISP_FEATURE_SB_CORE_COMPRESSION OS_LIBS += -lz endif -GC_SRC = gencgc.c hopscotch.c traceroot.c +GC_SRC = gencgc.c traceroot.c # Nothing to do for after-grovel-headers. .PHONY: after-grovel-headers diff --git a/src/runtime/Config.x86-darwin b/src/runtime/Config.x86-darwin index 4bb235045..afe986aef 100644 --- a/src/runtime/Config.x86-darwin +++ b/src/runtime/Config.x86-darwin @@ -47,7 +47,7 @@ ARCH_SRC = x86-arch.c CPPFLAGS += -no-cpp-precomp -GC_SRC = gencgc.c hopscotch.c traceroot.c +GC_SRC = gencgc.c traceroot.c .PHONY: after-grovel-headers diff --git a/src/runtime/Config.x86-linux b/src/runtime/Config.x86-linux index 4aef282ed..fb82ce05f 100644 --- a/src/runtime/Config.x86-linux +++ b/src/runtime/Config.x86-linux @@ -48,7 +48,7 @@ ifdef LISP_FEATURE_SB_LINKABLE_RUNTIME USE_LIBSBCL = sbcl.o endif -GC_SRC = gencgc.c hopscotch.c traceroot.c +GC_SRC = gencgc.c traceroot.c # Nothing to do for after-grovel-headers. .PHONY: after-grovel-headers diff --git a/src/runtime/Config.x86-sunos b/src/runtime/Config.x86-sunos index 87b1034e0..3a6788681 100644 --- a/src/runtime/Config.x86-sunos +++ b/src/runtime/Config.x86-sunos @@ -24,7 +24,7 @@ ifdef LISP_FEATURE_SB_CORE_COMPRESSION OS_LIBS += -lz endif -GC_SRC= gencgc.c hopscotch.c traceroot.c +GC_SRC= gencgc.c traceroot.c # Nothing to do for after-grovel-headers. .PHONY: after-grovel-headers diff --git a/src/runtime/Config.x86-win32 b/src/runtime/Config.x86-win32 index 8210c6fa5..055685fec 100644 --- a/src/runtime/Config.x86-win32 +++ b/src/runtime/Config.x86-win32 @@ -43,7 +43,7 @@ ifdef LISP_FEATURE_SB_CORE_COMPRESSION OS_LIBS += -lz endif -GC_SRC = gencgc.c hopscotch.c traceroot.c +GC_SRC = gencgc.c traceroot.c CFLAGS = -g -Wall -O3 \ -fno-omit-frame-pointer -march=i686 -DWINVER=0x0501 \ diff --git a/src/runtime/GNUmakefile b/src/runtime/GNUmakefile index 3b80d66e3..99eb64aff 100644 --- a/src/runtime/GNUmakefile +++ b/src/runtime/GNUmakefile @@ -60,7 +60,7 @@ __LDFLAGS__ += -nopie endif COMMON_SRC = alloc.c backtrace.c breakpoint.c coreparse.c dynbind.c \ - funcall.c gc-common.c globals.c interr.c interrupt.c \ + funcall.c gc-common.c globals.c hopscotch.c interr.c interrupt.c\ largefile.c monitor.c os-common.c parse.c print.c purify.c \ pthread-futex.c regnames.c run-program.c runtime.c \ safepoint.c save.c sc-offset.c search.c thread.c time.c \ diff --git a/src/runtime/gencgc.c b/src/runtime/gencgc.c index ea5451efb..b10a62c98 100644 --- a/src/runtime/gencgc.c +++ b/src/runtime/gencgc.c @@ -163,7 +163,7 @@ static boolean conservative_stack = 1; * page_table_pages is set from the size of the dynamic space. */ page_index_t page_table_pages; struct page *page_table; -#if defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64) +#ifndef GENCGC_IS_PRECISE struct hopscotch_table pinned_objects; lispobj gc_object_watcher; int gc_n_stack_pins; @@ -2126,12 +2126,8 @@ maybe_adjust_large_object(page_index_t first_page) } #if !(defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64)) -# define hopscotch_init() -# define hopscotch_reset(a) # define scavenge_pinned_ranges() # define wipe_nonpinned_words() -# define hopscotch_create(a,b,c,d,e) -# define hopscotch_log_stats(a,b) /* After scavenging of the roots is done, we go back to the pinned objects * and look within them for pointers. While heap_scavenge() could certainly * do this, it would potentially lead to extra work, since we can't know @@ -3488,7 +3484,9 @@ garbage_collect_generation(generation_index_t generation, int raise) generations[new_space].alloc_large_start_page = 0; #endif +#ifndef GENCGC_IS_PRECISE hopscotch_reset(&pinned_objects); +#endif /* Before any pointers are preserved, the dont_move flags on the * pages need to be cleared. */ /* FIXME: consider moving this bitmap into its own range of words, @@ -3749,7 +3747,9 @@ garbage_collect_generation(generation_index_t generation, int raise) /* Flush the current regions, updating the tables. */ gc_alloc_update_all_page_tables(0); +#ifndef GENCGC_IS_PRECISE hopscotch_log_stats(&pinned_objects, "pins"); +#endif /* Free the pages in oldspace, but not those marked dont_move. */ free_oldspace(); @@ -4081,8 +4081,10 @@ gc_init(void) #endif hopscotch_init(); +#ifndef GENCGC_IS_PRECISE hopscotch_create(&pinned_objects, HOPSCOTCH_HASH_FUN_DEFAULT, 0 /* hashset */, 32 /* logical bin count */, 0 /* default range */); +#endif scavtab[WEAK_POINTER_WIDETAG] = scav_weak_pointer; transother[SIMPLE_ARRAY_WIDETAG] = trans_boxed_large; diff --git a/src/runtime/hopscotch.c b/src/runtime/hopscotch.c index d49ed50fc..7eee2ef87 100644 --- a/src/runtime/hopscotch.c +++ b/src/runtime/hopscotch.c @@ -243,7 +243,9 @@ static void hopscotch_realloc(tableptr ht, int size, char hop_range) /// Same as SB-KERNEL:%SXHASH-SIMPLE-STRING uword_t sxhash_simple_string(struct vector* string) { +#ifdef SIMPLE_CHARACTER_STRING_WIDETAG unsigned int* char_string = (unsigned int*)(string->data); +#endif unsigned char* base_string = (unsigned char*)(string->data); sword_t len = fixnum_value(string->length); uword_t result = 0; -- 2.11.4.GIT