Skip to content

Commit

Permalink
add IR encoding for EnterNode (#53482)
Browse files Browse the repository at this point in the history
fixes #53248
  • Loading branch information
JeffBezanson authored Feb 27, 2024
1 parent 35cb8a5 commit b3b2736
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/ircode.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,11 @@ static void jl_encode_value_(jl_ircode_state *s, jl_value_t *v, int as_literal)
jl_encode_value(s, jl_get_nth_field(v, 0));
jl_encode_value(s, jl_get_nth_field(v, 1));
}
else if (jl_is_enternode(v)) {
write_uint8(s->s, TAG_ENTERNODE);
jl_encode_value(s, jl_get_nth_field(v, 0));
jl_encode_value(s, jl_get_nth_field(v, 1));
}
else if (jl_is_argument(v)) {
write_uint8(s->s, TAG_ARGUMENT);
jl_encode_value(s, jl_get_nth_field(v, 0));
Expand Down Expand Up @@ -721,6 +726,11 @@ static jl_value_t *jl_decode_value(jl_ircode_state *s) JL_GC_DISABLED
set_nth_field(jl_gotoifnot_type, v, 0, jl_decode_value(s), 0);
set_nth_field(jl_gotoifnot_type, v, 1, jl_decode_value(s), 0);
return v;
case TAG_ENTERNODE:
v = jl_new_struct_uninit(jl_enternode_type);
set_nth_field(jl_enternode_type, v, 0, jl_decode_value(s), 0);
set_nth_field(jl_enternode_type, v, 1, jl_decode_value(s), 0);
return v;
case TAG_ARGUMENT:
v = jl_new_struct_uninit(jl_argument_type);
set_nth_field(jl_argument_type, v, 0, jl_decode_value(s), 0);
Expand Down
3 changes: 2 additions & 1 deletion src/serialize.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ extern "C" {
#define TAG_RELOC_METHODROOT 57
#define TAG_BINDING 58
#define TAG_MEMORYT 59
#define TAG_ENTERNODE 60

#define LAST_TAG 59
#define LAST_TAG 60

#define write_uint8(s, n) ios_putc((n), (s))
#define read_uint8(s) ((uint8_t)ios_getc((s)))
Expand Down

0 comments on commit b3b2736

Please sign in to comment.