GH-122548: Implement branch taken and not taken events for sys.monitoring (GH-122564)

This commit is contained in:
Mark Shannon 2024-12-19 16:59:51 +00:00 committed by GitHub
parent 7b811d0562
commit d2f1d917e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 998 additions and 583 deletions

View file

@ -557,6 +557,12 @@ normalize_jumps_in_block(cfg_builder *g, basicblock *b) {
if (backwards_jump == NULL) {
return ERROR;
}
assert(b->b_next->b_iused > 0);
assert(b->b_next->b_instr[0].i_opcode == NOT_TAKEN);
b->b_next->b_instr[0].i_opcode = NOP;
b->b_next->b_instr[0].i_loc = NO_LOCATION;
RETURN_IF_ERROR(
basicblock_addop(backwards_jump, NOT_TAKEN, 0, last->i_loc));
RETURN_IF_ERROR(
basicblock_add_jump(backwards_jump, JUMP, target, last->i_loc));
last->i_opcode = reversed_opcode;