public void setKind(final FrameSlotKind kind) { if (this.kind != kind) { CompilerDirectives.transferToInterpreter(); this.kind = kind; this.descriptor.updateVersion(); } }
/** * Changes the kind of this slot. Change of the slot kind is done on <em>slow path</em> and * invalidates assumptions about version of the {@link #getFrameDescriptor() associated * descriptor}. * * @param kind new kind of the slot * @since 0.8 or earlier */ public void setKind(final FrameSlotKind kind) { if (this.kind != kind) { CompilerDirectives.transferToInterpreterAndInvalidate(); this.kind = kind; this.descriptor.updateVersion(); } }
public void removeFrameSlot(Object identifier) { CompilerAsserts.neverPartOfCompilation("interpreter-only. includes hashmap operations."); assert identifierToSlotMap.containsKey(identifier); slots.remove(identifierToSlotMap.get(identifier)); identifierToSlotMap.remove(identifier); updateVersion(); getNotInFrameAssumption(identifier); }
public FrameSlot addFrameSlot(Object identifier, Object info, FrameSlotKind kind) { CompilerAsserts.neverPartOfCompilation("interpreter-only. includes hashmap operations."); assert !identifierToSlotMap.containsKey(identifier); FrameSlot slot = new FrameSlot(this, identifier, info, slots.size(), kind); slots.add(slot); identifierToSlotMap.put(identifier, slot); updateVersion(); invalidateNotInFrameAssumption(identifier); return slot; }
/** * Adds new frame slot to {@link #getSlots()} list. This is a slow operation that switches to * interpreter mode. * * @param identifier key for the slot - must not be {@code null} and needs proper * {@link #equals(java.lang.Object)} and {@link Object#hashCode()} implementations * @param info additional {@linkplain FrameSlot#getInfo() information for the slot}, may be null * @param kind the kind of the new slot * @return the newly created slot * @throws IllegalArgumentException if a frame slot with the same identifier exists * @throws NullPointerException if {@code identifier} or {@code kind} is {@code null} * @since 0.8 or earlier */ public FrameSlot addFrameSlot(Object identifier, Object info, FrameSlotKind kind) { CompilerAsserts.neverPartOfCompilation(NEVER_PART_OF_COMPILATION_MESSAGE); Objects.requireNonNull(identifier, "identifier"); Objects.requireNonNull(kind, "kind"); if (identifierToSlotMap.containsKey(identifier)) { throw new IllegalArgumentException("duplicate frame slot: " + identifier); } FrameSlot slot = new FrameSlot(this, identifier, info, kind, slots.size()); slots.add(slot); identifierToSlotMap.put(identifier, slot); updateVersion(); invalidateNotInFrameAssumption(identifier); return slot; }
/** * Removes a slot. If the identifier is found, its slot is removed from this descriptor. This is * a slow operation. * * @param identifier identifies the slot to remove * @throws IllegalArgumentException if no such frame slot exists * @since 0.8 or earlier */ public void removeFrameSlot(Object identifier) { CompilerAsserts.neverPartOfCompilation(NEVER_PART_OF_COMPILATION_MESSAGE); if (!identifierToSlotMap.containsKey(identifier)) { throw new IllegalArgumentException("no such frame slot: " + identifier); } slots.remove(identifierToSlotMap.get(identifier)); identifierToSlotMap.removeKey(identifier); updateVersion(); getNotInFrameAssumption(identifier); }
/** * Removes a slot. If the identifier is found, its slot is removed from this descriptor. This is * a slow operation. * * @param identifier identifies the slot to remove * @throws IllegalArgumentException if no such frame slot exists * @since 0.8 or earlier */ public void removeFrameSlot(Object identifier) { CompilerAsserts.neverPartOfCompilation(NEVER_PART_OF_COMPILATION_MESSAGE); synchronized (lock) { FrameSlot slot = identifierToSlotMap.get(identifier); if (slot == null) { throw new IllegalArgumentException("no such frame slot: " + identifier); } slots.remove(slot); identifierToSlotMap.removeKey(identifier); updateVersion(); getNotInFrameAssumption(identifier); } }
slots.add(slot); identifierToSlotMap.put(identifier, slot); updateVersion(); invalidateNotInFrameAssumption(identifier); return slot;