Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating our dev branches #65

Closed
wants to merge 144 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
e8ba639
Update/julia master (#2)
udesou Jan 31, 2023
b833129
Merge remote-tracking branch 'upstream/master' into merge-upstream-0f…
qinsoon Feb 2, 2023
54ca78a
Merge pull request #4 from qinsoon/merge-upstream-0f526b0
qinsoon Feb 2, 2023
72a2752
Refactor MMTk changes to Julia (#5)
kpamnany Mar 16, 2023
9dbc8fc
Make perm alloc calls specific to GC implementation (#9)
qinsoon May 3, 2023
a760a7e
Implement MMTk write barrier (#11)
qinsoon May 4, 2023
95bc54a
Allow GC to implement array ptr copy (#10)
qinsoon May 5, 2023
eb407eb
Use MMTk VM space (#12)
qinsoon May 8, 2023
620cb79
Remove duplicate code that is possibly introduced during merging (#13)
qinsoon May 9, 2023
54234be
Merge remote-tracking branch 'upstream/master' into merge-upstream-90…
qinsoon May 16, 2023
e7e43f1
Implement write barrier fastpath for sticky immix (#8)
qinsoon May 16, 2023
ed8580a
WIP
qinsoon May 17, 2023
6f23a06
Merge branch 'master' into merge-upstream-909c57f
qinsoon May 17, 2023
ec37ebe
Minor fix
qinsoon May 18, 2023
34930e5
Use JL_DLLIMPORT for MMTk functions. Update uses of MMTk functions with
qinsoon May 18, 2023
1af2dd0
Pass n_gcthreads to mmtk_gc_init. Avoid spawning GC threads in Julia.
qinsoon May 18, 2023
da45bf7
Set ngcthreads=0 in jl_start_threads
qinsoon May 19, 2023
8194356
Fix stock Julia build
qinsoon May 25, 2023
0eeb64b
Merge pull request #14 from qinsoon/merge-upstream-909c57f
qinsoon May 29, 2023
fb024c6
Copy libmmtk_julia to usr/lib (#15)
qinsoon May 30, 2023
98a66ba
Embed mutator in _jl_tls_states_t (#16)
qinsoon Jun 15, 2023
0d8bbd9
Align up alloc size (#18)
qinsoon Jun 29, 2023
bf1c43e
Allow skip inlined fastpath (#19)
qinsoon Jun 30, 2023
e5fc5dd
Avoid calling mmtk_gc_poll frequently (#20)
qinsoon Jul 2, 2023
d4c37cb
Merge remote-tracking branch 'upstream/master' into update-upstream-4…
qinsoon Jul 3, 2023
337c276
Merge branch 'master' into update-upstream-43bf2c8
qinsoon Jul 3, 2023
05c42dd
Notify GC when loading pkg image
qinsoon Jul 3, 2023
67c5c32
Remove MMTk counted malloc (#24)
qinsoon Jul 24, 2023
f690aa3
Use Julia's finalizer implementation (#22)
qinsoon Jul 24, 2023
f41239c
Refactor the code for scanning, getting object size in Rust, and remo…
udesou Jul 25, 2023
ed30d1c
Adding check for COPY_STACKS flag and julia_copy_stacks feature
udesou Jul 26, 2023
7341157
Inline runtime alloc (#23)
qinsoon Jul 27, 2023
1f0ec5a
Merge remote-tracking branch 'origin/master' into feature/refactor-sc…
udesou Jul 27, 2023
5733c28
Merge pull request #25 from udesou/feature/refactor-scan-obj
udesou Jul 27, 2023
ae2fa58
Supporting moving immix (wip)
udesou Aug 3, 2023
2f21eec
Pushing current task into the stack to set as red root; pin string wh…
udesou Aug 7, 2023
39530f9
Fixing issue that prevented building Julia or running tests with Juli…
udesou Aug 9, 2023
5fe96d7
Fixing issue that prevented building Julia or running tests with Juli…
udesou Aug 9, 2023
b472648
Merge branch 'master' into update-upstream-43bf2c8
qinsoon Aug 15, 2023
fdada6c
Fix some build issues
qinsoon Aug 21, 2023
7985bb2
Fixing issue when setting up the number of stock GC threads - it shou…
udesou Aug 22, 2023
27fc101
Apply lock before schedule finalizers
qinsoon Aug 22, 2023
e591ad8
Fixing issue when setting up the number of stock GC threads - it shou…
udesou Aug 22, 2023
00bab46
Fixing issue that prevented building Julia or running tests with Juli…
udesou Aug 9, 2023
beb4a08
Merge pull request #26 from udesou/fix/enabling-debug-build
udesou Aug 23, 2023
9314e70
Merge branch 'mmtk:master' into feature/rb-roots
udesou Aug 23, 2023
6d8df8f
Setting number of stock Julia mutators to 0 and fixing assertion
udesou Aug 28, 2023
8eab37d
Add write barrier for excstack update
qinsoon Aug 28, 2023
d0cbd13
Revert "Apply lock before schedule finalizers"
qinsoon Aug 29, 2023
8d0d8b5
Revert "Fixing issue when setting up the number of stock GC threads -…
qinsoon Aug 29, 2023
fdef6b1
Merge pull request #28 from udesou/fix/set-num-gc-threads
udesou Aug 31, 2023
c8543de
Merge branch 'master' into update-upstream-43bf2c8
qinsoon Aug 31, 2023
83796a7
Merge pull request #21 from qinsoon/update-upstream-43bf2c8
qinsoon Sep 1, 2023
bbe1f1d
Merge branch 'master' into feature/rb-roots
udesou Sep 6, 2023
66a49cc
Refactoring the code to reuse most of jl_gc_collect in block_for_gc
udesou Sep 7, 2023
5c406d9
Merge pull request #29 from udesou/fix/refactor-block-for-gc
udesou Sep 12, 2023
d14df55
Merge remote-tracking branch 'udesou/master' into feature/rb-roots
udesou Sep 13, 2023
f9da153
Checking if object is managed by mmtk before calling pin function; Pi…
udesou Sep 15, 2023
cfb6d90
Fixing duplicate code from merging mistake
udesou Sep 15, 2023
6921f6c
Stop using Julia's size classes
udesou Oct 5, 2023
29f5993
Removing code related to size classes
udesou Oct 5, 2023
a0e35b5
Minor refactoring of jl_gc_classify_pools
udesou Oct 6, 2023
387814b
Aligning strings to 8 bytes
udesou Oct 6, 2023
1d97f5d
Fixing whitespace
udesou Oct 6, 2023
4792b73
Removing functions to call mmtk's enable and disable collection
udesou Feb 1, 2024
4e057c9
Forgot a few other places
udesou Feb 1, 2024
1348e50
Missing reference in thread initialization
udesou Feb 1, 2024
125d05e
Exporting jl_gc_disable_counter
udesou Feb 1, 2024
99aa5dd
Exporting jl_gc_disable_counter
udesou Feb 1, 2024
22524a8
Merge pull request #35 from udesou/feature/check-gc-disabled
udesou Feb 7, 2024
25c06e0
Merge branch 'master' into feature/rb-roots
udesou Feb 7, 2024
a0c895e
Increasing the timeout just in case it's caused by the github runner …
udesou Feb 9, 2024
3b4ae53
Refactoring pinning functions and adding comments
udesou Feb 12, 2024
861f151
Merge pull request #27 from udesou/feature/rb-roots
udesou Feb 12, 2024
f470eb4
Merge branch 'master' into fix/remove-sizeclasses
udesou Feb 27, 2024
9460689
Merge pull request #31 from udesou/fix/remove-sizeclasses
udesou Feb 27, 2024
6f5f685
Call initialize_collection after _finish_julia_init (#40)
qinsoon Feb 28, 2024
d907a06
Port PR #42 and #44 to master (#48)
qinsoon May 10, 2024
3f11a82
Merge branch 'upstream-master'
udesou Jul 17, 2024
f9f38df
Changes to support mmtk
udesou Jul 18, 2024
b64c1e4
Final changes to support the binding
udesou Jul 22, 2024
8bb0895
Immix working; inlining fastpath allocation is not
udesou Jul 25, 2024
4a17579
Fix test in make-Profile
udesou Jul 25, 2024
6fee739
Fixing macro to lower intrinsics properly
udesou Jul 31, 2024
708e435
Remove jl_gc_wb_buf and jl_gc_wb_binding functions
udesou Jul 31, 2024
f525fef
Pinning generic memory and owners (wip)
udesou Aug 2, 2024
5cf0dae
Inlining write barrier
udesou Aug 2, 2024
ec77b2b
Adding wb on array copying; undef new macro as well
udesou Aug 2, 2024
7cc64d5
Enabled inlined fastpath allocation again
udesou Aug 2, 2024
9dc4448
Enabling fastpath allocation
udesou Aug 6, 2024
df66882
Fixing typos when lowering write barriers
udesou Aug 7, 2024
8ef0c15
Updating fastpath allocation to count number of alloced bytes
udesou Aug 7, 2024
b56b167
Updating write barrier block splitting
udesou Aug 7, 2024
5bbfd16
Only pin owners, not all generic memory objects
udesou Aug 15, 2024
d98aa33
Merge pull request #62 from udesou/update-julia-master
udesou Aug 19, 2024
df35d17
Refactoring to be considered before adding MMTk
udesou Aug 28, 2024
d2f2b8d
Removing jl_gc_notify_image_load, since it's a new function and not p…
udesou Aug 29, 2024
a42cb64
Moving gc_enable code to gc-common.c
udesou Sep 2, 2024
9256391
Addressing PR comments
udesou Sep 16, 2024
ec398e1
Push resolution of merge conflict
udesou Sep 19, 2024
68e5e11
Removing jl_gc_mark_queue_obj_explicit extern definition from schedul…
udesou Sep 25, 2024
c23f0db
Don't need the getter function since it's possible to use jl_small_ty…
udesou Sep 25, 2024
4bfcfe5
WIP: Adding support for MMTk/Immix
udesou Aug 27, 2024
b488bbe
Refactoring to be considered before adding MMTk
udesou Aug 28, 2024
a4cf8e7
Adding fastpath allocation
udesou Aug 29, 2024
ecb675a
Fixing removed newlines
udesou Aug 29, 2024
77db203
Refactoring to be considered before adding MMTk
udesou Aug 28, 2024
c5d3a40
Adding a few comments; Moving some functions to be closer together
udesou Sep 2, 2024
c26632e
Fixing merge conflicts
udesou Sep 25, 2024
c283442
Applying changes from refactoring before adding MMTk
udesou Sep 25, 2024
01aa623
Refactoring to be considered before adding MMTk
udesou Aug 28, 2024
e10e3ca
Removing jl_gc_notify_image_load, since it's a new function and not p…
udesou Aug 29, 2024
d4c4360
Moving gc_enable code to gc-common.c
udesou Sep 2, 2024
d07cae7
Addressing PR comments
udesou Sep 16, 2024
8e15217
Push resolution of merge conflict
udesou Sep 19, 2024
0cb0784
Removing jl_gc_mark_queue_obj_explicit extern definition from schedul…
udesou Sep 25, 2024
12634f3
Don't need the getter function since it's possible to use jl_small_ty…
udesou Sep 25, 2024
aa80933
Remove extern from free_stack declaration in julia_internal.h
udesou Sep 27, 2024
7ce3fe3
Putting everything that is common GC tls into gc-tls-common.h
udesou Oct 8, 2024
048af72
Typo
udesou Oct 8, 2024
fe61c22
Adding gc-tls-common.h to Makefile as a public header
udesou Oct 8, 2024
b39f427
Merge branch 'refactor-pre-mmtk' into add-mmtk-upstream
udesou Oct 8, 2024
380fd83
Removing gc-tls-common fields from gc-tls-mmtk.h
udesou Oct 8, 2024
ebf478a
Refactoring to be considered before adding MMTk
udesou Aug 28, 2024
0a8444e
Removing jl_gc_notify_image_load, since it's a new function and not p…
udesou Aug 29, 2024
c8818ea
Moving gc_enable code to gc-common.c
udesou Sep 2, 2024
e721e0c
Addressing PR comments
udesou Sep 16, 2024
6c0eb93
Push resolution of merge conflict
udesou Sep 19, 2024
fb0ec76
Removing jl_gc_mark_queue_obj_explicit extern definition from schedul…
udesou Sep 25, 2024
3eea079
Don't need the getter function since it's possible to use jl_small_ty…
udesou Sep 25, 2024
ef6c798
Remove extern from free_stack declaration in julia_internal.h
udesou Sep 27, 2024
63ca362
Putting everything that is common GC tls into gc-tls-common.h
udesou Oct 8, 2024
3271996
Typo
udesou Oct 8, 2024
cd4f5a1
Adding gc-tls-common.h to Makefile as a public header
udesou Oct 8, 2024
b26760d
Merge branch 'refactor-pre-mmtk' into add-mmtk-upstream
udesou Oct 10, 2024
f4eba6b
Adding jl_full_sweep_reasons since timing.jl depends on it
udesou Oct 10, 2024
c20ecb3
Fixing issue with jl_full_sweep_reasons (missing constants)
udesou Oct 10, 2024
aca5da9
Merge branch 'upstream-ready/immix' into dev
udesou Oct 10, 2024
7cc2fe1
Removing reduntant changes to upstream (wip; need to add back stuff f…
udesou Oct 10, 2024
3f7fd31
Typo
udesou Oct 10, 2024
7ff37de
Cleanup
udesou Oct 10, 2024
2e1d5da
Cleanup; Adding pieces to make building immix possible again
udesou Oct 10, 2024
2ca9fb0
Trying to add sticky back again (wip)
udesou Oct 10, 2024
b536f42
Adding jl_gc_notify_image_alloc calls that set the log bit for the wh…
udesou Oct 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ HAVE_SSP := 0
WITH_GC_VERIFY := 0
WITH_GC_DEBUG_ENV := 0

# Use MMTk GC
WITH_MMTK ?= 0

# Enable DTrace support
WITH_DTRACE := 0

Expand Down Expand Up @@ -790,6 +793,44 @@ JCXXFLAGS += -DGC_DEBUG_ENV
JCFLAGS += -DGC_DEBUG_ENV
endif

ifeq ($(WITH_MMTK), 1)
ifeq (${MMTK_JULIA_DIR},)
$(error MMTK_JULIA_DIR must be set to use MMTk)
endif
JCXXFLAGS += -DMMTK_GC
JCFLAGS += -DMMTK_GC
ifeq (${MMTK_BUILD},)
ifeq (debug,$(findstring debug,$(MAKECMDGOALS)))
MMTK_BUILD = debug
else
MMTK_BUILD = release
endif
endif
ifeq (${MMTK_PLAN},Immix)
JCXXFLAGS += -DMMTK_PLAN_IMMIX
JCFLAGS += -DMMTK_PLAN_IMMIX
endif
ifeq (${MMTK_PLAN},StickyImmix)
JCXXFLAGS += -DMMTK_PLAN_STICKYIMMIX
JCFLAGS += -DMMTK_PLAN_STICKYIMMIX
endif
MMTK_DIR = ${MMTK_JULIA_DIR}/mmtk
MMTK_API_INC = $(MMTK_DIR)/api
MMTK_JULIA_INC = ${MMTK_JULIA_DIR}/julia
ifeq ($(OS),Linux)
MMTK_LIB_NAME := libmmtk_julia.so
else
$(error "Unsupported OS for MMTk")
endif
MMTK_LIB_SRC := $(MMTK_DIR)/target/$(MMTK_BUILD)/$(MMTK_LIB_NAME)
MMTK_LIB_DST := $(BUILDROOT)/usr/lib/$(MMTK_LIB_NAME)
MMTK_LIB := -lmmtk_julia
LDFLAGS += -Wl,-rpath=$(MMTK_DIR)/target/$(MMTK_BUILD)/
else
MMTK_JULIA_INC :=
MMTK_LIB :=
endif

ifeq ($(WITH_DTRACE), 1)
JCXXFLAGS += -DUSE_DTRACE
JCFLAGS += -DUSE_DTRACE
Expand Down Expand Up @@ -1777,6 +1818,9 @@ PRINT_PERL = printf ' %b %b\n' $(PERLCOLOR)PERL$(ENDCOLOR) $(BINCOLOR)$(GOAL)
PRINT_FLISP = printf ' %b %b\n' $(FLISPCOLOR)FLISP$(ENDCOLOR) $(BINCOLOR)$(GOAL)$(ENDCOLOR); $(1)
PRINT_JULIA = printf ' %b %b\n' $(JULIACOLOR)JULIA$(ENDCOLOR) $(BINCOLOR)$(GOAL)$(ENDCOLOR); $(1)
PRINT_DTRACE = printf ' %b %b\n' $(DTRACECOLOR)DTRACE$(ENDCOLOR) $(BINCOLOR)$(GOAL)$(ENDCOLOR); $(1)
ifeq ($(WITH_MMTK), 1)
PRINT_MMTK = printf ' %b %b\n' $(LINKCOLOR)MMTK$(ENDCOLOR) $(BINCOLOR)$(GOAL)$(ENDCOLOR); $(1)
endif

else
QUIET_MAKE =
Expand All @@ -1787,6 +1831,9 @@ PRINT_PERL = echo '$(subst ','\'',$(1))'; $(1)
PRINT_FLISP = echo '$(subst ','\'',$(1))'; $(1)
PRINT_JULIA = echo '$(subst ','\'',$(1))'; $(1)
PRINT_DTRACE = echo '$(subst ','\'',$(1))'; $(1)
ifeq ($(WITH_MMTK), 1)
PRINT_MMTK = echo '$(subst ','\'',$(1))'; $(1)
endif

endif

Expand Down
2 changes: 1 addition & 1 deletion contrib/refresh_checksums.mk
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ CLANG_TRIPLETS=$(filter %-darwin %-freebsd,$(TRIPLETS))
NON_CLANG_TRIPLETS=$(filter-out %-darwin %-freebsd,$(TRIPLETS))

# These are the projects currently using BinaryBuilder; both GCC-expanded and non-GCC-expanded:
BB_PROJECTS=mbedtls libssh2 nghttp2 mpfr curl libgit2 pcre libuv unwind llvmunwind dsfmt objconv p7zip zlib libsuitesparse openlibm blastrampoline libtracyclient
BB_PROJECTS=mbedtls libssh2 nghttp2 mpfr curl libgit2 pcre libuv unwind llvmunwind dsfmt objconv p7zip zlib libsuitesparse openlibm blastrampoline libtracyclient libmmtk_julia
BB_GCC_EXPANDED_PROJECTS=openblas csl
BB_CXX_EXPANDED_PROJECTS=gmp llvm clang llvm-tools lld
# These are non-BB source-only deps
Expand Down
43 changes: 34 additions & 9 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ ifeq ($(USECLANG),1)
FLAGS += -Wno-return-type-c-linkage -Wno-atomic-alignment
endif

ifeq ($(WITH_MMTK), 1)
FLAGS += -I$(MMTK_API_INC) -I$(MMTK_JULIA_INC)
endif

FLAGS += -DJL_BUILD_ARCH='"$(ARCH)"'
ifeq ($(OS),WINNT)
FLAGS += -DJL_BUILD_UNAME='"NT"'
Expand All @@ -44,8 +48,8 @@ SRCS := \
jltypes gf typemap smallintset ast builtins module interpreter symbol \
dlload sys init task array genericmemory staticdata toplevel jl_uv datatype \
simplevector runtime_intrinsics precompile jloptions mtarraylist \
threading scheduler stackwalk gc-common gc-stock gc-debug gc-pages gc-stacks gc-alloc-profiler gc-page-profiler method \
jlapi signal-handling safepoint timing subtype rtutils gc-heap-snapshot \
threading scheduler stackwalk gc-common gc-stock gc-mmtk gc-debug gc-pages gc-stacks gc-alloc-profiler gc-page-profiler \
method jlapi signal-handling safepoint timing subtype rtutils gc-heap-snapshot \
crc32c APInt-C processor ircode opaque_closure codegen-stubs coverage runtime_ccall engine

RT_LLVMLINK :=
Expand Down Expand Up @@ -103,7 +107,7 @@ ifeq ($(USE_SYSTEM_LIBUV),0)
UV_HEADERS += uv.h
UV_HEADERS += uv/*.h
endif
PUBLIC_HEADERS := $(BUILDDIR)/julia_version.h $(wildcard $(SRCDIR)/support/*.h) $(addprefix $(SRCDIR)/,work-stealing-queue.h gc-interface.h gc-tls.h julia.h julia_assert.h julia_threads.h julia_fasttls.h julia_locks.h julia_atomics.h jloptions.h)
PUBLIC_HEADERS := $(BUILDDIR)/julia_version.h $(wildcard $(SRCDIR)/support/*.h) $(addprefix $(SRCDIR)/,work-stealing-queue.h gc-interface.h gc-tls.h gc-tls-common.h gc-tls-mmtk.h julia.h julia_assert.h julia_threads.h julia_fasttls.h julia_locks.h julia_atomics.h jloptions.h)
ifeq ($(OS),WINNT)
PUBLIC_HEADERS += $(addprefix $(SRCDIR)/,win32_ucontext.h)
endif
Expand Down Expand Up @@ -168,8 +172,8 @@ LIBJULIA_PATH_REL := libjulia
endif

COMMON_LIBPATHS := -L$(build_libdir) -L$(build_shlibdir)
RT_LIBS := $(WHOLE_ARCHIVE) $(LIBUV) $(WHOLE_ARCHIVE) $(LIBUTF8PROC) $(NO_WHOLE_ARCHIVE) $(LIBUNWIND) $(RT_LLVMLINK) $(OSLIBS) $(LIBTRACYCLIENT) $(LIBITTAPI)
CG_LIBS := $(LIBUNWIND) $(CG_LLVMLINK) $(OSLIBS) $(LIBTRACYCLIENT) $(LIBITTAPI)
RT_LIBS := $(WHOLE_ARCHIVE) $(LIBUV) $(WHOLE_ARCHIVE) $(LIBUTF8PROC) $(NO_WHOLE_ARCHIVE) $(LIBUNWIND) $(RT_LLVMLINK) $(OSLIBS) $(LIBTRACYCLIENT) $(LIBITTAPI) $(MMTK_LIB)
CG_LIBS := $(LIBUNWIND) $(CG_LLVMLINK) $(OSLIBS) $(LIBTRACYCLIENT) $(LIBITTAPI) $(MMTK_LIB)
RT_DEBUG_LIBS := $(COMMON_LIBPATHS) $(WHOLE_ARCHIVE) $(BUILDDIR)/flisp/libflisp-debug.a $(WHOLE_ARCHIVE) $(BUILDDIR)/support/libsupport-debug.a -ljulia-debug $(RT_LIBS)
CG_DEBUG_LIBS := $(COMMON_LIBPATHS) $(CG_LIBS) -ljulia-debug -ljulia-internal-debug
RT_RELEASE_LIBS := $(COMMON_LIBPATHS) $(WHOLE_ARCHIVE) $(BUILDDIR)/flisp/libflisp.a $(WHOLE_ARCHIVE) $(BUILDDIR)/support/libsupport.a -ljulia $(RT_LIBS)
Expand All @@ -178,6 +182,15 @@ CG_RELEASE_LIBS := $(COMMON_LIBPATHS) $(CG_LIBS) -ljulia -ljulia-internal
OBJS := $(SRCS:%=$(BUILDDIR)/%.o)
DOBJS := $(SRCS:%=$(BUILDDIR)/%.dbg.obj)

ifeq ($(WITH_MMTK), 1)
MMTK_SRCS := mmtk_julia
MMTK_OBJS := $(MMTK_SRCS:%=$(MMTK_JULIA_INC)/%.o) $(MMTK_LIB_DST)
MMTK_DOBJS := $(MMTK_SRCS:%=$(MMTK_JULIA_INC)/%.dbg.obj) $(MMTK_LIB_DST)
else
MMTK_OBJS :=
MMTK_DOBJS :=
endif

CODEGEN_OBJS := $(CODEGEN_SRCS:%=$(BUILDDIR)/%.o)
CODEGEN_DOBJS := $(CODEGEN_SRCS:%=$(BUILDDIR)/%.dbg.obj)

Expand Down Expand Up @@ -226,6 +239,16 @@ $(BUILDDIR)/%.h.gen : $(SRCDIR)/%.d
sed 's/JULIA_/JL_PROBE_/' $@ > $@.tmp
mv $@.tmp $@

# Compile files from the binding side and copy so file into lib folder
ifeq ($(WITH_MMTK), 1)
$(MMTK_JULIA_INC)/%.o: $(MMTK_JULIA_INC)/%.c $(HEADERS) | $(MMTK_JULIA_INC)
@$(call PRINT_CC, $(CC) $(JCPPFLAGS) $(JCFLAGS) $(SHIPFLAGS) $(DISABLE_ASSERTIONS) -c $< -o $@)
$(MMTK_JULIA_INC)/%.dbg.obj: $(MMTK_JULIA_INC)/%.c $(HEADERS) | $(MMTK_JULIA_INC)
@$(call PRINT_CC, $(CC) $(JCPPFLAGS) $(JCFLAGS) $(DEBUGFLAGS) -c $< -o $@)
$(MMTK_LIB_DST): $(MMTK_LIB_SRC)
@$(call PRINT_MMTK, cp $< $@)
endif

$(BUILDDIR)/jl_internal_funcs.inc: $(SRCDIR)/jl_exported_funcs.inc
# Generate `.inc` file that contains a list of `#define` macros to rename functions defined in `libjulia-internal`
# to have a `ijl_` prefix instead of `jl_`, to denote that they are coming from `libjulia-internal`. This avoids
Expand Down Expand Up @@ -318,6 +341,7 @@ $(BUILDDIR)/debuginfo.o $(BUILDDIR)/debuginfo.dbg.obj: $(addprefix $(SRCDIR)/,de
$(BUILDDIR)/disasm.o $(BUILDDIR)/disasm.dbg.obj: $(SRCDIR)/debuginfo.h $(SRCDIR)/processor.h
$(BUILDDIR)/gc-debug.o $(BUILDDIR)/gc-debug.dbg.obj: $(SRCDIR)/gc-common.h $(SRCDIR)/gc-stock.h
$(BUILDDIR)/gc-pages.o $(BUILDDIR)/gc-pages.dbg.obj: $(SRCDIR)/gc-common.h $(SRCDIR)/gc-stock.h
$(BUILDDIR)/gc-mmtk.o $(BUILDDIR)/gc-mmtk.dbg.obj: $(SRCDIR)/gc-common.h $(SRCDIR)/gc-heap-snapshot.h $(SRCDIR)/gc-alloc-profiler.h
$(BUILDDIR)/gc-stock.o $(BUILDDIR)/gc.dbg.obj: $(SRCDIR)/gc-common.h $(SRCDIR)/gc-stock.h $(SRCDIR)/gc-heap-snapshot.h $(SRCDIR)/gc-alloc-profiler.h $(SRCDIR)/gc-page-profiler.h
$(BUILDDIR)/gc-heap-snapshot.o $(BUILDDIR)/gc-heap-snapshot.dbg.obj: $(SRCDIR)/gc-heap-snapshot.h
$(BUILDDIR)/gc-alloc-profiler.o $(BUILDDIR)/gc-alloc-profiler.dbg.obj: $(SRCDIR)/gc-alloc-profiler.h
Expand Down Expand Up @@ -389,14 +413,14 @@ $(BUILDDIR)/julia.expmap: $(SRCDIR)/julia.expmap.in $(JULIAHOME)/VERSION $(LLVM_
sed <'$<' >'$@' -e "s/@JULIA_SHLIB_SYMBOL_VERSION@/JL_LIBJULIA_$(SOMAJOR)/" \
-e "s/@LLVM_SHLIB_SYMBOL_VERSION@/$(LLVM_SHLIB_SYMBOL_VERSION)/"

$(build_shlibdir)/libjulia-internal.$(JL_MAJOR_MINOR_SHLIB_EXT): $(BUILDDIR)/julia.expmap $(OBJS) $(BUILDDIR)/flisp/libflisp.a $(BUILDDIR)/support/libsupport.a $(LIBUV)
@$(call PRINT_LINK, $(CXXLD) $(call IMPLIB_FLAGS,$@) $(JCXXFLAGS) $(JL_CXXFLAGS) $(CXXLDFLAGS) $(SHIPFLAGS) $(OBJS) $(RPATH_LIB) -o $@ \
$(build_shlibdir)/libjulia-internal.$(JL_MAJOR_MINOR_SHLIB_EXT): $(BUILDDIR)/julia.expmap $(OBJS) $(MMTK_OBJS) $(BUILDDIR)/flisp/libflisp.a $(BUILDDIR)/support/libsupport.a $(LIBUV)
@$(call PRINT_LINK, $(CXXLD) $(call IMPLIB_FLAGS,$@) $(JCXXFLAGS) $(JL_CXXFLAGS) $(CXXLDFLAGS) $(SHIPFLAGS) $(OBJS) $(MMTK_OBJS) $(RPATH_LIB) -o $@ \
$(JLDFLAGS) $(BOLT_LDFLAGS) $(JLIBLDFLAGS) $(RT_RELEASE_LIBS) $(call SONAME_FLAGS,libjulia-internal.$(JL_MAJOR_SHLIB_EXT)))
@$(INSTALL_NAME_CMD)libjulia-internal.$(SHLIB_EXT) $@
$(DSYMUTIL) $@

$(build_shlibdir)/libjulia-internal-debug.$(JL_MAJOR_MINOR_SHLIB_EXT): $(BUILDDIR)/julia.expmap $(DOBJS) $(BUILDDIR)/flisp/libflisp-debug.a $(BUILDDIR)/support/libsupport-debug.a $(LIBUV)
@$(call PRINT_LINK, $(CXXLD) $(call IMPLIB_FLAGS,$@) $(JCXXFLAGS) $(JL_CXXFLAGS) $(CXXLDFLAGS) $(DEBUGFLAGS) $(DOBJS) $(RPATH_LIB) -o $@ \
$(build_shlibdir)/libjulia-internal-debug.$(JL_MAJOR_MINOR_SHLIB_EXT): $(BUILDDIR)/julia.expmap $(DOBJS) $(MMTK_DOBJS) $(BUILDDIR)/flisp/libflisp-debug.a $(BUILDDIR)/support/libsupport-debug.a $(LIBUV)
@$(call PRINT_LINK, $(CXXLD) $(call IMPLIB_FLAGS,$@) $(JCXXFLAGS) $(JL_CXXFLAGS) $(CXXLDFLAGS) $(DEBUGFLAGS) $(DOBJS) $(MMTK_DOBJS) $(RPATH_LIB) -o $@ \
$(JLDFLAGS) $(JLIBLDFLAGS) $(RT_DEBUG_LIBS) $(call SONAME_FLAGS,libjulia-internal-debug.$(JL_MAJOR_SHLIB_EXT)))
@$(INSTALL_NAME_CMD)libjulia-internal-debug.$(SHLIB_EXT) $@
$(DSYMUTIL) $@
Expand Down Expand Up @@ -455,6 +479,7 @@ clean:
-rm -f $(BUILDDIR)/*.dbg.obj $(BUILDDIR)/*.o $(BUILDDIR)/*.dwo $(BUILDDIR)/*.$(SHLIB_EXT) $(BUILDDIR)/*.a $(BUILDDIR)/*.h.gen
-rm -f $(BUILDDIR)/julia.expmap
-rm -f $(BUILDDIR)/julia_version.h
-rm -f $(MMTK_OBJS) $(MMTK_DOBJS)

clean-flisp:
-$(MAKE) -C $(SRCDIR)/flisp clean BUILDDIR='$(abspath $(BUILDDIR)/flisp)'
Expand Down
11 changes: 11 additions & 0 deletions src/builtins.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,9 @@ static uintptr_t type_object_id_(jl_value_t *v, jl_varidx_t *env) JL_NOTSAFEPOIN
i++;
pe = pe->prev;
}
// FIXME: Pinning objects that get hashed
// until we implement address space hashing.
PTR_PIN(v);
uintptr_t bits = jl_astaggedvalue(v)->header;
if (bits & GC_IN_IMAGE)
return ((uintptr_t*)v)[-2];
Expand Down Expand Up @@ -400,6 +403,10 @@ static uintptr_t immut_id_(jl_datatype_t *dt, jl_value_t *v, uintptr_t h) JL_NOT
// a few select pointers (notably symbol) also have special hash values
// which may affect the stability of the objectid hash, even though
// they don't affect egal comparison

// FIXME: Pinning objects that get hashed
// until we implement address space hashing.
PTR_PIN(v);
return bits_hash(v, sz) ^ h;
}
if (dt == jl_unionall_type)
Expand Down Expand Up @@ -460,6 +467,10 @@ static uintptr_t NOINLINE jl_object_id__cold(uintptr_t tv, jl_value_t *v) JL_NOT
uintptr_t bits = jl_astaggedvalue(v)->header;
if (bits & GC_IN_IMAGE)
return ((uintptr_t*)v)[-2];

// FIXME: Pinning objects that get hashed
// until we implement address space hashing.
PTR_PIN(v);
return inthash((uintptr_t)v);
}
return immut_id_(dt, v, dt->hash);
Expand Down
6 changes: 6 additions & 0 deletions src/datatype.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ JL_DLLEXPORT jl_typename_t *jl_new_typename_in(jl_sym_t *name, jl_module_t *modu
jl_typename_t *tn =
(jl_typename_t*)jl_gc_alloc(ct->ptls, sizeof(jl_typename_t),
jl_typename_type);
// Typenames should be pinned since they are used as metadata, and are
// read during scan_object
PTR_PIN(tn);
tn->name = name;
tn->module = module;
tn->wrapper = NULL;
Expand Down Expand Up @@ -96,6 +99,9 @@ jl_datatype_t *jl_new_uninitialized_datatype(void)
{
jl_task_t *ct = jl_current_task;
jl_datatype_t *t = (jl_datatype_t*)jl_gc_alloc(ct->ptls, sizeof(jl_datatype_t), jl_datatype_type);
// Types should be pinned since they are used as metadata, and are
// read during scan_object
PTR_PIN(t);
jl_set_typetagof(t, jl_datatype_tag, 0);
t->hash = 0;
t->hasfreetypevars = 0;
Expand Down
Loading
Loading