Skip to content

Commit 73cb06e

Browse files
authored
[mono] Trying to fix performance regression. (#94358)
* Trying to fix performance regression. * Fix performance issue
1 parent 9fe2228 commit 73cb06e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/mono/mono/mini/interp/transform.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2306,7 +2306,16 @@ interp_handle_intrinsics (TransformData *td, MonoMethod *target_method, MonoClas
23062306
*op = MINT_INITBLK;
23072307
}
23082308
} else if (in_corlib && !strcmp (klass_name_space, "System.Runtime.CompilerServices") && !strcmp (klass_name, "RuntimeHelpers")) {
2309-
if (!strcmp (tm, "GetHashCode") || !strcmp (tm, "InternalGetHashCode")) {
2309+
if (!strcmp (tm, "get_OffsetToStringData")) {
2310+
g_assert (csignature->param_count == 0);
2311+
int offset = MONO_STRUCT_OFFSET (MonoString, chars);
2312+
interp_add_ins (td, MINT_LDC_I4);
2313+
WRITE32_INS (td->last_ins, 0, &offset);
2314+
push_simple_type (td, STACK_TYPE_I4);
2315+
interp_ins_set_dreg (td->last_ins, td->sp [-1].local);
2316+
td->ip += 5;
2317+
return TRUE;
2318+
} else if (!strcmp (tm, "GetHashCode") || !strcmp (tm, "InternalGetHashCode")) {
23102319
*op = MINT_INTRINS_GET_HASHCODE;
23112320
} else if (!strcmp (tm, "TryGetHashCode")) {
23122321
*op = MINT_INTRINS_TRY_GET_HASHCODE;

0 commit comments

Comments
 (0)