public class com.mongodb.internal.connection.PowerOfTwoBufferPool implements com.mongodb.connection.BufferProvider
minor version: 0
major version: 59
flags: flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: com.mongodb.internal.connection.PowerOfTwoBufferPool
super_class: java.lang.Object
{
private final java.util.Map<java.lang.Integer, com.mongodb.internal.connection.ConcurrentPool<java.nio.ByteBuffer>> powerOfTwoToPoolMap;
descriptor: Ljava/util/Map;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
Signature: Ljava/util/Map<Ljava/lang/Integer;Lcom/mongodb/internal/connection/ConcurrentPool<Ljava/nio/ByteBuffer;>;>;
public void <init>();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
bipush 24
invokespecial com.mongodb.internal.connection.PowerOfTwoBufferPool.<init>:(I)V
1: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Lcom/mongodb/internal/connection/PowerOfTwoBufferPool;
public void <init>(int);
descriptor: (I)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=9, locals=5, args_size=2
start local 0 start local 1 0: aload 0
invokespecial java.lang.Object.<init>:()V
1: aload 0
new java.util.HashMap
dup
invokespecial java.util.HashMap.<init>:()V
putfield com.mongodb.internal.connection.PowerOfTwoBufferPool.powerOfTwoToPoolMap:Ljava/util/Map;
2: iconst_1
istore 2
start local 2 3: iconst_0
istore 3
start local 3 4: goto 11
5: StackMap locals: com.mongodb.internal.connection.PowerOfTwoBufferPool int int int
StackMap stack:
iload 2
istore 4
start local 4 6: aload 0
getfield com.mongodb.internal.connection.PowerOfTwoBufferPool.powerOfTwoToPoolMap:Ljava/util/Map;
iload 3
invokestatic java.lang.Integer.valueOf:(I)Ljava/lang/Integer;
new com.mongodb.internal.connection.ConcurrentPool
dup
ldc 2147483647
7: new com.mongodb.internal.connection.PowerOfTwoBufferPool$1
dup
aload 0
iload 4
invokespecial com.mongodb.internal.connection.PowerOfTwoBufferPool$1.<init>:(Lcom/mongodb/internal/connection/PowerOfTwoBufferPool;I)V
invokespecial com.mongodb.internal.connection.ConcurrentPool.<init>:(ILcom/mongodb/internal/connection/ConcurrentPool$ItemFactory;)V
8: invokeinterface java.util.Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
pop
9: iload 2
iconst_1
ishl
istore 2
end local 4 10: iinc 3 1
StackMap locals:
StackMap stack:
11: iload 3
iload 1
if_icmple 5
end local 3 12: return
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 13 0 this Lcom/mongodb/internal/connection/PowerOfTwoBufferPool;
0 13 1 highestPowerOfTwo I
3 13 2 powerOfTwo I
4 12 3 i I
6 10 4 size I
MethodParameters:
Name Flags
highestPowerOfTwo final
public org.bson.ByteBuf getBuffer(int);
descriptor: (I)Lorg/bson/ByteBuf;
flags: (0x0001) ACC_PUBLIC
Code:
stack=4, locals=4, args_size=2
start local 0 start local 1 0: aload 0
getfield com.mongodb.internal.connection.PowerOfTwoBufferPool.powerOfTwoToPoolMap:Ljava/util/Map;
iload 1
invokestatic com.mongodb.internal.connection.PowerOfTwoBufferPool.roundUpToNextHighestPowerOfTwo:(I)I
invokestatic com.mongodb.internal.connection.PowerOfTwoBufferPool.log2:(I)I
invokestatic java.lang.Integer.valueOf:(I)Ljava/lang/Integer;
invokeinterface java.util.Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
checkcast com.mongodb.internal.connection.ConcurrentPool
astore 2
start local 2 1: aload 2
ifnonnull 2
aload 0
iload 1
invokevirtual com.mongodb.internal.connection.PowerOfTwoBufferPool.createNew:(I)Ljava/nio/ByteBuffer;
goto 3
StackMap locals: com.mongodb.internal.connection.ConcurrentPool
StackMap stack:
2: aload 2
invokevirtual com.mongodb.internal.connection.ConcurrentPool.get:()Ljava/lang/Object;
checkcast java.nio.ByteBuffer
StackMap locals:
StackMap stack: java.nio.ByteBuffer
3: astore 3
start local 3 4: aload 3
invokevirtual java.nio.Buffer.clear:()Ljava/nio/Buffer;
pop
5: aload 3
iload 1
invokevirtual java.nio.Buffer.limit:(I)Ljava/nio/Buffer;
pop
6: new com.mongodb.internal.connection.PowerOfTwoBufferPool$PooledByteBufNIO
dup
aload 0
aload 3
invokespecial com.mongodb.internal.connection.PowerOfTwoBufferPool$PooledByteBufNIO.<init>:(Lcom/mongodb/internal/connection/PowerOfTwoBufferPool;Ljava/nio/ByteBuffer;)V
areturn
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 7 0 this Lcom/mongodb/internal/connection/PowerOfTwoBufferPool;
0 7 1 size I
1 7 2 pool Lcom/mongodb/internal/connection/ConcurrentPool<Ljava/nio/ByteBuffer;>;
4 7 3 byteBuffer Ljava/nio/ByteBuffer;
MethodParameters:
Name Flags
size final
private java.nio.ByteBuffer createNew(int);
descriptor: (I)Ljava/nio/ByteBuffer;
flags: (0x0002) ACC_PRIVATE
Code:
stack=2, locals=3, args_size=2
start local 0 start local 1 0: iload 1
invokestatic java.nio.ByteBuffer.allocate:(I)Ljava/nio/ByteBuffer;
astore 2
start local 2 1: aload 2
getstatic java.nio.ByteOrder.LITTLE_ENDIAN:Ljava/nio/ByteOrder;
invokevirtual java.nio.ByteBuffer.order:(Ljava/nio/ByteOrder;)Ljava/nio/ByteBuffer;
pop
2: aload 2
areturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Lcom/mongodb/internal/connection/PowerOfTwoBufferPool;
0 3 1 size I
1 3 2 buf Ljava/nio/ByteBuffer;
MethodParameters:
Name Flags
size final
private void release(java.nio.ByteBuffer);
descriptor: (Ljava/nio/ByteBuffer;)V
flags: (0x0002) ACC_PRIVATE
Code:
stack=2, locals=3, args_size=2
start local 0 start local 1 0: aload 0
getfield com.mongodb.internal.connection.PowerOfTwoBufferPool.powerOfTwoToPoolMap:Ljava/util/Map;
aload 1
invokevirtual java.nio.ByteBuffer.capacity:()I
invokestatic com.mongodb.internal.connection.PowerOfTwoBufferPool.roundUpToNextHighestPowerOfTwo:(I)I
invokestatic com.mongodb.internal.connection.PowerOfTwoBufferPool.log2:(I)I
invokestatic java.lang.Integer.valueOf:(I)Ljava/lang/Integer;
invokeinterface java.util.Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
checkcast com.mongodb.internal.connection.ConcurrentPool
astore 2
start local 2 1: aload 2
ifnull 3
2: aload 2
aload 1
invokevirtual com.mongodb.internal.connection.ConcurrentPool.release:(Ljava/lang/Object;)V
3: StackMap locals: com.mongodb.internal.connection.ConcurrentPool
StackMap stack:
return
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 4 0 this Lcom/mongodb/internal/connection/PowerOfTwoBufferPool;
0 4 1 buffer Ljava/nio/ByteBuffer;
1 4 2 pool Lcom/mongodb/internal/connection/ConcurrentPool<Ljava/nio/ByteBuffer;>;
MethodParameters:
Name Flags
buffer final
static int log2(int);
descriptor: (I)I
flags: (0x0008) ACC_STATIC
Code:
stack=2, locals=1, args_size=1
start local 0 0: bipush 31
iload 0
invokestatic java.lang.Integer.numberOfLeadingZeros:(I)I
isub
ireturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 powerOfTwo I
MethodParameters:
Name Flags
powerOfTwo final
static int roundUpToNextHighestPowerOfTwo(int);
descriptor: (I)I
flags: (0x0008) ACC_STATIC
Code:
stack=3, locals=2, args_size=1
start local 0 0: iload 0
istore 1
start local 1 1: iinc 1 -1
2: iload 1
iload 1
iconst_1
ishr
ior
istore 1
3: iload 1
iload 1
iconst_2
ishr
ior
istore 1
4: iload 1
iload 1
iconst_4
ishr
ior
istore 1
5: iload 1
iload 1
bipush 8
ishr
ior
istore 1
6: iload 1
iload 1
bipush 16
ishr
ior
istore 1
7: iinc 1 1
8: iload 1
ireturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 9 0 size I
1 9 1 v I
MethodParameters:
Name Flags
size final
}
SourceFile: "PowerOfTwoBufferPool.java"
NestMembers:
com.mongodb.internal.connection.PowerOfTwoBufferPool$1 com.mongodb.internal.connection.PowerOfTwoBufferPool$PooledByteBufNIO
InnerClasses:
public abstract ItemFactory = com.mongodb.internal.connection.ConcurrentPool$ItemFactory of com.mongodb.internal.connection.ConcurrentPool
com.mongodb.internal.connection.PowerOfTwoBufferPool$1
private PooledByteBufNIO = com.mongodb.internal.connection.PowerOfTwoBufferPool$PooledByteBufNIO of com.mongodb.internal.connection.PowerOfTwoBufferPool