@@ -683,8 +683,7 @@ static Value *emit_typeptr_addr(jl_codectx_t &ctx, Value *p)
683
683
return emit_nthptr_addr (ctx, p, -offset);
684
684
}
685
685
686
- static Value *boxed (jl_codectx_t &ctx, const jl_cgval_t &v, bool gcooted=true );
687
- static Value *boxed (jl_codectx_t &ctx, const jl_cgval_t &v, jl_value_t * type) = delete; // C++11 (temporary to prevent rebase error)
686
+ static Value *boxed (jl_codectx_t &ctx, const jl_cgval_t &v);
688
687
689
688
static Value* mask_gc_bits (jl_codectx_t &ctx, Value *tag)
690
689
{
@@ -713,7 +712,7 @@ static jl_cgval_t emit_typeof(jl_codectx_t &ctx, const jl_cgval_t &p)
713
712
if (p.constant )
714
713
return mark_julia_const (jl_typeof (p.constant ));
715
714
if (p.isboxed && !jl_is_leaf_type (p.typ )) {
716
- return mark_julia_type (ctx, emit_typeof (ctx, p.V ), true , jl_datatype_type, /* needsroot */ false );
715
+ return mark_julia_type (ctx, emit_typeof (ctx, p.V ), true , jl_datatype_type);
717
716
}
718
717
if (p.TIndex ) {
719
718
Value *tindex = ctx.builder .CreateAnd (p.TIndex , ConstantInt::get (T_int8, 0x7f ));
@@ -746,7 +745,7 @@ static jl_cgval_t emit_typeof(jl_codectx_t &ctx, const jl_cgval_t &p)
746
745
if (!allunboxed)
747
746
datatype = mask_gc_bits (ctx, datatype);
748
747
datatype = maybe_decay_untracked (datatype);
749
- return mark_julia_type (ctx, datatype, true , jl_datatype_type, /* needsroot */ false );
748
+ return mark_julia_type (ctx, datatype, true , jl_datatype_type);
750
749
}
751
750
jl_value_t *aty = p.typ ;
752
751
if (jl_is_type_type (aty)) {
@@ -986,7 +985,7 @@ static void emit_type_error(jl_codectx_t &ctx, const jl_cgval_t &x, Value *type,
986
985
Value *msg_val = stringConstPtr (ctx.builder , msg);
987
986
ctx.builder .CreateCall (prepare_call (jltypeerror_func),
988
987
{ fname_val, msg_val,
989
- maybe_decay_untracked (type), mark_callee_rooted (boxed (ctx, x, false ))});
988
+ maybe_decay_untracked (type), mark_callee_rooted (boxed (ctx, x))});
990
989
}
991
990
992
991
static std::pair<Value*, bool > emit_isa (jl_codectx_t &ctx, const jl_cgval_t &x, jl_value_t *type, const std::string *msg)
@@ -1080,7 +1079,7 @@ static void emit_typecheck(jl_codectx_t &ctx, const jl_cgval_t &x, jl_value_t *t
1080
1079
static void emit_leafcheck (jl_codectx_t &ctx, Value *typ, const std::string &msg)
1081
1080
{
1082
1081
assert (typ->getType () == T_prjlvalue);
1083
- emit_typecheck (ctx, mark_julia_type (ctx, typ, true , jl_any_type, false ), (jl_value_t *)jl_datatype_type, msg);
1082
+ emit_typecheck (ctx, mark_julia_type (ctx, typ, true , jl_any_type), (jl_value_t *)jl_datatype_type, msg);
1084
1083
Value *isleaf;
1085
1084
isleaf = ctx.builder .CreateConstInBoundsGEP1_32 (T_int8, emit_bitcast (ctx, decay_derived (typ), T_pint8), offsetof (jl_datatype_t , isleaftype));
1086
1085
isleaf = ctx.builder .CreateLoad (isleaf, tbaa_const);
@@ -1205,7 +1204,7 @@ static void typed_store(jl_codectx_t &ctx,
1205
1204
Value *ptr, Value *idx_0based, const jl_cgval_t &rhs,
1206
1205
jl_value_t *jltype, MDNode *tbaa,
1207
1206
Value *parent, // for the write barrier, NULL if no barrier needed
1208
- unsigned alignment = 0 , bool root_box = true ) // if the value to store needs a box, should we root it ?
1207
+ unsigned alignment = 0 )
1209
1208
{
1210
1209
bool isboxed;
1211
1210
Type *elty = julia_type_to_llvm (jltype, &isboxed);
@@ -1216,7 +1215,7 @@ static void typed_store(jl_codectx_t &ctx,
1216
1215
r = emit_unbox (ctx, elty, rhs, jltype);
1217
1216
}
1218
1217
else {
1219
- r = maybe_decay_untracked (boxed (ctx, rhs, root_box ));
1218
+ r = maybe_decay_untracked (boxed (ctx, rhs));
1220
1219
if (parent != NULL )
1221
1220
emit_write_barrier (ctx, parent, r);
1222
1221
}
@@ -1287,7 +1286,7 @@ static bool emit_getfield_unknownidx(jl_codectx_t &ctx,
1287
1286
maybe_null, minimum_field_size));
1288
1287
if (maybe_null)
1289
1288
null_pointer_check (ctx, fld);
1290
- *ret = mark_julia_type (ctx, fld, true , jl_any_type, strct. gcroot || !strct. isimmutable );
1289
+ *ret = mark_julia_type (ctx, fld, true , jl_any_type);
1291
1290
return true ;
1292
1291
}
1293
1292
else if (is_tupletype_homogeneous (stt->types )) {
@@ -1389,7 +1388,7 @@ static jl_cgval_t emit_getfield_knownidx(jl_codectx_t &ctx, const jl_cgval_t &st
1389
1388
Value *fldv = tbaa_decorate (strct.tbaa , Load);
1390
1389
if (maybe_null)
1391
1390
null_pointer_check (ctx, fldv);
1392
- return mark_julia_type (ctx, fldv, true , jfty, strct. gcroot || !strct. isimmutable );
1391
+ return mark_julia_type (ctx, fldv, true , jfty);
1393
1392
}
1394
1393
else if (jl_is_uniontype (jfty)) {
1395
1394
int fsz = jl_field_size (jt, idx);
@@ -1982,7 +1981,7 @@ static Value *box_union(jl_codectx_t &ctx, const jl_cgval_t &vinfo, const SmallB
1982
1981
// this is used to wrap values for generic contexts, where a
1983
1982
// dynamically-typed value is required (e.g. argument to unknown function).
1984
1983
// if it's already a pointer it's left alone.
1985
- static Value *boxed (jl_codectx_t &ctx, const jl_cgval_t &vinfo, bool gcrooted )
1984
+ static Value *boxed (jl_codectx_t &ctx, const jl_cgval_t &vinfo)
1986
1985
{
1987
1986
jl_value_t *jt = vinfo.typ ;
1988
1987
if (jt == jl_bottom_type || jt == NULL )
@@ -2016,12 +2015,6 @@ static Value *boxed(jl_codectx_t &ctx, const jl_cgval_t &vinfo, bool gcrooted)
2016
2015
box = maybe_decay_untracked (box);
2017
2016
}
2018
2017
}
2019
- if (gcrooted) {
2020
- // make a gcroot for the new box
2021
- // (unless the caller explicitly said this was unnecessary)
2022
- Value *froot = emit_local_root (ctx);
2023
- ctx.builder .CreateStore (box, froot);
2024
- }
2025
2018
return box;
2026
2019
}
2027
2020
@@ -2103,7 +2096,7 @@ static void emit_unionmove(jl_codectx_t &ctx, Value *dest, const jl_cgval_t &src
2103
2096
static void emit_cpointercheck (jl_codectx_t &ctx, const jl_cgval_t &x, const std::string &msg)
2104
2097
{
2105
2098
Value *t = emit_typeof_boxed (ctx, x);
2106
- emit_typecheck (ctx, mark_julia_type (ctx, t, true , jl_any_type, false ), (jl_value_t *)jl_datatype_type, msg);
2099
+ emit_typecheck (ctx, mark_julia_type (ctx, t, true , jl_any_type), (jl_value_t *)jl_datatype_type, msg);
2107
2100
2108
2101
Value *istype =
2109
2102
ctx.builder .CreateICmpEQ (mark_callee_rooted (emit_datatype_name (ctx, t)),
@@ -2185,7 +2178,7 @@ static void emit_setfield(jl_codectx_t &ctx,
2185
2178
ConstantInt::get (T_size, jl_field_offset (sty, idx0)));
2186
2179
jl_value_t *jfty = jl_svecref (sty->types , idx0);
2187
2180
if (jl_field_isptr (sty, idx0)) {
2188
- Value *r = maybe_decay_untracked (boxed (ctx, rhs, false )); // don't need a temporary gcroot since it'll be rooted by strct
2181
+ Value *r = maybe_decay_untracked (boxed (ctx, rhs)); // don't need a temporary gcroot since it'll be rooted by strct
2189
2182
tbaa_decorate (strct.tbaa , ctx.builder .CreateStore (r,
2190
2183
emit_bitcast (ctx, addr, T_pprjlvalue)));
2191
2184
if (wb && strct.isboxed )
0 commit comments