From 41f0522df34fe868037631bb804f8e0f177829b4 Mon Sep 17 00:00:00 2001 From: Stephen Dolan Date: Tue, 25 Aug 2020 21:22:34 +0100 Subject: [PATCH] Use different symbol names for caml_do_local_roots on bytecode and native code (#9503) --- Changes | 3 +++ runtime/caml/roots.h | 13 ++++++++----- runtime/roots_byt.c | 10 +++++----- runtime/roots_nat.c | 12 ++++++------ 4 files changed, 22 insertions(+), 16 deletions(-) diff --git a/Changes b/Changes index 55d952e6c..334c6588f 100644 --- a/Changes +++ b/Changes @@ -54,6 +54,9 @@ Working version (Nicolás Ojeda Bär, review by Stephen Dolan, Gabriel Scherer, Mark Shinwell, and Xavier Leroy) +- #8807, #9503: Use different symbols for do_local_roots on bytecode and native + (Stephen Dolan, review by David Allsopp and Xavier Leroy) + - #9619: Change representation of function closures so that code pointers can be easily distinguished from environment variables (Xavier Leroy, review by Mark Shinwell and Damien Doligez) diff --git a/runtime/caml/roots.h b/runtime/caml/roots.h index 755aa8a7e..8ac9d8d26 100644 --- a/runtime/caml/roots.h +++ b/runtime/caml/roots.h @@ -29,12 +29,15 @@ intnat caml_darken_all_roots_slice (intnat); void caml_do_roots (scanning_action, int); extern uintnat caml_incremental_roots_count; #ifndef NATIVE_CODE -CAMLextern void caml_do_local_roots (scanning_action, value *, value *, - struct caml__roots_block *); +CAMLextern void caml_do_local_roots_byt (scanning_action, value *, value *, + struct caml__roots_block *); +#define caml_do_local_roots caml_do_local_roots_byt #else -CAMLextern void caml_do_local_roots(scanning_action f, char * c_bottom_of_stack, - uintnat last_retaddr, value * v_gc_regs, - struct caml__roots_block * gc_local_roots); +CAMLextern void caml_do_local_roots_nat ( + scanning_action f, char * c_bottom_of_stack, + uintnat last_retaddr, value * v_gc_regs, + struct caml__roots_block * gc_local_roots); +#define caml_do_local_roots caml_do_local_roots_nat #endif CAMLextern void (*caml_scan_roots_hook) (scanning_action); diff --git a/runtime/roots_byt.c b/runtime/roots_byt.c index 744495b79..9d65e0806 100644 --- a/runtime/roots_byt.c +++ b/runtime/roots_byt.c @@ -92,8 +92,8 @@ void caml_do_roots (scanning_action f, int do_globals) CAML_EV_END(EV_MAJOR_ROOTS_GLOBAL); /* The stack and the local C roots */ CAML_EV_BEGIN(EV_MAJOR_ROOTS_LOCAL); - caml_do_local_roots(f, Caml_state->extern_sp, Caml_state->stack_high, - Caml_state->local_roots); + caml_do_local_roots_byt(f, Caml_state->extern_sp, Caml_state->stack_high, + Caml_state->local_roots); CAML_EV_END(EV_MAJOR_ROOTS_LOCAL); /* Global C roots */ CAML_EV_BEGIN(EV_MAJOR_ROOTS_C); @@ -113,9 +113,9 @@ void caml_do_roots (scanning_action f, int do_globals) CAML_EV_END(EV_MAJOR_ROOTS_HOOK); } -CAMLexport void caml_do_local_roots (scanning_action f, value *stack_low, - value *stack_high, - struct caml__roots_block *local_roots) +CAMLexport void caml_do_local_roots_byt (scanning_action f, value *stack_low, + value *stack_high, + struct caml__roots_block *local_roots) { register value * sp; struct caml__roots_block *lr; diff --git a/runtime/roots_nat.c b/runtime/roots_nat.c index ec66e2dbf..aba070619 100644 --- a/runtime/roots_nat.c +++ b/runtime/roots_nat.c @@ -423,9 +423,9 @@ void caml_do_roots (scanning_action f, int do_globals) CAML_EV_END(EV_MAJOR_ROOTS_DYNAMIC_GLOBAL); /* The stack and local roots */ CAML_EV_BEGIN(EV_MAJOR_ROOTS_LOCAL); - caml_do_local_roots(f, Caml_state->bottom_of_stack, - Caml_state->last_return_address, Caml_state->gc_regs, - Caml_state->local_roots); + caml_do_local_roots_nat(f, Caml_state->bottom_of_stack, + Caml_state->last_return_address, Caml_state->gc_regs, + Caml_state->local_roots); CAML_EV_END(EV_MAJOR_ROOTS_LOCAL); /* Global C roots */ CAML_EV_BEGIN(EV_MAJOR_ROOTS_C); @@ -445,9 +445,9 @@ void caml_do_roots (scanning_action f, int do_globals) CAML_EV_END(EV_MAJOR_ROOTS_HOOK); } -void caml_do_local_roots(scanning_action f, char * bottom_of_stack, - uintnat last_retaddr, value * gc_regs, - struct caml__roots_block * local_roots) +void caml_do_local_roots_nat(scanning_action f, char * bottom_of_stack, + uintnat last_retaddr, value * gc_regs, + struct caml__roots_block * local_roots) { char * sp; uintnat retaddr;