public FrameSlot findOrAddFrameSlot(Object identifier) { FrameSlot result = findFrameSlot(identifier); if (result != null) { return result; } return addFrameSlot(identifier); }
public FrameSlot findOrAddFrameSlot(Object identifier, FrameSlotKind kind) { FrameSlot result = findFrameSlot(identifier); if (result != null) { return result; } return addFrameSlot(identifier, kind); }
public FrameSlot findOrAddFrameSlot(Object identifier, Object info, FrameSlotKind kind) { FrameSlot result = findFrameSlot(identifier); if (result != null) { return result; } return addFrameSlot(identifier, info, kind); }
/** * Finds an existing slot or creates new one. This is a slow operation. * * @param identifier the key of the slot to search for * @return the found or newly created slot * @throws NullPointerException if {@code identifier} is {@code null} * @since 0.8 or earlier */ public FrameSlot findOrAddFrameSlot(Object identifier) { FrameSlot result = findFrameSlot(identifier); if (result != null) { return result; } return addFrameSlot(identifier); }
/** * Finds an existing slot or creates new one. This is a slow operation. * * @param identifier the key of the slot to search for * @param kind the kind for the newly created slot * @return the found or newly created slot * @throws NullPointerException if {@code identifier} or {@code kind} is {@code null} * @since 0.8 or earlier */ public FrameSlot findOrAddFrameSlot(Object identifier, FrameSlotKind kind) { FrameSlot result = findFrameSlot(identifier); if (result != null) { return result; } return addFrameSlot(identifier, kind); }
/** * Finds an existing slot or creates new one. This is a slow operation. * * @param identifier the key of the slot to search for * @param info info for the newly created slot * @param kind the kind for the newly created slot * @return the found or newly created slot * @throws NullPointerException if {@code identifier} or {@code kind} is {@code null} * @since 0.8 or earlier */ public FrameSlot findOrAddFrameSlot(Object identifier, Object info, FrameSlotKind kind) { FrameSlot result = findFrameSlot(identifier); if (result != null) { return result; } return addFrameSlot(identifier, info, kind); }
private Object visitName(Name name) { final FrameSlot frameSlot = frameDescriptor.findFrameSlot(name.name); if (frameSlot == null) { return visitGlobalName(name); } return LuaReadLocalVariableNodeFactory.create(frameSlot); }
public Pair<Integer, FrameSlot> getIdentifier(String id) { int depth = 0; Namespace current = this; FrameSlot slot = current.frameDescriptor.findFrameSlot(id); while (slot == null) { depth++; current = current.parent; if (current == null) { return new Pair<>(LEVEL_UNDEFINED, null); } slot = current.frameDescriptor.findFrameSlot(id); } if (current.parent == null) { return new Pair<>(LEVEL_GLOBAL, slot); } return new Pair<>(depth, slot); } }
/** * Finds an existing slot or creates new one. This is a slow operation. * * @param identifier the key of the slot to search for * @return the found or newly created slot * @throws NullPointerException if {@code identifier} is {@code null} * @since 0.8 or earlier */ public FrameSlot findOrAddFrameSlot(Object identifier) { CompilerAsserts.neverPartOfCompilation(NEVER_PART_OF_COMPILATION_MESSAGE); synchronized (lock) { FrameSlot result = findFrameSlot(identifier); if (result != null) { return result; } return addFrameSlot(identifier); } }
/** * Finds an existing slot or creates new one. This is a slow operation. * * @param identifier the key of the slot to search for * @param kind the kind for the newly created slot * @return the found or newly created slot * @throws NullPointerException if {@code identifier} or {@code kind} is {@code null} * @since 0.8 or earlier */ public FrameSlot findOrAddFrameSlot(Object identifier, FrameSlotKind kind) { CompilerAsserts.neverPartOfCompilation(NEVER_PART_OF_COMPILATION_MESSAGE); synchronized (lock) { FrameSlot result = findFrameSlot(identifier); if (result != null) { return result; } return addFrameSlot(identifier, kind); } }
/** * Finds an existing slot or creates new one. This is a slow operation. * * @param identifier the key of the slot to search for * @param info info for the newly created slot * @param kind the kind for the newly created slot * @return the found or newly created slot * @throws NullPointerException if {@code identifier} or {@code kind} is {@code null} * @since 0.8 or earlier */ public FrameSlot findOrAddFrameSlot(Object identifier, Object info, FrameSlotKind kind) { CompilerAsserts.neverPartOfCompilation(NEVER_PART_OF_COMPILATION_MESSAGE); synchronized (lock) { FrameSlot result = findFrameSlot(identifier); if (result != null) { return result; } return addFrameSlot(identifier, info, kind); } }
@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); }