MCPcopy Create free account
hub / github.com/beanshell/beanshell / visitFieldInsn

Method visitFieldInsn

src/bsh/org/objectweb/asm/CodeWriter.java:659–692  ·  view source on GitHub ↗
(
    final int opcode,
    final String owner,
    final String name,
    final String desc)

Source from the content-addressed store, hash-verified

657 }
658
659 public void visitFieldInsn (
660 final int opcode,
661 final String owner,
662 final String name,
663 final String desc)
664 {
665 if (computeMaxs) {
666 int size;
667 // computes the stack size variation
668 char c = desc.charAt(0);
669 switch (opcode) {
670 case Constants.GETSTATIC:
671 size = stackSize + (c == 'D' || c == 'J' ? 2 : 1);
672 break;
673 case Constants.PUTSTATIC:
674 size = stackSize + (c == 'D' || c == 'J' ? -2 : -1);
675 break;
676 case Constants.GETFIELD:
677 size = stackSize + (c == 'D' || c == 'J' ? 1 : 0);
678 break;
679 //case Constants.PUTFIELD:
680 default:
681 size = stackSize + (c == 'D' || c == 'J' ? -3 : -2);
682 break;
683 }
684 // updates current and max stack sizes
685 if (size > maxStackSize) {
686 maxStackSize = size;
687 }
688 stackSize = size;
689 }
690 // adds the instruction to the bytecode of the method
691 code.put12(opcode, cw.newField(owner, name, desc).index);
692 }
693
694 public void visitMethodInsn (
695 final int opcode,

Callers

nothing calls this directly

Calls 2

put12Method · 0.80
newFieldMethod · 0.80

Tested by

no test coverage detected