@@ -293,7 +293,7 @@ static InterpInst*
293
293
interp_prev_ins (InterpInst * ins )
294
294
{
295
295
ins = ins -> prev ;
296
- while (ins && ins -> opcode == MINT_NOP )
296
+ while (ins && ( ins -> opcode == MINT_NOP || ins -> opcode == MINT_IL_SEQ_POINT ) )
297
297
ins = ins -> prev ;
298
298
return ins ;
299
299
}
@@ -2475,9 +2475,11 @@ interp_handle_intrinsics (TransformData *td, MonoMethod *target_method, MonoClas
2475
2475
} else if (in_corlib && target_method -> klass == mono_defaults .enum_class && !strcmp (tm , "HasFlag" )) {
2476
2476
gboolean intrinsify = FALSE;
2477
2477
MonoClass * base_klass = NULL ;
2478
+ InterpInst * prev_ins = interp_prev_ins (td -> last_ins );
2479
+ InterpInst * prev_prev_ins = prev_ins ? interp_prev_ins (prev_ins ) : NULL ;
2478
2480
if (td -> last_ins && td -> last_ins -> opcode == MINT_BOX &&
2479
- td -> last_ins -> prev && interp_ins_is_ldc (td -> last_ins -> prev ) &&
2480
- td -> last_ins -> prev -> prev && td -> last_ins -> prev -> prev -> opcode == MINT_BOX &&
2481
+ prev_ins && interp_ins_is_ldc (prev_ins ) &&
2482
+ prev_prev_ins && prev_prev_ins -> opcode == MINT_BOX &&
2481
2483
td -> sp [-2 ].klass == td -> sp [-1 ].klass &&
2482
2484
interp_ip_in_cbb (td , td -> ip - td -> il_code )) {
2483
2485
// csc pattern : box, ldc, box, call HasFlag
@@ -2486,12 +2488,12 @@ interp_handle_intrinsics (TransformData *td, MonoMethod *target_method, MonoClas
2486
2488
base_klass = mono_class_from_mono_type_internal (base_type );
2487
2489
2488
2490
// Remove the boxing of valuetypes, by replacing them with moves
2489
- td -> last_ins -> prev -> prev -> opcode = get_mov_for_type (mint_type (base_type ), FALSE);
2491
+ prev_prev_ins -> opcode = get_mov_for_type (mint_type (base_type ), FALSE);
2490
2492
td -> last_ins -> opcode = get_mov_for_type (mint_type (base_type ), FALSE);
2491
2493
2492
2494
intrinsify = TRUE;
2493
2495
} else if (td -> last_ins && td -> last_ins -> opcode == MINT_BOX &&
2494
- td -> last_ins -> prev && interp_ins_is_ldc (td -> last_ins -> prev ) &&
2496
+ prev_ins && interp_ins_is_ldc (prev_ins ) && prev_prev_ins &&
2495
2497
constrained_class && td -> sp [-1 ].klass == constrained_class &&
2496
2498
interp_ip_in_cbb (td , td -> ip - td -> il_code )) {
2497
2499
// mcs pattern : ldc, box, constrained Enum, call HasFlag
@@ -2502,7 +2504,7 @@ interp_handle_intrinsics (TransformData *td, MonoMethod *target_method, MonoClas
2502
2504
2503
2505
// Remove boxing and load the value of this
2504
2506
td -> last_ins -> opcode = get_mov_for_type (mt , FALSE);
2505
- InterpInst * ins = interp_insert_ins (td , td -> last_ins -> prev -> prev , interp_get_ldind_for_mt (mt ));
2507
+ InterpInst * ins = interp_insert_ins (td , prev_prev_ins , interp_get_ldind_for_mt (mt ));
2506
2508
interp_ins_set_sreg (ins , td -> sp [-2 ].local );
2507
2509
interp_ins_set_dreg (ins , td -> sp [-2 ].local );
2508
2510
intrinsify = TRUE;
@@ -3798,7 +3800,7 @@ save_seq_points (TransformData *td, MonoJitInfo *jinfo)
3798
3800
GSList * * next = NULL ;
3799
3801
GList * bblist ;
3800
3802
3801
- if (!td -> gen_sdb_seq_points )
3803
+ if (!td -> gen_seq_points )
3802
3804
return ;
3803
3805
3804
3806
/*
@@ -4580,10 +4582,14 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header,
4580
4582
(td -> sp > td -> stack && (td -> sp [-1 ].type == STACK_TYPE_O || td -> sp [-1 ].type == STACK_TYPE_VT )) ? (td -> sp [-1 ].klass == NULL ? "?" : m_class_get_name (td -> sp [-1 ].klass )) : "" );
4581
4583
}
4582
4584
4583
- if (td -> gen_sdb_seq_points && ((!sym_seq_points && td -> stack == td -> sp ) || (sym_seq_points && mono_bitset_test_fast (seq_point_locs , td -> ip - header -> code )))) {
4584
- if (in_offset == 0 || (header -> num_clauses && !td -> cbb -> last_ins ))
4585
- interp_add_ins (td , MINT_SDB_INTR_LOC );
4586
- last_seq_point = interp_add_ins (td , MINT_SDB_SEQ_POINT );
4585
+ if (td -> gen_seq_points && ((!sym_seq_points && td -> stack == td -> sp ) || (sym_seq_points && mono_bitset_test_fast (seq_point_locs , td -> ip - header -> code )))) {
4586
+ if (td -> gen_sdb_seq_points ) {
4587
+ if (in_offset == 0 || (header -> num_clauses && !td -> cbb -> last_ins ))
4588
+ interp_add_ins (td , MINT_SDB_INTR_LOC );
4589
+ last_seq_point = interp_add_ins (td , MINT_SDB_SEQ_POINT );
4590
+ } else {
4591
+ last_seq_point = interp_add_ins (td , MINT_IL_SEQ_POINT );
4592
+ }
4587
4593
}
4588
4594
4589
4595
if (td -> prof_coverage ) {
@@ -7664,7 +7670,7 @@ emit_compacted_instruction (TransformData *td, guint16* start_ip, InterpInst *in
7664
7670
}
7665
7671
if (opcode == MINT_CALL_HANDLER )
7666
7672
* ip ++ = ins -> data [2 ];
7667
- } else if (opcode == MINT_SDB_SEQ_POINT ) {
7673
+ } else if (opcode == MINT_SDB_SEQ_POINT || opcode == MINT_IL_SEQ_POINT ) {
7668
7674
SeqPoint * seqp = (SeqPoint * )mono_mempool_alloc0 (td -> mempool , sizeof (SeqPoint ));
7669
7675
InterpBasicBlock * cbb ;
7670
7676
@@ -7687,6 +7693,9 @@ emit_compacted_instruction (TransformData *td, guint16* start_ip, InterpInst *in
7687
7693
7688
7694
cbb -> seq_points = g_slist_prepend_mempool (td -> mempool , cbb -> seq_points , seqp );
7689
7695
cbb -> last_seq_point = seqp ;
7696
+ // IL_SEQ_POINT shouldn't exist in the emitted code, we undo the ip position
7697
+ if (opcode == MINT_IL_SEQ_POINT )
7698
+ return ip - 1 ;
7690
7699
} else if (opcode == MINT_MOV_OFF ) {
7691
7700
int foff = ins -> data [0 ];
7692
7701
int mt = ins -> data [1 ];
@@ -9453,6 +9462,7 @@ generate (MonoMethod *method, MonoMethodHeader *header, InterpMethod *rtm, MonoG
9453
9462
#ifdef ENABLE_EXPERIMENT_TIERED
9454
9463
td -> patchsite_hash = g_hash_table_new (NULL , NULL );
9455
9464
#endif
9465
+ td -> gen_seq_points = !mini_debug_options .no_seq_points_compact_data || mini_debug_options .gen_sdb_seq_points ;
9456
9466
td -> gen_sdb_seq_points = mini_debug_options .gen_sdb_seq_points ;
9457
9467
td -> seq_points = g_ptr_array_new ();
9458
9468
td -> verbose_level = mono_interp_traceopt ;
0 commit comments