Skip to content

Instantly share code, notes, and snippets.

View vbabanin's full-sized avatar
🎯
1

Viacheslav Babanin vbabanin

🎯
1
View GitHub Profile
@vbabanin
vbabanin / gist:1e21a96e7d042ba03772d6aacf45071c
Created April 16, 2025 23:54
writeOnBuffersAsccii C2 compiled
=================== C2-compiled nmethod ==============================
----------------------------------- Assembly -----------------------------------
Compiled method (c2) 1353 1800 4 com.mongodb.internal.connection.ByteBufferBsonOutput::writeOnBuffersAsccii (149 bytes)
total in heap [0x0000000113a12890,0x0000000113a14628] = 7576
relocation [0x0000000113a129e8,0x0000000113a12be8] = 512
main code [0x0000000113a12c00,0x0000000113a139c0] = 3520
stub code [0x0000000113a139c0,0x0000000113a13cd0] = 784
oops [0x0000000113a13cd0,0x0000000113a13cd8] = 8
metadata [0x0000000113a13cd8,0x0000000113a13de8] = 272
"# {method} {0x00000001322f35d8} 'writeOnBuffersAsccii' '(Ljava/lang/String;ZIIILorg/bson/ByteBuf;)I' in 'com/mongodb/internal/connection/ByteBufferBsonOutput'
# this: c_rarg1:c_rarg1 = 'com/mongodb/internal/connection/ByteBufferBsonOutput'
# parm0: c_rarg2:c_rarg2 = 'java/lang/String'
# parm1: c_rarg3 = boolean
# parm2: c_rarg4 = int
# parm3: c_rarg5 = int
# parm4: c_rarg6 = int
# parm5: c_rarg7:c_rarg7 = 'org/bson/ByteBuf'
# [sp+0x70] (sp of caller)
[Entry Point]
int writeOnBuffersAsccii(String str, boolean checkNullTermination, int stringPointer,
int bufferLimit, int bufferPos, ByteBuf buffer) {
int sp = stringPointer;
int curBufferPos = bufferPos;
int curBufferLimit = bufferLimit;
ByteBuf curBuffer = buffer;
int length = str.length();
int remaining;
main_loop: