Skip to content

Commit

Permalink
Split jl_gcinfo_t
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyichao committed Jun 4, 2015
1 parent 7e3476e commit 18833c6
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 110 deletions.
4 changes: 2 additions & 2 deletions src/ccall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ static Value *emit_ccall(jl_value_t **args, size_t nargs, jl_codectx_t *ctx)
}

// save argument depth until after we're done emitting arguments
int last_depth = ctx->argDepth;
int last_depth = ctx->gc.argDepth;

// number of parameters to the c function
bool needStackRestore = false;
Expand Down Expand Up @@ -1322,7 +1322,7 @@ static Value *emit_ccall(jl_value_t **args, size_t nargs, jl_codectx_t *ctx)
Intrinsic::stackrestore),
stacksave);
}
ctx->argDepth = last_depth;
ctx->gc.argDepth = last_depth;
if (0) { // Enable this to turn on SSPREQ (-fstack-protector) on the function containing this ccall
ctx->f->addFnAttr(Attribute::StackProtectReq);
}
Expand Down
6 changes: 3 additions & 3 deletions src/cgutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1876,7 +1876,7 @@ static Value *emit_new_struct(jl_value_t *ty, size_t nargs, jl_value_t **args, j
return mark_julia_type(strct,ty);
}
Value *f1 = NULL;
int fieldStart = ctx->argDepth;
int fieldStart = ctx->gc.argDepth;
bool needroots = false;
for (size_t i = 1;i < nargs;i++) {
if (might_need_root(args[i])) {
Expand All @@ -1903,7 +1903,7 @@ static Value *emit_new_struct(jl_value_t *ty, size_t nargs, jl_value_t **args, j
if (!jl_subtype(expr_type(args[1],ctx), jl_field_type(sty,0), 0))
emit_typecheck(f1, jl_field_type(sty,0), "new", ctx);
emit_setfield(sty, strct, 0, f1, ctx, false, false);
ctx->argDepth = fieldStart;
ctx->gc.argDepth = fieldStart;
if (nf > 1 && needroots)
make_gcroot(strct, ctx);
}
Expand Down Expand Up @@ -1935,7 +1935,7 @@ static Value *emit_new_struct(jl_value_t *ty, size_t nargs, jl_value_t **args, j
need_wb = true;
emit_setfield(sty, strct, i-1, rhs, ctx, false, need_wb);
}
ctx->argDepth = fieldStart;
ctx->gc.argDepth = fieldStart;
return strct;
}
else {
Expand Down
Loading

0 comments on commit 18833c6

Please sign in to comment.