Skip to content

Commit 50b8c13

Browse files
maleadtKristofferC
authored andcommitted
Add world argument to jl_create_native. (#48746)
(cherry picked from commit 0975906)
1 parent b5d9781 commit 50b8c13

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

src/aotcompile.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ void replaceUsesWithLoad(Function &F, function_ref<GlobalVariable *(Instruction
271271
// `_imaging_mode` controls if raw pointers can be embedded (e.g. the code will be loaded into the same session).
272272
// `_external_linkage` create linkages between pkgimages.
273273
extern "C" JL_DLLEXPORT
274-
void *jl_create_native_impl(jl_array_t *methods, LLVMOrcThreadSafeModuleRef llvmmod, const jl_cgparams_t *cgparams, int _policy, int _imaging_mode, int _external_linkage)
274+
void *jl_create_native_impl(jl_array_t *methods, LLVMOrcThreadSafeModuleRef llvmmod, const jl_cgparams_t *cgparams, int _policy, int _imaging_mode, int _external_linkage, size_t _world)
275275
{
276276
++CreateNativeCalls;
277277
CreateNativeMax.updateMax(jl_array_len(methods));
@@ -307,7 +307,7 @@ void *jl_create_native_impl(jl_array_t *methods, LLVMOrcThreadSafeModuleRef llvm
307307
params.params = cgparams;
308308
params.imaging = imaging;
309309
params.external_linkage = _external_linkage;
310-
size_t compile_for[] = { jl_typeinf_world, jl_atomic_load_acquire(&jl_world_counter) };
310+
size_t compile_for[] = { jl_typeinf_world, _world };
311311
for (int worlds = 0; worlds < 2; worlds++) {
312312
params.world = compile_for[worlds];
313313
if (!params.world)

src/codegen-stubs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ JL_DLLEXPORT size_t jl_jit_total_bytes_fallback(void)
6767
return 0;
6868
}
6969

70-
JL_DLLEXPORT void *jl_create_native_fallback(jl_array_t *methods, LLVMOrcThreadSafeModuleRef llvmmod, const jl_cgparams_t *cgparams, int _policy, int _imaging_mode, int _external_linkage) UNAVAILABLE
70+
JL_DLLEXPORT void *jl_create_native_fallback(jl_array_t *methods, LLVMOrcThreadSafeModuleRef llvmmod, const jl_cgparams_t *cgparams, int _policy, int _imaging_mode, int _external_linkage, size_t _world) UNAVAILABLE
7171

7272
JL_DLLEXPORT void jl_dump_compiles_fallback(void *s)
7373
{

src/julia_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,7 @@ JL_DLLEXPORT jl_value_t *jl_dump_fptr_asm(uint64_t fptr, char raw_mc, const char
993993
JL_DLLEXPORT jl_value_t *jl_dump_function_ir(jl_llvmf_dump_t *dump, char strip_ir_metadata, char dump_module, const char *debuginfo);
994994
JL_DLLEXPORT jl_value_t *jl_dump_function_asm(jl_llvmf_dump_t *dump, char raw_mc, const char* asm_variant, const char *debuginfo, char binary);
995995

996-
void *jl_create_native(jl_array_t *methods, LLVMOrcThreadSafeModuleRef llvmmod, const jl_cgparams_t *cgparams, int policy, int imaging_mode, int cache);
996+
void *jl_create_native(jl_array_t *methods, LLVMOrcThreadSafeModuleRef llvmmod, const jl_cgparams_t *cgparams, int policy, int imaging_mode, int cache, size_t world);
997997
void jl_dump_native(void *native_code,
998998
const char *bc_fname, const char *unopt_bc_fname, const char *obj_fname, const char *asm_fname,
999999
const char *sysimg_data, size_t sysimg_len, ios_t *s);

src/precompile_utils.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@ static void *jl_precompile_(jl_array_t *m, int external_linkage)
255255
jl_array_ptr_1d_push(m2, item);
256256
}
257257
}
258-
void *native_code = jl_create_native(m2, NULL, NULL, 0, 1, external_linkage);
258+
void *native_code = jl_create_native(m2, NULL, NULL, 0, 1, external_linkage,
259+
jl_atomic_load_acquire(&jl_world_counter));
259260
JL_GC_POP();
260261
return native_code;
261262
}

0 commit comments

Comments
 (0)