File tree Expand file tree Collapse file tree 4 files changed +12
-2
lines changed Expand file tree Collapse file tree 4 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -1195,6 +1195,8 @@ static jl_method_instance_t *cache_method(
1195
1195
}
1196
1196
// TODO: maybe assert(jl_isa_compileable_sig(compilationsig, sparams, definition));
1197
1197
newmeth = jl_specializations_get_linfo (definition , (jl_value_t * )compilationsig , sparams );
1198
+ if (newmeth -> cache_with_orig )
1199
+ cache_with_orig = 1 ;
1198
1200
1199
1201
jl_tupletype_t * cachett = tt ;
1200
1202
jl_svec_t * guardsigs = jl_emptysvec ;
@@ -1261,6 +1263,10 @@ static jl_method_instance_t *cache_method(
1261
1263
max_valid = max_valid2 ;
1262
1264
cachett = compilationsig ;
1263
1265
}
1266
+ else {
1267
+ // do not revisit this decision
1268
+ newmeth -> cache_with_orig = 1 ;
1269
+ }
1264
1270
}
1265
1271
1266
1272
// now scan `cachett` and ensure that `Type{T}` in the cache will be matched exactly by `typeof(T)`
Original file line number Diff line number Diff line change @@ -2531,7 +2531,7 @@ void jl_init_types(void) JL_GC_DISABLED
2531
2531
jl_method_instance_type =
2532
2532
jl_new_datatype (jl_symbol ("MethodInstance" ), core ,
2533
2533
jl_any_type , jl_emptysvec ,
2534
- jl_perm_symsvec (9 ,
2534
+ jl_perm_symsvec (10 ,
2535
2535
"def" ,
2536
2536
"specTypes" ,
2537
2537
"sparam_vals" ,
@@ -2540,8 +2540,9 @@ void jl_init_types(void) JL_GC_DISABLED
2540
2540
"callbacks" ,
2541
2541
"cache" ,
2542
2542
"inInference" ,
2543
+ "cache_with_orig" ,
2543
2544
"precompiled" ),
2544
- jl_svec (9 ,
2545
+ jl_svec (10 ,
2545
2546
jl_new_struct (jl_uniontype_type , jl_method_type , jl_module_type ),
2546
2547
jl_any_type ,
2547
2548
jl_simplevector_type ,
@@ -2550,6 +2551,7 @@ void jl_init_types(void) JL_GC_DISABLED
2550
2551
jl_any_type ,
2551
2552
jl_any_type ,
2552
2553
jl_bool_type ,
2554
+ jl_bool_type ,
2553
2555
jl_bool_type ),
2554
2556
jl_emptysvec ,
2555
2557
0 , 1 , 3 );
Original file line number Diff line number Diff line change @@ -369,6 +369,7 @@ struct _jl_method_instance_t {
369
369
jl_array_t * callbacks ; // list of callback functions to inform external caches about invalidations
370
370
_Atomic(struct _jl_code_instance_t * ) cache ;
371
371
uint8_t inInference ; // flags to tell if inference is running on this object
372
+ uint8_t cache_with_orig ; // !cache_with_specTypes
372
373
uint8_t precompiled ; // true if this instance was generated by an explicit `precompile(...)` call
373
374
};
374
375
Original file line number Diff line number Diff line change @@ -447,6 +447,7 @@ JL_DLLEXPORT jl_method_instance_t *jl_new_method_instance_uninit(void)
447
447
li -> callbacks = NULL ;
448
448
jl_atomic_store_relaxed (& li -> cache , NULL );
449
449
li -> inInference = 0 ;
450
+ li -> inInference = 0 ;
450
451
li -> precompiled = 0 ;
451
452
return li ;
452
453
}
You can’t perform that action at this time.
0 commit comments