Skip to content

Commit

Permalink
Treat "truffle-unused" warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
fniephaus committed Dec 5, 2023
1 parent c13b6a0 commit 76068ce
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ public static HandlePrimitiveFailedNode create(final CompiledCodeObject code) {
public abstract void executeHandle(VirtualFrame frame, int reasonCode);

protected abstract static class HandlePrimitiveFailedImplNode extends HandlePrimitiveFailedNode {
@Specialization(guards = {"reasonCode < sizeNode.execute(getContext().primitiveErrorTable)"}, limit = "1")
@Specialization(guards = {"reasonCode < sizeNode.execute(getContext().primitiveErrorTable)"})
protected final void doHandleWithLookup(final VirtualFrame frame, final int reasonCode,
@SuppressWarnings("unused") @Shared("sizeNode") @Cached final ArrayObjectSizeNode sizeNode,
@Cached final ArrayObjectReadNode readNode,
@Cached("createStackTopNode(frame)") final FrameStackWriteNode tempWriteNode) {
tempWriteNode.executeWrite(frame, readNode.execute(getContext().primitiveErrorTable, reasonCode));
}

@Specialization(guards = {"reasonCode >= sizeNode.execute(getContext().primitiveErrorTable)"}, limit = "1")
@Specialization(guards = {"reasonCode >= sizeNode.execute(getContext().primitiveErrorTable)"})
protected static final void doHandleRawValue(final VirtualFrame frame, final int reasonCode,
@SuppressWarnings("unused") @Shared("sizeNode") @Cached final ArrayObjectSizeNode sizeNode,
@Cached("createStackTopNode(frame)") final FrameStackWriteNode tempWriteNode) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,14 @@ protected static GetOrCreateContextOrMarkerNode create() {

protected abstract Object execute(VirtualFrame frame, CompiledCodeObject code);

@Specialization(guards = "doesNotNeedSender(code, assumptionProfile)", limit = "1")
@Specialization(guards = "doesNotNeedSender(code, assumptionProfile)")
protected static final Object doGetContextOrMarker(final VirtualFrame frame, @SuppressWarnings("unused") final CompiledCodeObject code,
@SuppressWarnings("unused") @Shared("assumptionProfile") @Cached("createClassProfile()") final ValueProfile assumptionProfile,
@Cached final GetContextOrMarkerNode getContextOrMarkerNode) {
return getContextOrMarkerNode.execute(frame);
}

@Specialization(guards = "!doesNotNeedSender(code, assumptionProfile)", limit = "1")
@Specialization(guards = "!doesNotNeedSender(code, assumptionProfile)")
protected static final ContextObject doGetOrCreateContext(final VirtualFrame frame, @SuppressWarnings("unused") final CompiledCodeObject code,
@SuppressWarnings("unused") @Shared("assumptionProfile") @Cached("createClassProfile()") final ValueProfile assumptionProfile,
@Cached final GetOrCreateContextNode getOrCreateContextNode) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ protected final Object doDirectWithSender(final VirtualFrame frame, @SuppressWar
}

@ReportPolymorphism.Megamorphic
@Specialization(guards = "doesNotNeedSender(method, assumptionProfile)", replaces = {"doDirect", "doDirectWithSender"}, limit = "1")
@Specialization(guards = "doesNotNeedSender(method, assumptionProfile)", replaces = {"doDirect", "doDirectWithSender"})
protected static final Object doIndirect(final VirtualFrame frame, final CompiledCodeObject method, final Object[] receiverAndArguments,
@Cached final GetContextOrMarkerNode getContextOrMarkerNode,
@SuppressWarnings("unused") @Shared("assumptionProfile") @Cached("createClassProfile()") final ValueProfile assumptionProfile,
Expand All @@ -89,7 +89,7 @@ protected static final Object doIndirect(final VirtualFrame frame, final Compile
}

@ReportPolymorphism.Megamorphic
@Specialization(guards = "!doesNotNeedSender(method, assumptionProfile)", replaces = {"doDirect", "doDirectWithSender"}, limit = "1")
@Specialization(guards = "!doesNotNeedSender(method, assumptionProfile)", replaces = {"doDirect", "doDirectWithSender"})
protected final Object doIndirectWithSender(final VirtualFrame frame, final CompiledCodeObject method, final Object[] receiverAndArguments,
@SuppressWarnings("unused") @Shared("assumptionProfile") @Cached("createClassProfile()") final ValueProfile assumptionProfile,
@Cached final IndirectCallNode callNode) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ protected final Object doResume(final VirtualFrame frame, final PointersObject r
@SqueakPrimitive(indices = 88)
protected abstract static class PrimSuspendNode extends AbstractPrimitiveStackPushNode implements UnaryPrimitiveFallback {

@Specialization(guards = "receiver == getActiveProcessNode.execute()", limit = "1")
@Specialization(guards = "receiver == getActiveProcessNode.execute()")
protected final Object doSuspendActiveProcess(final VirtualFrame frame, @SuppressWarnings("unused") final PointersObject receiver,
@SuppressWarnings("unused") @Shared("getActiveProcessNode") @Cached final GetActiveProcessNode getActiveProcessNode,
@Cached final WakeHighestPriorityNode wakeHighestPriorityNode) {
Expand All @@ -436,7 +436,7 @@ protected final Object doSuspendActiveProcess(final VirtualFrame frame, @Suppres
throw CompilerDirectives.shouldNotReachHere();
}

@Specialization(guards = {"receiver != getActiveProcessNode.execute()"}, limit = "1")
@Specialization(guards = {"receiver != getActiveProcessNode.execute()"})
protected static final PointersObject doSuspendOtherProcess(final PointersObject receiver,
@SuppressWarnings("unused") @Shared("getActiveProcessNode") @Cached final GetActiveProcessNode getActiveProcessNode,
@Cached final RemoveProcessFromListNode removeProcessNode,
Expand All @@ -458,7 +458,7 @@ protected static final PointersObject doSuspendOtherProcess(final PointersObject
@SqueakPrimitive(indices = 578)
protected abstract static class PrimSuspendBackingUpV2Node extends AbstractPrimitiveStackPushNode implements UnaryPrimitiveFallback {

@Specialization(guards = "receiver == getActiveProcessNode.execute()", limit = "1")
@Specialization(guards = "receiver == getActiveProcessNode.execute()")
protected final Object doSuspendActiveProcess(final VirtualFrame frame, @SuppressWarnings("unused") final PointersObject receiver,
@SuppressWarnings("unused") @Shared("getActiveProcessNode") @Cached final GetActiveProcessNode getActiveProcessNode,
@Cached final WakeHighestPriorityNode wakeHighestPriorityNode) {
Expand All @@ -472,7 +472,7 @@ protected final Object doSuspendActiveProcess(final VirtualFrame frame, @Suppres
return NilObject.SINGLETON;
}

@Specialization(guards = {"receiver != getActiveProcessNode.execute()"}, limit = "1")
@Specialization(guards = {"receiver != getActiveProcessNode.execute()"})
protected final Object doSuspendOtherProcess(final PointersObject receiver,
@SuppressWarnings("unused") @Shared("getActiveProcessNode") @Cached final GetActiveProcessNode getActiveProcessNode,
@Cached final RemoveProcessFromListNode removeProcessNode,
Expand Down Expand Up @@ -985,13 +985,13 @@ protected static final boolean doEnterNilOwner(final PointersObject mutex,
}

@SuppressWarnings("unused")
@Specialization(guards = "activeProcessMutexOwner(mutex, getActiveProcessNode)", limit = "1")
@Specialization(guards = "activeProcessMutexOwner(mutex, getActiveProcessNode)")
protected static final boolean doEnterActiveProcessOwner(final PointersObject mutex,
@Shared("getActiveProcessNode") @Cached final GetActiveProcessNode getActiveProcessNode) {
return BooleanObject.TRUE;
}

@Specialization(guards = {"!ownerIsNil(mutex)", "!activeProcessMutexOwner(mutex, getActiveProcessNode)"}, limit = "1")
@Specialization(guards = {"!ownerIsNil(mutex)", "!activeProcessMutexOwner(mutex, getActiveProcessNode)"})
protected final Object doEnter(final VirtualFrame frame, final PointersObject mutex,
@Cached final AddLastLinkToListNode addLastLinkToListNode,
@Cached final WakeHighestPriorityNode wakeHighestPriorityNode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ public static SignalSemaphoreNode create() {

public abstract void executeSignal(VirtualFrame frame, Object semaphore);

@Specialization(guards = {"isSemaphore(semaphore)", "semaphore.isEmptyList(readNode)"}, limit = "1")
@Specialization(guards = {"isSemaphore(semaphore)", "semaphore.isEmptyList(readNode)"})
protected static final void doSignalEmpty(final PointersObject semaphore,
@Shared("readNode") @Cached final AbstractPointersObjectReadNode readNode,
@Shared("writeNode") @Cached final AbstractPointersObjectWriteNode writeNode) {
writeNode.execute(semaphore, SEMAPHORE.EXCESS_SIGNALS, readNode.executeLong(semaphore, SEMAPHORE.EXCESS_SIGNALS) + 1);
}

@Specialization(guards = {"isSemaphore(semaphore)", "!semaphore.isEmptyList(readNode)"}, limit = "1")
@Specialization(guards = {"isSemaphore(semaphore)", "!semaphore.isEmptyList(readNode)"})
protected static final void doSignal(final VirtualFrame frame, final PointersObject semaphore,
@Shared("readNode") @Cached final AbstractPointersObjectReadNode readNode,
@Shared("writeNode") @Cached final AbstractPointersObjectWriteNode writeNode,
Expand Down

0 comments on commit 76068ce

Please sign in to comment.