Skip to content

Commit 4650b7c

Browse files
committed
[Codegen] Skip wb emission when they are no children objects
1 parent 1810952 commit 4650b7c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/cgutils.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3104,6 +3104,9 @@ static void emit_write_barrier(jl_codectx_t &ctx, Value *parent, Value *ptr)
31043104

31053105
static void emit_write_barrier(jl_codectx_t &ctx, Value *parent, ArrayRef<Value*> ptrs)
31063106
{
3107+
// if there are no child objects we can skip emission
3108+
if (ptrs.empty())
3109+
return;
31073110
SmallVector<Value*, 8> decay_ptrs;
31083111
decay_ptrs.push_back(maybe_decay_untracked(ctx, emit_bitcast(ctx, parent, T_prjlvalue)));
31093112
for (auto ptr : ptrs) {

0 commit comments

Comments
 (0)