public String displayIdentifier(FrameSlot slot) { return slot.getIdentifier().toString(); }
private static boolean isInternal(FrameSlot slot) { Object identifier = slot.getIdentifier(); if (identifier == null) { return true; } if (VMAccessor.INSTRUMENT.isInputValueSlotIdentifier(identifier)) { return true; } return false; }
private static boolean isInternal(FrameSlot slot) { Object identifier = slot.getIdentifier(); if (identifier == null) { return true; } if (VMAccessor.INSTRUMENT.isInputValueSlotIdentifier(identifier)) { return true; } return false; }
@Override public String toString() { return "'" + this.getSlot().getIdentifier(); } }
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("FrameDescriptor@").append(Integer.toHexString(hashCode())); sb.append("{"); boolean comma = false; for (FrameSlot slot : slots) { if (comma) { sb.append(", "); } else { comma = true; } sb.append(slot.getIndex()).append(":").append(slot.getIdentifier()); } sb.append("}"); return sb.toString(); } }
/** @since 0.8 or earlier */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("FrameDescriptor@").append(Integer.toHexString(hashCode())); sb.append("{"); boolean comma = false; for (FrameSlot slot : slots) { if (comma) { sb.append(", "); } else { comma = true; } sb.append(slot.getIndex()).append(":").append(slot.getIdentifier()); } sb.append("}"); return sb.toString(); }
/** @since 0.8 or earlier */ @Override public String toString() { CompilerAsserts.neverPartOfCompilation(NEVER_PART_OF_COMPILATION_MESSAGE); synchronized (lock) { StringBuilder sb = new StringBuilder(); sb.append("FrameDescriptor@").append(Integer.toHexString(hashCode())); sb.append("{"); boolean comma = false; for (FrameSlot slot : slots) { if (comma) { sb.append(", "); } else { comma = true; } sb.append(slot.index).append(":").append(slot.getIdentifier()); } sb.append("}"); return sb.toString(); } }
@Override public String toString() { return "(define " + this.getSlot().getIdentifier() + " " + this.getValueNode() + ")"; } }
/** * Deeper copy of the descriptor. Copies all slots in the descriptor, but only their * {@linkplain FrameSlot#getIdentifier() identifier} and {@linkplain FrameSlot#getInfo() info} * but not their {@linkplain FrameSlot#getKind() kind}! * * @return new instance of a descriptor with copies of values from this one * @since 0.8 or earlier */ public FrameDescriptor copy() { FrameDescriptor clonedFrameDescriptor = new FrameDescriptor(this.defaultValue); for (int i = 0; i < slots.size(); i++) { FrameSlot slot = slots.get(i); clonedFrameDescriptor.addFrameSlot(slot.getIdentifier(), slot.getInfo(), FrameSlotKind.Illegal); } return clonedFrameDescriptor; }
public FrameDescriptor copy() { FrameDescriptor clonedFrameDescriptor = new FrameDescriptor(this.defaultValue); for (int i = 0; i < this.getSlots().size(); i++) { Object identifier = this.getSlots().get(i).getIdentifier(); clonedFrameDescriptor.addFrameSlot(identifier); } return clonedFrameDescriptor; }
} else if (slots.size() == 1) { FrameSlot slot = slots.get(0); slotsMap = Collections.singletonMap(Objects.toString(slot.getIdentifier()), slot); } else { slotsMap = new LinkedHashMap<>(slots.size()); for (FrameSlot slot : slots) { slotsMap.put(Objects.toString(slot.getIdentifier()), slot);
} else if (slots.size() == 1) { FrameSlot slot = slots.get(0); slotsMap = Collections.singletonMap(Objects.toString(slot.getIdentifier()), slot); } else { slotsMap = new LinkedHashMap<>(slots.size()); for (FrameSlot slot : slots) { slotsMap.put(Objects.toString(slot.getIdentifier()), slot);
} else if (slots.size() == 1) { FrameSlot slot = slots.get(0); slotsMap = Collections.singletonMap(Objects.toString(slot.getIdentifier()), slot); } else { slotsMap = new LinkedHashMap<>(slots.size()); for (FrameSlot slot : slots) { slotsMap.put(Objects.toString(slot.getIdentifier()), slot);
/** * Deeper copy of the descriptor. Copies all slots in the descriptor, but only their * {@linkplain FrameSlot#getIdentifier() identifier} and {@linkplain FrameSlot#getInfo() info} * but not their {@linkplain FrameDescriptor#getFrameSlotKind(FrameSlot) kind}! * * @return new instance of a descriptor with copies of values from this one * @since 0.8 or earlier */ public FrameDescriptor copy() { CompilerAsserts.neverPartOfCompilation(NEVER_PART_OF_COMPILATION_MESSAGE); synchronized (lock) { FrameDescriptor clonedFrameDescriptor = new FrameDescriptor(this.defaultValue); for (int i = 0; i < slots.size(); i++) { FrameSlot slot = slots.get(i); clonedFrameDescriptor.addFrameSlot(slot.getIdentifier(), slot.getInfo(), FrameSlotKind.Illegal); } return clonedFrameDescriptor; } }
@Override protected void innerOnDispose(EventContext context, VirtualFrame frame) { Lock lock = getLock(); lock.lock(); try { if (inputSlots != null) { FrameSlot[] slots = inputSlots; inputSlots = null; RootNode rootNode = context.getInstrumentedNode().getRootNode(); if (rootNode == null) { return; } FrameDescriptor descriptor = rootNode.getFrameDescriptor(); assert descriptor != null; for (FrameSlot slot : slots) { FrameSlot resolvedSlot = descriptor.findFrameSlot(slot.getIdentifier()); if (resolvedSlot != null) { descriptor.removeFrameSlot(slot.getIdentifier()); } else { // slot might be shared and already removed by another event provider // node. } } } } finally { lock.unlock(); } super.innerOnDispose(context, frame); }
@Override protected void innerOnDispose(EventContext context, VirtualFrame frame) { Lock lock = getLock(); lock.lock(); try { if (inputSlots != null) { FrameSlot[] slots = inputSlots; inputSlots = null; RootNode rootNode = context.getInstrumentedNode().getRootNode(); if (rootNode == null) { return; } FrameDescriptor descriptor = rootNode.getFrameDescriptor(); assert descriptor != null; for (FrameSlot slot : slots) { FrameSlot resolvedSlot = descriptor.findFrameSlot(slot.getIdentifier()); if (resolvedSlot != null) { descriptor.removeFrameSlot(slot.getIdentifier()); } else { // slot might be shared and already removed by another event provider // node. } } } } finally { lock.unlock(); } super.innerOnDispose(context, frame); }