Skip to content

Commit ed999a6

Browse files
JeffBezansonudesou
authored andcommitted
edit NEWS for v1.12 (#57262)
1 parent 6ac507c commit ed999a6

File tree

4 files changed

+91
-33
lines changed

4 files changed

+91
-33
lines changed

src/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ UV_HEADERS += uv/*.h
123123
endif
124124
PUBLIC_HEADERS := $(BUILDDIR)/julia_version.h $(wildcard $(SRCDIR)/support/*.h) $(addprefix $(SRCDIR)/,work-stealing-queue.h gc-interface.h gc-tls-common.h julia.h julia_assert.h julia_threads.h julia_fasttls.h julia_locks.h julia_atomics.h jloptions.h)
125125
ifneq (${MMTK_PLAN},None)
126-
PUBLIC_HEADERS += $(addprefix $(SRCDIR)/,gc-tls-mmtk.h)
126+
PUBLIC_HEADERS += $(addprefix $(SRCDIR)/,gc-tls-mmtk.h gc-wb-mmtk.h)
127127
else
128-
PUBLIC_HEADERS += $(addprefix $(SRCDIR)/,gc-tls-stock.h)
128+
PUBLIC_HEADERS += $(addprefix $(SRCDIR)/,gc-tls-stock.h gc-wb-stock.h)
129129
endif
130130
ifeq ($(OS),WINNT)
131131
PUBLIC_HEADERS += $(addprefix $(SRCDIR)/,win32_ucontext.h)

src/gc-wb-mmtk.h

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// This file is a part of Julia. License is MIT: https://julialang.org/license
2+
3+
/*
4+
write barriers which should be inlined by the compiler
5+
*/
6+
7+
#ifndef JL_GC_WB_H
8+
#define JL_GC_WB_H
9+
10+
#ifdef __cplusplus
11+
extern "C" {
12+
#endif
13+
14+
// GC write barriers
15+
16+
// TODO: implement these functions for MMTk
17+
STATIC_INLINE void jl_gc_wb(const void *parent, const void *ptr) JL_NOTSAFEPOINT
18+
{
19+
}
20+
21+
STATIC_INLINE void jl_gc_wb_back(const void *ptr) JL_NOTSAFEPOINT // ptr isa jl_value_t*
22+
{
23+
}
24+
25+
STATIC_INLINE void jl_gc_multi_wb(const void *parent, const jl_value_t *ptr) JL_NOTSAFEPOINT
26+
{
27+
}
28+
29+
30+
#ifdef __cplusplus
31+
}
32+
#endif
33+
34+
#endif

src/gc-wb-stock.h

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// This file is a part of Julia. License is MIT: https://julialang.org/license
2+
3+
/*
4+
write barriers which should be inlined by the compiler
5+
*/
6+
7+
#ifndef JL_GC_WB_H
8+
#define JL_GC_WB_H
9+
10+
#ifdef __cplusplus
11+
extern "C" {
12+
#endif
13+
14+
// GC write barriers
15+
16+
STATIC_INLINE void jl_gc_wb(const void *parent, const void *ptr) JL_NOTSAFEPOINT
17+
{
18+
// parent and ptr isa jl_value_t*
19+
if (__unlikely(jl_astaggedvalue(parent)->bits.gc == 3 /* GC_OLD_MARKED */ && // parent is old and not in remset
20+
(jl_astaggedvalue(ptr)->bits.gc & 1 /* GC_MARKED */) == 0)) // ptr is young
21+
jl_gc_queue_root((jl_value_t*)parent);
22+
}
23+
24+
STATIC_INLINE void jl_gc_wb_back(const void *ptr) JL_NOTSAFEPOINT // ptr isa jl_value_t*
25+
{
26+
// if ptr is old
27+
if (__unlikely(jl_astaggedvalue(ptr)->bits.gc == 3 /* GC_OLD_MARKED */)) {
28+
jl_gc_queue_root((jl_value_t*)ptr);
29+
}
30+
}
31+
32+
STATIC_INLINE void jl_gc_multi_wb(const void *parent, const jl_value_t *ptr) JL_NOTSAFEPOINT
33+
{
34+
// 3 == GC_OLD_MARKED
35+
// ptr is an immutable object
36+
if (__likely(jl_astaggedvalue(parent)->bits.gc != 3))
37+
return; // parent is young or in remset
38+
if (__likely(jl_astaggedvalue(ptr)->bits.gc == 3))
39+
return; // ptr is old and not in remset (thus it does not point to young)
40+
jl_datatype_t *dt = (jl_datatype_t*)jl_typeof(ptr);
41+
const jl_datatype_layout_t *ly = dt->layout;
42+
if (ly->npointers)
43+
jl_gc_queue_multiroot((jl_value_t*)parent, ptr, dt);
44+
}
45+
46+
#ifdef __cplusplus
47+
}
48+
#endif
49+
50+
#endif

src/julia.h

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,37 +1137,11 @@ JL_DLLEXPORT void jl_free_stack(void *stkbuf, size_t bufsz);
11371137
// thread-local allocator of the current thread.
11381138
JL_DLLEXPORT jl_weakref_t *jl_gc_new_weakref(jl_value_t *value);
11391139

1140-
// GC write barriers
1141-
1142-
STATIC_INLINE void jl_gc_wb(const void *parent, const void *ptr) JL_NOTSAFEPOINT
1143-
{
1144-
// parent and ptr isa jl_value_t*
1145-
if (__unlikely(jl_astaggedvalue(parent)->bits.gc == 3 /* GC_OLD_MARKED */ && // parent is old and not in remset
1146-
(jl_astaggedvalue(ptr)->bits.gc & 1 /* GC_MARKED */) == 0)) // ptr is young
1147-
jl_gc_queue_root((jl_value_t*)parent);
1148-
}
1149-
1150-
STATIC_INLINE void jl_gc_wb_back(const void *ptr) JL_NOTSAFEPOINT // ptr isa jl_value_t*
1151-
{
1152-
// if ptr is old
1153-
if (__unlikely(jl_astaggedvalue(ptr)->bits.gc == 3 /* GC_OLD_MARKED */)) {
1154-
jl_gc_queue_root((jl_value_t*)ptr);
1155-
}
1156-
}
1157-
1158-
STATIC_INLINE void jl_gc_multi_wb(const void *parent, const jl_value_t *ptr) JL_NOTSAFEPOINT
1159-
{
1160-
// 3 == GC_OLD_MARKED
1161-
// ptr is an immutable object
1162-
if (__likely(jl_astaggedvalue(parent)->bits.gc != 3))
1163-
return; // parent is young or in remset
1164-
if (__likely(jl_astaggedvalue(ptr)->bits.gc == 3))
1165-
return; // ptr is old and not in remset (thus it does not point to young)
1166-
jl_datatype_t *dt = (jl_datatype_t*)jl_typeof(ptr);
1167-
const jl_datatype_layout_t *ly = dt->layout;
1168-
if (ly->npointers)
1169-
jl_gc_queue_multiroot((jl_value_t*)parent, ptr, dt);
1170-
}
1140+
#ifndef MMTK_GC
1141+
#include "gc-wb-stock.h"
1142+
#else
1143+
#include "gc-wb-mmtk.h"
1144+
#endif
11711145

11721146
JL_DLLEXPORT void jl_gc_safepoint(void);
11731147
JL_DLLEXPORT int jl_safepoint_suspend_thread(int tid, int waitstate);

0 commit comments

Comments
 (0)