@ExplodeLoop(kind = LoopExplosionKind.FULL_EXPLODE_UNTIL_RETURN) int get(Object key) { Entry current = first; while (current != null) { if (current.key == key) { return current.value; } current = current.next; } return -1; }
@ExplodeLoop(kind = LoopExplosionKind.FULL_EXPLODE_UNTIL_RETURN) int get(Object key) { Entry current = first; while (current != null) { if (current.key == key) { return current.value; } current = current.next; } return -1; }
@ExplodeLoop private void applyFinalStateTransitionIndexClears(DFACaptureGroupTrackingData d) { for (int i = 1; i < indexClears[0].length; i++) { final int targetIndex = Byte.toUnsignedInt(indexClears[0][i]); d.currentResult[targetIndex] = 0; } }
@ExplodeLoop private void applyFinalStateTransitionIndexUpdates(DFACaptureGroupTrackingData d, int currentIndex) { for (int i = 1; i < indexUpdates[0].length; i++) { final int targetIndex = Byte.toUnsignedInt(indexUpdates[0][i]); d.currentResult[targetIndex] = currentIndex; } }
@ExplodeLoop private void applyArrayCopy(int[] results, int[] currentResultOrder, int length) { for (int i = 0; i < arrayCopies.length; i += 2) { final int source = Byte.toUnsignedInt(arrayCopies[i]); final int target = Byte.toUnsignedInt(arrayCopies[i + 1]); System.arraycopy(results, currentResultOrder[source], results, currentResultOrder[target], length); } }
@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 private void applyIndexClear(int[] results, int[] currentResultOrder) { for (byte[] indexClear : indexClears) { assert indexClear.length > 1; final int targetArray = Byte.toUnsignedInt(indexClear[0]); for (int i = 1; i < indexClear.length; i++) { final int targetIndex = Byte.toUnsignedInt(indexClear[i]); results[currentResultOrder[targetArray] + targetIndex] = 0; } } }
@ExplodeLoop public boolean test(Object value, ToJavaNode toJavaNode) { for (Class<?> otherType : otherTypes) { if (toJavaNode.canConvertStrict(value, otherType)) { return false; } } return toJavaNode.canConvertStrict(value, targetType); } }
@ExplodeLoop public boolean test(Object value, ToHostNode toJavaNode) { for (Class<?> otherType : otherTypes) { if (toJavaNode.canConvertToPrimitive(value, otherType, priority)) { return false; } } return toJavaNode.canConvertToPrimitive(value, targetType, priority); } }
@ExplodeLoop @Specialization(replaces = "executeCached") protected void executeGeneric(boolean suspensionEnabled, DebuggerSession[] sessions, @SuppressWarnings("unused") long threadId) { for (DebuggerSession session : sessions) { session.setThreadSuspendEnabled(suspensionEnabled); } }
@ExplodeLoop protected static void check(Assumption[] assumptions) throws InvalidAssumptionException { if (assumptions != null) { CompilerAsserts.compilationConstant(assumptions.length); for (Assumption assumption : assumptions) { check(assumption); } } }
@ExplodeLoop private void initResultOrder(VirtualFrame frame) { DFACaptureGroupTrackingData cgData = getCGData(frame); for (int i = 0; i < maxNumberOfNFAStates; i++) { cgData.currentResultOrder[i] = i * props.getNumberOfCaptureGroups() * 2; } }
@ExplodeLoop private void applyReorder(int[] currentResultOrder) { for (int i = 0; i < reorderSwaps.length; i += 2) { final int source = Byte.toUnsignedInt(reorderSwaps[i]); final int target = Byte.toUnsignedInt(reorderSwaps[i + 1]); final int tmp = currentResultOrder[source]; currentResultOrder[source] = currentResultOrder[target]; currentResultOrder[target] = tmp; } }
@ExplodeLoop private void applyIndexUpdate(int[] results, int[] currentResultOrder, int currentIndex) { for (byte[] indexUpdate : indexUpdates) { assert indexUpdate.length > 1; final int targetArray = Byte.toUnsignedInt(indexUpdate[0]); for (int i = 1; i < indexUpdate.length; i++) { final int targetIndex = Byte.toUnsignedInt(indexUpdate[i]); results[currentResultOrder[targetArray] + targetIndex] = currentIndex; } } }
@ExplodeLoop @Specialization(replaces = "executeCached") protected void executeGeneric(boolean suspensionEnabled, DebuggerSession[] sessions, @SuppressWarnings("unused") long threadId) { for (DebuggerSession session : sessions) { session.setThreadSuspendEnabled(suspensionEnabled); } }
@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 public DynamicObject newInstance(Object... initialValues) { assert initialValues.length == instanceFields.length : wrongArguments(initialValues.length); DynamicObject store = shape.newInstance(); CompilerAsserts.partialEvaluationConstant(instanceFields.length); for (int i = 0; i < instanceFields.length; i++) { instanceFields[i].setInternal(store, initialValues[i]); } return store; }
@ExplodeLoop public DynamicObject newInstance(Object... initialValues) { assert initialValues.length == instanceFields.length : wrongArguments(initialValues.length); DynamicObject store = shape.newInstance(); CompilerAsserts.partialEvaluationConstant(instanceFields.length); for (int i = 0; i < instanceFields.length; i++) { instanceFields[i].setInternal(store, initialValues[i]); } return store; }
@ExplodeLoop(kind = ExplodeLoop.LoopExplosionKind.FULL_EXPLODE_UNTIL_RETURN) private void applyPreAnchoredFinalTransitionExploded(VirtualFrame frame, TRegexDFAExecutorNode executor, short transitionIndex, int currentIndex) { for (short possibleTransition : precedingTransitions) { if (transitionIndex == possibleTransition) { executor.getCGTransitions()[possibleTransition].getTransitionToAnchoredFinalState().applyPreFinalStateTransition( executor, executor.getCGData(frame), executor.isSearching(), currentIndex); return; } } throw shouldNotReachHere(); }
@ExplodeLoop(kind = ExplodeLoop.LoopExplosionKind.FULL_EXPLODE_UNTIL_RETURN) private void applyPreFinalTransitionExploded(VirtualFrame frame, TRegexDFAExecutorNode executor, TRegexDFAExecutorNode executorNode, short transitionIndex, int currentIndex) { for (short possibleTransition : precedingTransitions) { if (transitionIndex == possibleTransition) { executorNode.getCGTransitions()[possibleTransition].getTransitionToFinalState().applyPreFinalStateTransition( executor, executorNode.getCGData(frame), executorNode.isSearching(), currentIndex); return; } } throw shouldNotReachHere(); }