Skip to content

Commit

Permalink
codegen: avoid attempting to box singleton objects unnecessarily (#41658
Browse files Browse the repository at this point in the history
)

Fixes #41615

(cherry picked from commit b692c9b)
  • Loading branch information
vtjnash authored and KristofferC committed Jul 26, 2021
1 parent 9902836 commit 95c8bb7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -946,11 +946,13 @@ static bool jl_is_pointerfree(jl_value_t* t)

// these queries are usually related, but we split them out here
// for convenience and clarity (and because it changes the calling convention)
// n.b. this must include jl_is_datatype_singleton (ghostType) and primitive types
static bool deserves_stack(jl_value_t* t)
{
if (!jl_is_concrete_immutable(t))
return false;
return jl_datatype_isinlinealloc((jl_datatype_t*)t, 0);
jl_datatype_t *dt = (jl_datatype_t*)t;
return jl_is_datatype_singleton(dt) || jl_datatype_isinlinealloc(dt, 0);
}
static bool deserves_argbox(jl_value_t* t)
{
Expand Down

0 comments on commit 95c8bb7

Please sign in to comment.