@Override public Object execute(VirtualFrame frame) { return frame.getArguments()[0]; } }
@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); } } } }
@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; }
@Override protected void onEnter(VirtualFrame frame) { frame.setLong(timeStartedSlot, System.nanoTime()); super.onEnter(frame); frame.setObject(parentCounterSlot, profiler.activeCounter); profiler.activeCounter = counter; if (CompilerDirectives.inInterpreter()) { counter.compiled = false; } else { counter.compiled = true; } }
@Override protected void onReturnValue(VirtualFrame frame, Object result) { if (stepping.get()) { doStepAfter(frame.materialize(), result); } }
public void setResultObject(VirtualFrame frame, Object result) { frame.setObject(props.getCaptureGroupResultFS(), result); }
@Override protected void onReturnValue(VirtualFrame frame, Object result) { long startTime; Counter parentCounter; try { startTime = frame.getLong(timeStartedSlot); parentCounter = (Counter) frame.getObject(parentCounterSlot); } catch (FrameSlotTypeException e) { throw new AssertionError(); } long timeNano = System.nanoTime() - startTime; if (CompilerDirectives.inInterpreter()) { counter.interpretedTotalTime += timeNano; } else { counter.compiledTotalTime += timeNano; } // the condition if parentCounter is usually only for a root method null // after that it is always set. So it makes sense to speculate. if (parentNotNullProfile.profile(parentCounter != null)) { // do not speculate on parentCounter.compiled condition very likely to invalidate if (parentCounter.compiled) { parentCounter.compiledChildTime += timeNano; } else { parentCounter.interpretedChildTime += timeNano; } } profiler.activeCounter = parentCounter; }
protected final Object getSavedInputValue(VirtualFrame frame, int inputIndex) { try { verifyIndex(inputIndex); if (inputSlots == null) { // never saved any value return null; } return frame.getObject(inputSlots[inputIndex]); } catch (FrameSlotTypeException e) { CompilerDirectives.transferToInterpreter(); throw new AssertionError(e); } }
@Override public Object execute(VirtualFrame frame) { assert frameDescriptor == null || frameDescriptor == frame.getFrameDescriptor(); assureAdopted(); Object ret = fragment.execute(frame); assert checkNullOrInterop(ret); return ret; }
@Specialization(rewriteOn = FrameSlotTypeException.class) protected long readLong(VirtualFrame virtualFrame) throws FrameSlotTypeException{ return virtualFrame.getLong(getSlot()); }
@Specialization(guards = "isLongKind") protected long writeLong(VirtualFrame frame, long value) { frame.setLong(getSlot(), value); return value; }
@Override protected void onEnter(VirtualFrame frame) { if (stepping.get()) { doStepBefore(frame.materialize()); } }
public void setInput(VirtualFrame frame, Object input) { frame.setObject(props.getInputFS(), input); }
protected final Object getSavedInputValue(VirtualFrame frame, int inputIndex) { try { verifyIndex(inputIndex); if (inputSlots == null) { // never saved any value return null; } return frame.getObject(inputSlots[inputIndex]); } catch (FrameSlotTypeException e) { CompilerDirectives.transferToInterpreter(); throw new AssertionError(e); } }
@Override public Object execute(VirtualFrame frame) { assert frameDescriptor == null || frameDescriptor == frame.getFrameDescriptor(); Object ret = fragment.execute(frame); assert checkNullOrInterop(ret); return ret; }
@Specialization(rewriteOn = FrameSlotTypeException.class) protected long readLong(VirtualFrame frame) throws FrameSlotTypeException { return frame.getLong(getSlot()); }
@Specialization(guards = "isLongKind()") protected long writeLong(VirtualFrame virtualFrame, long value) { virtualFrame.setLong(this.getSlot(), value); return value; }
@Override public Object execute(VirtualFrame frame) { Object[] args = frame.getArguments(); if (index < args.length) { return args[index]; } else { return LuaNull.SINGLETON; } }
@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 void onReturnValue(VirtualFrame frame, Object result) { if (stepping.get()) { doReturn(frame.materialize(), result); } }