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

sysimg: reduce the number of special cases (essentially NFC) #31948

Merged
merged 1 commit into from
May 9, 2019

Conversation

vtjnash
Copy link
Sponsor Member

@vtjnash vtjnash commented May 7, 2019

Put the entire image(*) into our pre-constructed data image,
instead of attempting to leave out a couple of items.
This saves us a couple lines of code, and should makes it
simpler to keep the list of builtin objects (gc.c "tags") up-to-date.

(*) The remaining special objects are ptls->root_task,
since I was unsure the best way to handle it as no other Task
object is allowed to be referenced, and the small integer caches.

@vtjnash vtjnash force-pushed the jn/simple_serialize branch 2 times, most recently from bffbe40 to cca9892 Compare May 7, 2019 19:40
src/datatype.c Outdated
@@ -624,7 +624,7 @@ void jl_assign_bits(void *dest, jl_value_t *bits)
#define PERMBOXN_FUNC(nb,nw) \
jl_value_t *jl_permbox##nb(jl_datatype_t *t, int##nb##_t x) \
{ \
assert(jl_isbits(t)); \
/*assert(jl_isbits(t));*/ \
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Maybe just remove this?

&jl_builtin_apply_type, &jl_builtin_applicable, &jl_builtin_invoke,
&jl_builtin__expr, &jl_builtin_ifelse,
NULL };
static jl_value_t **const*const tags = (jl_value_t**const*const)_tags;
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

A classic C type declaration 😂

src/staticdata.c Outdated
for (i = 0; i < builtin_typenames.len; i++) {
jl_write_value(&s, ((jl_typename_t*)builtin_typenames.items[i])->cache);
jl_write_value(&s, ((jl_typename_t*)builtin_typenames.items[i])->linearcache);
// save module initialization order
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Remove this comment?

src/staticdata.c Outdated
@@ -1098,100 +1191,52 @@ static void jl_finalize_serializer(jl_serializer_state *s)


void jl_typemap_rehash(jl_typemap_t *ml, int8_t offs);
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Can be removed.

assert(jl_is_mtable(mt));
jl_typemap_rehash(mt->defs, 0);
// TODO: consider reverting this when we can split on Type{...} better
jl_typemap_rehash(mt->cache, 1); //(mt == jl_type_typename->mt) ? 0 : 1);
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Interesting. Why were we doing this before?

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

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

Probably got moved over from dump.c when this file split off, but this didn't get used.

Put the entire image(*) into our pre-constructed data image,
instead of attempting to leave out a couple of items.
This saves us a couple lines of code, and should makes it
simpler to keep the list of builtin objects (gc.c "tags") up-to-date.

(*) The remaining special objects are ptls->root_task,
since I was unsure the best way to handle it as no other Task
object is allowed to be referenced, and the small integer caches.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants