@ExplodeLoop private void clearSlots(VirtualFrame frame) { FrameSlot[] slots = inputSlots; if (slots != null) { if (frame.getFrameDescriptor() == sourceFrameDescriptor) { for (int i = 0; i < slots.length; i++) { frame.setObject(slots[i], null); } } } }
@Override public Object execute(VirtualFrame frame) { assert frameDescriptor == null || frameDescriptor == frame.getFrameDescriptor(); assureAdopted(); Object ret = fragment.execute(frame); assert checkNullOrInterop(ret); return ret; }
@ExplodeLoop private void clearSlots(VirtualFrame frame) { FrameSlot[] slots = inputSlots; if (slots != null) { if (frame.getFrameDescriptor() == sourceFrameDescriptor) { for (int i = 0; i < slots.length; i++) { frame.setObject(slots[i], null); } } } }
@Override public Object execute(VirtualFrame frame) { assert frameDescriptor == null || frameDescriptor == frame.getFrameDescriptor(); Object ret = fragment.execute(frame); assert checkNullOrInterop(ret); return ret; }
@ExplodeLoop protected final Object[] getSavedInputValues(VirtualFrame frame) { FrameSlot[] slots = inputSlots; if (slots == null) { return EMPTY_ARRAY; } Object[] inputValues; if (frame.getFrameDescriptor() == sourceFrameDescriptor) { inputValues = new Object[slots.length]; for (int i = 0; i < slots.length; i++) { try { inputValues[i] = frame.getObject(slots[i]); } catch (FrameSlotTypeException e) { CompilerDirectives.transferToInterpreter(); throw new AssertionError(e); } } } else { inputValues = new Object[inputSlots.length]; } return inputValues; }
@ExplodeLoop protected final Object[] getSavedInputValues(VirtualFrame frame) { FrameSlot[] slots = inputSlots; if (slots == null) { return EMPTY_ARRAY; } Object[] inputValues; if (frame.getFrameDescriptor() == sourceFrameDescriptor) { inputValues = new Object[slots.length]; for (int i = 0; i < slots.length; i++) { try { inputValues[i] = frame.getObject(slots[i]); } catch (FrameSlotTypeException e) { CompilerDirectives.transferToInterpreter(); throw new AssertionError(e); } } } else { inputValues = new Object[inputSlots.length]; } return inputValues; }
final void saveInputValue(VirtualFrame frame, int inputIndex, Object value) { verifyIndex(inputIndex); if (inputSlots == null) { CompilerDirectives.transferToInterpreterAndInvalidate(); initializeSlots(frame); } assert sourceFrameDescriptor == frame.getFrameDescriptor() : "Unstable frame descriptor used by the language."; frame.setObject(inputSlots[inputIndex], value); }
final void saveInputValue(VirtualFrame frame, int inputIndex, Object value) { verifyIndex(inputIndex); if (inputSlots == null) { CompilerDirectives.transferToInterpreterAndInvalidate(); initializeSlots(frame); } assert sourceFrameDescriptor == frame.getFrameDescriptor() : "Unstable frame descriptor used by the language."; frame.setObject(inputSlots[inputIndex], value); }
private void initializeSlots(VirtualFrame frame) { Lock lock = getLock(); lock.lock(); try { if (this.inputSlots == null) { if (InstrumentationHandler.TRACE) { InstrumentationHandler.trace("SLOTS: Adding %s save slots for binding %s%n", inputCount, getBinding().getElement()); } FrameDescriptor frameDescriptor = frame.getFrameDescriptor(); FrameSlot[] slots = new FrameSlot[inputCount]; for (int i = 0; i < inputCount; i++) { int slotIndex = inputBaseIndex + i; slots[i] = frameDescriptor.findOrAddFrameSlot(new SavedInputValueID(getBinding(), slotIndex)); } this.sourceFrameDescriptor = frameDescriptor; this.inputSlots = slots; } } finally { lock.unlock(); } }
private void initializeSlots(VirtualFrame frame) { Lock lock = getLock(); lock.lock(); try { if (this.inputSlots == null) { if (InstrumentationHandler.TRACE) { InstrumentationHandler.trace("SLOTS: Adding %s save slots for binding %s%n", inputCount, getBinding().getElement()); } FrameDescriptor frameDescriptor = frame.getFrameDescriptor(); FrameSlot[] slots = new FrameSlot[inputCount]; for (int i = 0; i < inputCount; i++) { int slotIndex = inputBaseIndex + i; slots[i] = frameDescriptor.findOrAddFrameSlot(new SavedInputValueID(getBinding(), slotIndex)); } this.sourceFrameDescriptor = frameDescriptor; this.inputSlots = slots; } } finally { lock.unlock(); } }
private static void addGlobalFunctions(VirtualFrame virtualFrame) { FrameDescriptor frameDescriptor = virtualFrame.getFrameDescriptor(); virtualFrame.setObject(frameDescriptor.addFrameSlot("println"), createBuiltinFunction(PrintlnBuiltinNodeFactory.getInstance(),