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); } }
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); } }
@Specialization(rewriteOn = FrameSlotTypeException.class) protected Object readObject(VirtualFrame virtualFrame) throws FrameSlotTypeException{ return virtualFrame.getObject(getSlot()); }
@Specialization(rewriteOn = FrameSlotTypeException.class) protected Object readObject(VirtualFrame frame) throws FrameSlotTypeException { return frame.getObject(getSlot()); }
@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; }
@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; }