Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add IR encoding for EnterNode #53482

Merged
merged 1 commit into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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