Skip to content

Commit

Permalink
Extend method root to support more than 16bit roots (#48185)
Browse files Browse the repository at this point in the history
  • Loading branch information
vchuravy authored Jan 9, 2023
1 parent 708d1bd commit 53a0a69
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/ircode.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,14 @@ static void jl_encode_as_indexed_root(jl_ircode_state *s, jl_value_t *v)
write_uint8(s->s, TAG_RELOC_METHODROOT);
write_uint64(s->s, rr.key);
}
if (id < 256) {
if (id <= UINT8_MAX) {
write_uint8(s->s, TAG_METHODROOT);
write_uint8(s->s, id);
}
else {
assert(id <= UINT16_MAX);
assert(id <= UINT32_MAX);
write_uint8(s->s, TAG_LONG_METHODROOT);
write_uint16(s->s, id);
write_uint32(s->s, id);
}
}

Expand Down Expand Up @@ -646,11 +646,17 @@ static jl_value_t *jl_decode_value(jl_ircode_state *s) JL_GC_DISABLED
key = read_uint64(s->s);
tag = read_uint8(s->s);
assert(tag == TAG_METHODROOT || tag == TAG_LONG_METHODROOT);
return lookup_root(s->method, key, tag == TAG_METHODROOT ? read_uint8(s->s) : read_uint16(s->s));
int index = -1;
if (tag == TAG_METHODROOT)
index = read_uint8(s->s);
else if (tag == TAG_LONG_METHODROOT)
index = read_uint32(s->s);
assert(index >= 0);
return lookup_root(s->method, key, index);
case TAG_METHODROOT:
return lookup_root(s->method, 0, read_uint8(s->s));
case TAG_LONG_METHODROOT:
return lookup_root(s->method, 0, read_uint16(s->s));
return lookup_root(s->method, 0, read_uint32(s->s));
case TAG_SVEC: JL_FALLTHROUGH; case TAG_LONG_SVEC:
return jl_decode_value_svec(s, tag);
case TAG_COMMONSYM:
Expand Down

2 comments on commit 53a0a69

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily package evaluation, I will reply here when finished:

@nanosoldier runtests(isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your package evaluation job has completed - possible new issues were detected.
A full report can be found here.

Please sign in to comment.