Skip to content

Commit

Permalink
Cannot make num_dynamic_dispatches a "hidden" field
Browse files Browse the repository at this point in the history
Unsure why but it doesn't really matter.
  • Loading branch information
kpamnany committed Nov 16, 2023
1 parent fd3cc3a commit 10351ad
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
10 changes: 6 additions & 4 deletions src/jltypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -2600,7 +2600,7 @@ void jl_init_types(void) JL_GC_DISABLED
jl_method_type =
jl_new_datatype(jl_symbol("Method"), core,
jl_any_type, jl_emptysvec,
jl_perm_symsvec(29,
jl_perm_symsvec(30,
"name",
"module",
"file",
Expand Down Expand Up @@ -2629,8 +2629,9 @@ void jl_init_types(void) JL_GC_DISABLED
"pure",
"is_for_opaque_closure",
"constprop",
"purity"),
jl_svec(29,
"purity",
"num_dynamic_dispatches"),
jl_svec(30,
jl_symbol_type,
jl_module_type,
jl_symbol_type,
Expand Down Expand Up @@ -2659,7 +2660,8 @@ void jl_init_types(void) JL_GC_DISABLED
jl_bool_type,
jl_bool_type,
jl_uint8_type,
jl_uint8_type),
jl_uint8_type,
jl_int32_type),
jl_emptysvec,
0, 1, 10);
//const static uint32_t method_constfields[1] = { 0x03fc065f }; // (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<6)|(1<<9)|(1<<10)|(1<<18)|(1<<19)|(1<<20)|(1<<21)|(1<<22)|(1<<23)|(1<<24)|(1<<25);
Expand Down
7 changes: 4 additions & 3 deletions src/julia.h
Original file line number Diff line number Diff line change
Expand Up @@ -349,12 +349,13 @@ typedef struct _jl_method_t {
// forcing the conclusion to always true.
_jl_purity_overrides_t purity;

// hidden fields:
// lock for modifications to the method
jl_mutex_t writelock;
#ifdef JL_DISPATCH_LOG_BOXES
uint32_t num_dynamic_dispatches;
#endif

// hidden fields:
// lock for modifications to the method
jl_mutex_t writelock;
} jl_method_t;

// This type is a placeholder to cache data for a specType signature specialization of a Method
Expand Down
2 changes: 1 addition & 1 deletion src/method.c
Original file line number Diff line number Diff line change
Expand Up @@ -805,10 +805,10 @@ JL_DLLEXPORT jl_method_t *jl_new_method_uninit(jl_module_t *module)
m->deleted_world = ~(size_t)0;
m->is_for_opaque_closure = 0;
m->constprop = 0;
JL_MUTEX_INIT(&m->writelock);
#ifdef JL_DISPATCH_LOG_BOXES
m->num_dynamic_dispatches = 0;
#endif
JL_MUTEX_INIT(&m->writelock);
return m;
}

Expand Down

0 comments on commit 10351ad

Please sign in to comment.