final class sun.nio.ch.KQueuePort extends sun.nio.ch.Port
minor version: 0
major version: 59
flags: flags: (0x0030) ACC_FINAL, ACC_SUPER
this_class: sun.nio.ch.KQueuePort
super_class: sun.nio.ch.Port
{
private static final int MAX_KEVENTS_TO_POLL;
descriptor: I
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: 512
private final int kqfd;
descriptor: I
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private final long address;
descriptor: J
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private boolean closed;
descriptor: Z
flags: (0x0002) ACC_PRIVATE
private final int[] sp;
descriptor: [I
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private final java.util.concurrent.atomic.AtomicInteger wakeupCount;
descriptor: Ljava/util/concurrent/atomic/AtomicInteger;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private final java.util.concurrent.ArrayBlockingQueue<sun.nio.ch.KQueuePort$Event> queue;
descriptor: Ljava/util/concurrent/ArrayBlockingQueue;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
Signature: Ljava/util/concurrent/ArrayBlockingQueue<Lsun/nio/ch/KQueuePort$Event;>;
private final sun.nio.ch.KQueuePort$Event NEED_TO_POLL;
descriptor: Lsun/nio/ch/KQueuePort$Event;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private final sun.nio.ch.KQueuePort$Event EXECUTE_TASK_OR_SHUTDOWN;
descriptor: Lsun/nio/ch/KQueuePort$Event;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
void <init>(java.nio.channels.spi.AsynchronousChannelProvider, sun.nio.ch.ThreadPool);
descriptor: (Ljava/nio/channels/spi/AsynchronousChannelProvider;Lsun/nio/ch/ThreadPool;)V
flags: (0x0000)
Code:
stack=7, locals=5, args_size=3
start local 0 start local 1 start local 2 0: aload 0
aload 1
aload 2
invokespecial sun.nio.ch.Port.<init>:(Ljava/nio/channels/spi/AsynchronousChannelProvider;Lsun/nio/ch/ThreadPool;)V
1: aload 0
new java.util.concurrent.atomic.AtomicInteger
dup
invokespecial java.util.concurrent.atomic.AtomicInteger.<init>:()V
putfield sun.nio.ch.KQueuePort.wakeupCount:Ljava/util/concurrent/atomic/AtomicInteger;
2: aload 0
new sun.nio.ch.KQueuePort$Event
dup
aconst_null
iconst_0
invokespecial sun.nio.ch.KQueuePort$Event.<init>:(Lsun/nio/ch/Port$PollableChannel;I)V
putfield sun.nio.ch.KQueuePort.NEED_TO_POLL:Lsun/nio/ch/KQueuePort$Event;
3: aload 0
new sun.nio.ch.KQueuePort$Event
dup
aconst_null
iconst_0
invokespecial sun.nio.ch.KQueuePort$Event.<init>:(Lsun/nio/ch/Port$PollableChannel;I)V
putfield sun.nio.ch.KQueuePort.EXECUTE_TASK_OR_SHUTDOWN:Lsun/nio/ch/KQueuePort$Event;
4: aload 0
invokestatic sun.nio.ch.KQueue.create:()I
putfield sun.nio.ch.KQueuePort.kqfd:I
5: aload 0
sipush 512
invokestatic sun.nio.ch.KQueue.allocatePollArray:(I)J
putfield sun.nio.ch.KQueuePort.address:J
6: iconst_1
invokestatic sun.nio.ch.IOUtil.makePipe:(Z)J
lstore 3
start local 3 7: aload 0
iconst_2
newarray 10
dup
iconst_0
lload 3
bipush 32
lushr
l2i
iastore
dup
iconst_1
lload 3
l2i
iastore
putfield sun.nio.ch.KQueuePort.sp:[I
end local 3 8: goto 13
StackMap locals: sun.nio.ch.KQueuePort java.nio.channels.spi.AsynchronousChannelProvider sun.nio.ch.ThreadPool
StackMap stack: java.io.IOException
9: astore 3
start local 3 10: aload 0
getfield sun.nio.ch.KQueuePort.address:J
invokestatic sun.nio.ch.KQueue.freePollArray:(J)V
11: aload 0
getfield sun.nio.ch.KQueuePort.kqfd:I
invokestatic sun.nio.ch.FileDispatcherImpl.closeIntFD:(I)V
12: aload 3
athrow
end local 3 13: StackMap locals:
StackMap stack:
aload 0
getfield sun.nio.ch.KQueuePort.kqfd:I
aload 0
getfield sun.nio.ch.KQueuePort.sp:[I
iconst_0
iaload
iconst_m1
iconst_1
invokestatic sun.nio.ch.KQueue.register:(IIII)I
pop
14: aload 0
new java.util.concurrent.ArrayBlockingQueue
dup
sipush 512
invokespecial java.util.concurrent.ArrayBlockingQueue.<init>:(I)V
putfield sun.nio.ch.KQueuePort.queue:Ljava/util/concurrent/ArrayBlockingQueue;
15: aload 0
getfield sun.nio.ch.KQueuePort.queue:Ljava/util/concurrent/ArrayBlockingQueue;
aload 0
getfield sun.nio.ch.KQueuePort.NEED_TO_POLL:Lsun/nio/ch/KQueuePort$Event;
invokevirtual java.util.concurrent.ArrayBlockingQueue.offer:(Ljava/lang/Object;)Z
pop
16: return
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 17 0 this Lsun/nio/ch/KQueuePort;
0 17 1 provider Ljava/nio/channels/spi/AsynchronousChannelProvider;
0 17 2 pool Lsun/nio/ch/ThreadPool;
7 8 3 fds J
10 13 3 ioe Ljava/io/IOException;
Exception table:
from to target type
6 8 9 Class java.io.IOException
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
provider
pool
sun.nio.ch.KQueuePort start();
descriptor: ()Lsun/nio/ch/KQueuePort;
flags: (0x0000)
Code:
stack=4, locals=1, args_size=1
start local 0 0: aload 0
new sun.nio.ch.KQueuePort$EventHandlerTask
dup
aload 0
invokespecial sun.nio.ch.KQueuePort$EventHandlerTask.<init>:(Lsun/nio/ch/KQueuePort;)V
invokevirtual sun.nio.ch.KQueuePort.startThreads:(Ljava/lang/Runnable;)V
1: aload 0
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Lsun/nio/ch/KQueuePort;
private void implClose();
descriptor: ()V
flags: (0x0002) ACC_PRIVATE
Code:
stack=2, locals=2, args_size=1
start local 0 0: aload 0
dup
astore 1
monitorenter
1: aload 0
getfield sun.nio.ch.KQueuePort.closed:Z
ifeq 4
2: aload 1
monitorexit
3: return
4: StackMap locals: sun.nio.ch.KQueuePort
StackMap stack:
aload 0
iconst_1
putfield sun.nio.ch.KQueuePort.closed:Z
5: aload 1
monitorexit
6: goto 9
StackMap locals:
StackMap stack: java.lang.Throwable
7: aload 1
monitorexit
8: athrow
9: StackMap locals:
StackMap stack:
aload 0
getfield sun.nio.ch.KQueuePort.kqfd:I
invokestatic sun.nio.ch.FileDispatcherImpl.closeIntFD:(I)V
10: goto 12
StackMap locals:
StackMap stack: java.io.IOException
11: pop
12: StackMap locals:
StackMap stack:
aload 0
getfield sun.nio.ch.KQueuePort.sp:[I
iconst_0
iaload
invokestatic sun.nio.ch.FileDispatcherImpl.closeIntFD:(I)V
13: goto 15
StackMap locals:
StackMap stack: java.io.IOException
14: pop
15: StackMap locals:
StackMap stack:
aload 0
getfield sun.nio.ch.KQueuePort.sp:[I
iconst_1
iaload
invokestatic sun.nio.ch.FileDispatcherImpl.closeIntFD:(I)V
16: goto 18
StackMap locals:
StackMap stack: java.io.IOException
17: pop
18: StackMap locals:
StackMap stack:
aload 0
getfield sun.nio.ch.KQueuePort.address:J
invokestatic sun.nio.ch.KQueue.freePollArray:(J)V
19: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 20 0 this Lsun/nio/ch/KQueuePort;
Exception table:
from to target type
1 3 7 any
4 6 7 any
7 8 7 any
9 10 11 Class java.io.IOException
12 13 14 Class java.io.IOException
15 16 17 Class java.io.IOException
private void wakeup();
descriptor: ()V
flags: (0x0002) ACC_PRIVATE
Code:
stack=3, locals=2, args_size=1
start local 0 0: aload 0
getfield sun.nio.ch.KQueuePort.wakeupCount:Ljava/util/concurrent/atomic/AtomicInteger;
invokevirtual java.util.concurrent.atomic.AtomicInteger.incrementAndGet:()I
iconst_1
if_icmpne 5
1: aload 0
getfield sun.nio.ch.KQueuePort.sp:[I
iconst_1
iaload
iconst_0
invokestatic sun.nio.ch.IOUtil.write1:(IB)I
pop
2: goto 5
StackMap locals:
StackMap stack: java.io.IOException
3: astore 1
start local 1 4: new java.lang.AssertionError
dup
aload 1
invokespecial java.lang.AssertionError.<init>:(Ljava/lang/Object;)V
athrow
end local 1 5: StackMap locals:
StackMap stack:
return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 6 0 this Lsun/nio/ch/KQueuePort;
4 5 1 x Ljava/io/IOException;
Exception table:
from to target type
1 2 3 Class java.io.IOException
void executeOnHandlerTask(java.lang.Runnable);
descriptor: (Ljava/lang/Runnable;)V
flags: (0x0000)
Code:
stack=2, locals=3, args_size=2
start local 0 start local 1 0: aload 0
dup
astore 2
monitorenter
1: aload 0
getfield sun.nio.ch.KQueuePort.closed:Z
ifeq 3
2: new java.util.concurrent.RejectedExecutionException
dup
invokespecial java.util.concurrent.RejectedExecutionException.<init>:()V
athrow
3: StackMap locals: sun.nio.ch.KQueuePort
StackMap stack:
aload 0
aload 1
invokevirtual sun.nio.ch.KQueuePort.offerTask:(Ljava/lang/Runnable;)V
4: aload 0
invokevirtual sun.nio.ch.KQueuePort.wakeup:()V
5: aload 2
monitorexit
6: goto 9
StackMap locals:
StackMap stack: java.lang.Throwable
7: aload 2
monitorexit
8: athrow
9: StackMap locals:
StackMap stack:
return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 10 0 this Lsun/nio/ch/KQueuePort;
0 10 1 task Ljava/lang/Runnable;
Exception table:
from to target type
1 6 7 any
7 8 7 any
MethodParameters:
Name Flags
task
void shutdownHandlerTasks();
descriptor: ()V
flags: (0x0000)
Code:
stack=1, locals=2, args_size=1
start local 0 0: aload 0
invokevirtual sun.nio.ch.KQueuePort.threadCount:()I
istore 1
start local 1 1: iload 1
ifne 5
2: aload 0
invokevirtual sun.nio.ch.KQueuePort.implClose:()V
3: goto 6
4: StackMap locals: int
StackMap stack:
aload 0
invokevirtual sun.nio.ch.KQueuePort.wakeup:()V
5: StackMap locals:
StackMap stack:
iload 1
iinc 1 -1
ifgt 4
6: StackMap locals:
StackMap stack:
return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 7 0 this Lsun/nio/ch/KQueuePort;
1 7 1 nThreads I
void startPoll(int, int);
descriptor: (II)V
flags: (0x0000)
Code:
stack=5, locals=5, args_size=3
start local 0 start local 1 start local 2 0: iconst_0
istore 3
start local 3 1: bipush 17
istore 4
start local 4 2: iload 2
getstatic sun.nio.ch.Net.POLLIN:S
iand
ifle 4
3: aload 0
getfield sun.nio.ch.KQueuePort.kqfd:I
iload 1
iconst_m1
iload 4
invokestatic sun.nio.ch.KQueue.register:(IIII)I
istore 3
4: StackMap locals: int int
StackMap stack:
iload 3
ifne 6
iload 2
getstatic sun.nio.ch.Net.POLLOUT:S
iand
ifle 6
5: aload 0
getfield sun.nio.ch.KQueuePort.kqfd:I
iload 1
bipush -2
iload 4
invokestatic sun.nio.ch.KQueue.register:(IIII)I
istore 3
6: StackMap locals:
StackMap stack:
iload 3
ifeq 8
7: new java.lang.InternalError
dup
new java.lang.StringBuilder
dup
ldc "kevent failed: "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
iload 3
invokevirtual java.lang.StringBuilder.append:(I)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
invokespecial java.lang.InternalError.<init>:(Ljava/lang/String;)V
athrow
8: StackMap locals:
StackMap stack:
return
end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 9 0 this Lsun/nio/ch/KQueuePort;
0 9 1 fd I
0 9 2 events I
1 9 3 err I
2 9 4 flags I
MethodParameters:
Name Flags
fd
events
}
SourceFile: "KQueuePort.java"
NestMembers:
sun.nio.ch.KQueuePort$Event sun.nio.ch.KQueuePort$EventHandlerTask
InnerClasses:
Event = sun.nio.ch.KQueuePort$Event of sun.nio.ch.KQueuePort
private EventHandlerTask = sun.nio.ch.KQueuePort$EventHandlerTask of sun.nio.ch.KQueuePort
abstract PollableChannel = sun.nio.ch.Port$PollableChannel of sun.nio.ch.Port