Skip to content

Commit 74505f6

Browse files
committed
undo rename that added __ to fields
1 parent 6ae9799 commit 74505f6

File tree

6 files changed

+21
-18
lines changed

6 files changed

+21
-18
lines changed

src/mono/mono/metadata/class-internals.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,8 +588,10 @@ typedef struct {
588588
// have both of them to be non-NULL.
589589
const char *name;
590590
gconstpointer func;
591-
gconstpointer wrapper__;
592-
gconstpointer trampoline__;
591+
// use CAS to write
592+
gconstpointer wrapper;
593+
// use CAS to write
594+
gconstpointer trampoline;
593595
MonoMethodSignature *sig;
594596
const char *c_symbol;
595597
MonoMethod *wrapper_method;

src/mono/mono/metadata/icall.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7220,7 +7220,8 @@ mono_register_jit_icall_info (MonoJitICallInfo *info, gconstpointer func, const
72207220
// Fill in wrapper ahead of time, to just be func, to avoid
72217221
// later initializing it to anything else. So therefore, no wrapper.
72227222
if (avoid_wrapper) {
7223-
info->wrapper__ = func;
7223+
// not using CAS, because its idempotent
7224+
info->wrapper = func;
72247225
} else {
72257226
// Leave it alone in case of a race.
72267227
}

src/mono/mono/mini/aot-compiler.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6960,7 +6960,7 @@ emit_and_reloc_code (MonoAotCompile *acfg, MonoMethod *method, guint8 *code, gui
69606960
}
69616961
} else if (patch_info->type == MONO_PATCH_INFO_JIT_ICALL_ID) {
69626962
MonoJitICallInfo * const info = mono_find_jit_icall_info (patch_info->data.jit_icall_id);
6963-
if (!got_only && info->func == info->wrapper__) {
6963+
if (!got_only && info->func == info->wrapper) {
69646964
const char * sym = NULL;
69656965
if (patch_info->data.jit_icall_id == MONO_JIT_ICALL_mono_dummy_runtime_init_callback) {
69666966
g_assert (acfg->aot_opts.static_link && acfg->aot_opts.runtime_init_callback != NULL);
@@ -10612,7 +10612,7 @@ mono_aot_get_direct_call_symbol (MonoJumpInfoType type, gconstpointer data)
1061210612
sym = lookup_direct_pinvoke_symbol_name_aot (llvm_acfg, method);
1061310613
} else if (type == MONO_PATCH_INFO_JIT_ICALL_ID && (direct_calls || (MonoJitICallId)(gsize)data == MONO_JIT_ICALL_mono_dummy_runtime_init_callback)) {
1061410614
MonoJitICallInfo const * const info = mono_find_jit_icall_info ((MonoJitICallId)(gsize)data);
10615-
if (info->func == info->wrapper__) {
10615+
if (info->func == info->wrapper) {
1061610616
if ((MonoJitICallId)(gsize)data == MONO_JIT_ICALL_mono_dummy_runtime_init_callback) {
1061710617
sym = llvm_acfg->aot_opts.runtime_init_callback;
1061810618
} else {

src/mono/mono/mini/mini-amd64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3170,7 +3170,7 @@ emit_call (MonoCompile *cfg, MonoCallInst *call, guint8 *code, MonoJitICallId ji
31703170
patch.type = MONO_PATCH_INFO_JIT_ICALL_ID;
31713171
patch.target = GUINT_TO_POINTER (jit_icall_id);
31723172

3173-
if (info->func == info->wrapper__) {
3173+
if (info->func == info->wrapper) {
31743174
/* No wrapper */
31753175
if ((((guint64)info->func) >> 32) == 0)
31763176
near_call = TRUE;

src/mono/mono/mini/mini-llvm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2172,7 +2172,7 @@ get_callee_llvmonly (EmitContext *ctx, LLVMTypeRef llvm_sig, MonoJumpInfoType ty
21722172
if (type == MONO_PATCH_INFO_JIT_ICALL_ID) {
21732173
MonoJitICallInfo * const info = mono_find_jit_icall_info ((MonoJitICallId)(gsize)data);
21742174
g_assert (info);
2175-
if (info->func != info->wrapper__) {
2175+
if (info->func != info->wrapper) {
21762176
type = MONO_PATCH_INFO_METHOD;
21772177
data = mono_icall_get_wrapper_method (info);
21782178
callee_name = mono_aot_get_mangled_method_name ((MonoMethod*)data);
@@ -2215,7 +2215,7 @@ get_callee_llvmonly (EmitContext *ctx, LLVMTypeRef llvm_sig, MonoJumpInfoType ty
22152215
if (ctx->module->assembly->image == mono_get_corlib () && type == MONO_PATCH_INFO_JIT_ICALL_ID) {
22162216
MonoJitICallInfo * const info = mono_find_jit_icall_info ((MonoJitICallId)(gsize)data);
22172217

2218-
if (info->func != info->wrapper__) {
2218+
if (info->func != info->wrapper) {
22192219
type = MONO_PATCH_INFO_METHOD;
22202220
data = mono_icall_get_wrapper_method (info);
22212221
}

src/mono/mono/mini/mini-runtime.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -654,28 +654,28 @@ mono_icall_get_wrapper_full (MonoJitICallInfo* callinfo, gboolean do_compile)
654654
MonoMethod *wrapper;
655655
gconstpointer addr, trampoline;
656656

657-
if (callinfo->wrapper__)
658-
return callinfo->wrapper__;
657+
if (callinfo->wrapper)
658+
return callinfo->wrapper;
659659

660660
wrapper = mono_icall_get_wrapper_method (callinfo);
661661

662662
if (do_compile) {
663663
addr = mono_compile_method_checked (wrapper, error);
664664
mono_error_assert_ok (error);
665665
mono_memory_barrier ();
666-
callinfo->wrapper__ = addr;
667-
return addr;
666+
mono_atomic_cas_ptr ((volatile gpointer*)&callinfo->wrapper, (gpointer)addr, NULL);
667+
return (gconstpointer)mono_atomic_load_ptr((volatile gpointer*)&callinfo->wrapper);
668668
} else {
669-
if (callinfo->trampoline__)
670-
return callinfo->trampoline__;
669+
if (callinfo->trampoline)
670+
return callinfo->trampoline;
671671
trampoline = mono_create_jit_trampoline (wrapper, error);
672672
mono_error_assert_ok (error);
673673
trampoline = mono_create_ftnptr ((gpointer)trampoline);
674674

675675

676-
mono_atomic_cas_ptr ((volatile gpointer*)&callinfo->trampoline__, (void*)trampoline, NULL);
676+
mono_atomic_cas_ptr ((volatile gpointer*)&callinfo->trampoline, (gpointer)trampoline, NULL);
677677

678-
return (gconstpointer)mono_atomic_load_ptr ((volatile gpointer*)&callinfo->trampoline__);
678+
return (gconstpointer)mono_atomic_load_ptr ((volatile gpointer*)&callinfo->trampoline);
679679
}
680680
}
681681

@@ -2853,8 +2853,8 @@ mono_jit_compile_method_with_opt (MonoMethod *method, guint32 opt, gboolean jit_
28532853
p = mono_create_ftnptr (code);
28542854

28552855
if (callinfo) {
2856-
mono_atomic_cas_ptr ((volatile void*)&callinfo->wrapper__, p, NULL);
2857-
p = mono_atomic_load_ptr((volatile gpointer*)&callinfo->wrapper__);
2856+
mono_atomic_cas_ptr ((volatile void*)&callinfo->wrapper, p, NULL);
2857+
p = mono_atomic_load_ptr((volatile gpointer*)&callinfo->wrapper);
28582858
}
28592859

28602860
return p;

0 commit comments

Comments
 (0)