1498 if (next == 0xFF) {
1499 // Escape character, regular compression used
1500 _bci += read_signed_int();
1501 _line += read_signed_int();
1502 } else {
1503 // Single byte compression used
1504 _bci += next >> 3;
1505 _line += next & 0x7;
1506 }
1507 return true;
1508 }
1509
1510
1511 Bytecodes::Code Method::orig_bytecode_at(int bci) const {
1512 BreakpointInfo* bp = method_holder()->breakpoints();
1513 for (; bp != NULL; bp = bp->next()) {
1514 if (bp->match(this, bci)) {
1515 return bp->orig_bytecode();
1516 }
1517 }
1518 ShouldNotReachHere();
1519 return Bytecodes::_shouldnotreachhere;
1520 }
1521
1522 void Method::set_orig_bytecode_at(int bci, Bytecodes::Code code) {
1523 assert(code != Bytecodes::_breakpoint, "cannot patch breakpoints this way");
1524 BreakpointInfo* bp = method_holder()->breakpoints();
1525 for (; bp != NULL; bp = bp->next()) {
1526 if (bp->match(this, bci)) {
1527 bp->set_orig_bytecode(code);
1528 // and continue, in case there is more than one
1529 }
1530 }
1531 }
1532
1533 void Method::set_breakpoint(int bci) {
1534 InstanceKlass* ik = method_holder();
1535 BreakpointInfo *bp = new BreakpointInfo(this, bci);
1536 bp->set_next(ik->breakpoints());
1537 ik->set_breakpoints(bp);
1538 // do this last:
|
1498 if (next == 0xFF) {
1499 // Escape character, regular compression used
1500 _bci += read_signed_int();
1501 _line += read_signed_int();
1502 } else {
1503 // Single byte compression used
1504 _bci += next >> 3;
1505 _line += next & 0x7;
1506 }
1507 return true;
1508 }
1509
1510
1511 Bytecodes::Code Method::orig_bytecode_at(int bci) const {
1512 BreakpointInfo* bp = method_holder()->breakpoints();
1513 for (; bp != NULL; bp = bp->next()) {
1514 if (bp->match(this, bci)) {
1515 return bp->orig_bytecode();
1516 }
1517 }
1518 {
1519 ResourceMark rm;
1520 fatal(err_msg("no original bytecode found in %s at bci %d", name_and_sig_as_C_string(), bci));
1521 }
1522 return Bytecodes::_shouldnotreachhere;
1523 }
1524
1525 void Method::set_orig_bytecode_at(int bci, Bytecodes::Code code) {
1526 assert(code != Bytecodes::_breakpoint, "cannot patch breakpoints this way");
1527 BreakpointInfo* bp = method_holder()->breakpoints();
1528 for (; bp != NULL; bp = bp->next()) {
1529 if (bp->match(this, bci)) {
1530 bp->set_orig_bytecode(code);
1531 // and continue, in case there is more than one
1532 }
1533 }
1534 }
1535
1536 void Method::set_breakpoint(int bci) {
1537 InstanceKlass* ik = method_holder();
1538 BreakpointInfo *bp = new BreakpointInfo(this, bci);
1539 bp->set_next(ik->breakpoints());
1540 ik->set_breakpoints(bp);
1541 // do this last:
|