31 * <li>a {@linkplain #getBytecodePosition() bytecode position}</li>
32 * <li>a reference map for registers and stack slots in the current frame</li>
33 * <li>a map from bytecode locals and operand stack slots to their values or locations from which
34 * their values can be read</li>
35 * <li>a map from the registers (in the caller's frame) to the slots where they are saved in the
36 * current frame</li>
37 * </ul>
38 */
39 public final class DebugInfo {
40
41 private final BytecodePosition bytecodePosition;
42 private ReferenceMap referenceMap;
43 @SuppressWarnings("unused") private final VirtualObject[] virtualObjectMapping;
44 private RegisterSaveLayout calleeSaveInfo;
45
46 /**
47 * Creates a new {@link DebugInfo} from the given values.
48 *
49 * @param codePos the {@linkplain BytecodePosition code position} or {@linkplain BytecodeFrame
50 * frame} info
51 * @param virtualObjectMapping the mapping of {@link VirtualObject}s to their real values
52 */
53 public DebugInfo(BytecodePosition codePos, VirtualObject[] virtualObjectMapping) {
54 this.bytecodePosition = codePos;
55 this.virtualObjectMapping = virtualObjectMapping;
56 }
57
58 public DebugInfo(BytecodePosition codePos) {
59 this(codePos, null);
60 }
61
62 public void setReferenceMap(ReferenceMap referenceMap) {
63 this.referenceMap = referenceMap;
64 }
65
66 /**
67 * @return {@code true} if this debug information has a frame
68 */
69 public boolean hasFrame() {
70 return getBytecodePosition() instanceof BytecodeFrame;
71 }
72
|
31 * <li>a {@linkplain #getBytecodePosition() bytecode position}</li>
32 * <li>a reference map for registers and stack slots in the current frame</li>
33 * <li>a map from bytecode locals and operand stack slots to their values or locations from which
34 * their values can be read</li>
35 * <li>a map from the registers (in the caller's frame) to the slots where they are saved in the
36 * current frame</li>
37 * </ul>
38 */
39 public final class DebugInfo {
40
41 private final BytecodePosition bytecodePosition;
42 private ReferenceMap referenceMap;
43 @SuppressWarnings("unused") private final VirtualObject[] virtualObjectMapping;
44 private RegisterSaveLayout calleeSaveInfo;
45
46 /**
47 * Creates a new {@link DebugInfo} from the given values.
48 *
49 * @param codePos the {@linkplain BytecodePosition code position} or {@linkplain BytecodeFrame
50 * frame} info
51 * @param virtualObjectMapping the mapping of {@link VirtualObject}s to their real values. This
52 * array is now owned by this object and must not be mutated by the caller.
53 */
54 @SuppressFBWarnings(value = "EI_EXPOSE_REP2", justification = "caller transfers ownership of `virtualObjectMapping`")
55 public DebugInfo(BytecodePosition codePos, VirtualObject[] virtualObjectMapping) {
56 this.bytecodePosition = codePos;
57 this.virtualObjectMapping = virtualObjectMapping;
58 }
59
60 public DebugInfo(BytecodePosition codePos) {
61 this(codePos, null);
62 }
63
64 public void setReferenceMap(ReferenceMap referenceMap) {
65 this.referenceMap = referenceMap;
66 }
67
68 /**
69 * @return {@code true} if this debug information has a frame
70 */
71 public boolean hasFrame() {
72 return getBytecodePosition() instanceof BytecodeFrame;
73 }
74
|