name
string | code
string | asm
string | file
string |
|---|---|---|---|
N_VWrmsNormMaskVectorArray_ManyVector
|
SUNErrCode MVAPPEND(N_VWrmsNormMaskVectorArray)(int nvec, N_Vector* X,
N_Vector* W, N_Vector id,
sunrealtype* nrm)
{
SUNFunctionBegin(X[0]->sunctx);
sunindextype i;
SUNAssert(nvec > 0, SUN_ERR_ARG_OUTOFRANGE);
/* call N_VWSqrSumMaskLocal for each (X[i],W[i]) pair */
for (i = 0; i < nvec; i++)
{
nrm[i] = N_VWSqrSumMaskLocal(X[i], W[i], id);
SUNCheckLastErr();
}
/* accumulate totals */
#ifdef MANYVECTOR_BUILD_WITH_MPI
if (MANYVECTOR_COMM(X[0]) != MPI_COMM_NULL)
{
SUNCheckMPICall(MPI_Allreduce(MPI_IN_PLACE, nrm, nvec, MPI_SUNREALTYPE,
MPI_SUM, MANYVECTOR_COMM(X[0])));
}
#endif
/* finish off WRMS norms and return */
for (i = 0; i < nvec; i++)
{
nrm[i] = SUNRsqrt(nrm[i] / (MANYVECTOR_GLOBLENGTH(X[i])));
}
return SUN_SUCCESS;
}
|
subq $0x48, %rsp
movl %edi, 0x44(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movq %r8, 0x20(%rsp)
movq 0x38(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq %rax, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
movq 0x10(%rsp), %rax
movslq 0x44(%rsp), %rcx
cmpq %rcx, %rax
jge 0x4eea
movq 0x38(%rsp), %rax
movq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
movq 0x30(%rsp), %rax
movq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
movq 0x28(%rsp), %rdx
callq 0x3310
movq 0x20(%rsp), %rax
movq 0x10(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0x4e96
movq $0x0, 0x10(%rsp)
movq 0x10(%rsp), %rax
movslq 0x44(%rsp), %rcx
cmpq %rcx, %rax
jge 0x4fa1
movq 0x20(%rsp), %rax
movq 0x10(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
movq 0x38(%rsp), %rax
movq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rax
cvtsi2sdq 0x8(%rax), %xmm0
divsd %xmm0, %xmm1
xorps %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jb 0x4f44
xorps %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
jmp 0x4f79
movq 0x20(%rsp), %rax
movq 0x10(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq 0x38(%rsp), %rax
movq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rax
cvtsi2sdq 0x8(%rax), %xmm1
divsd %xmm1, %xmm0
callq 0x32f0
movsd %xmm0, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
movq 0x20(%rsp), %rax
movq 0x10(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0x4ef3
xorl %eax, %eax
addq $0x48, %rsp
retq
nopl (%rax,%rax)
|
/opencor[P]sundials/src/nvector/manyvector/nvector_manyvector.c
|
N_VWSqrSumLocal_ManyVector
|
sunrealtype MVAPPEND(N_VWSqrSumLocal)(N_Vector x, N_Vector w)
{
SUNFunctionBegin(x->sunctx);
sunindextype i, N;
sunrealtype sum, contrib;
#ifdef MANYVECTOR_BUILD_WITH_MPI
int rank;
#endif
/* initialize output*/
sum = ZERO;
for (i = 0; i < MANYVECTOR_NUM_SUBVECS(x); i++)
{
#ifdef MANYVECTOR_BUILD_WITH_MPI
/* check for nvwsqrsumlocal in subvector */
if (MANYVECTOR_SUBVEC(x, i)->ops->nvwsqrsumlocal)
{
sum += N_VWSqrSumLocal(MANYVECTOR_SUBVEC(x, i), MANYVECTOR_SUBVEC(w, i));
SUNCheckLastErrNoRet();
/* otherwise, call nvwrmsnorm, and accumulate to overall sum on root task */
}
else
{
contrib = N_VWrmsNorm(MANYVECTOR_SUBVEC(x, i), MANYVECTOR_SUBVEC(w, i));
SUNCheckLastErrNoRet();
/* get this task's rank in subvector communicator (note: serial
subvectors will result in rank==0) */
rank = SubvectorMPIRank(MANYVECTOR_SUBVEC(x, i));
if (rank < 0) { return (ZERO); }
if (rank == 0)
{
N = N_VGetLength(MANYVECTOR_SUBVEC(x, i));
SUNCheckLastErrNoRet();
sum += (contrib * contrib * N);
}
}
#else
/* accumulate subvector contribution to overall sum */
contrib = N_VWrmsNorm(MANYVECTOR_SUBVEC(x, i), MANYVECTOR_SUBVEC(w, i));
SUNCheckLastErrNoRet();
N = N_VGetLength(MANYVECTOR_SUBVEC(x, i));
SUNCheckLastErrNoRet();
sum += (contrib * contrib * N);
#endif
}
return (sum);
}
|
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x20(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
movq $0x0, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq 0x30(%rsp), %rcx
movq (%rcx), %rcx
cmpq (%rcx), %rax
jge 0x507f
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq 0x18(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq 0x18(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x3210
movsd %xmm0, (%rsp)
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq 0x18(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x3120
movq %rax, 0x10(%rsp)
movsd (%rsp), %xmm0
mulsd (%rsp), %xmm0
cvtsi2sdq 0x10(%rsp), %xmm2
movsd 0x8(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x4fde
movsd 0x8(%rsp), %xmm0
addq $0x38, %rsp
retq
nopw (%rax,%rax)
|
/opencor[P]sundials/src/nvector/manyvector/nvector_manyvector.c
|
N_VWSqrSumMaskLocal_ManyVector
|
sunrealtype MVAPPEND(N_VWSqrSumMaskLocal)(N_Vector x, N_Vector w, N_Vector id)
{
SUNFunctionBegin(x->sunctx);
sunindextype i, N;
sunrealtype sum, contrib;
#ifdef MANYVECTOR_BUILD_WITH_MPI
int rank;
#endif
/* initialize output*/
sum = ZERO;
for (i = 0; i < MANYVECTOR_NUM_SUBVECS(x); i++)
{
#ifdef MANYVECTOR_BUILD_WITH_MPI
/* check for nvwsqrsummasklocal in subvector */
if (MANYVECTOR_SUBVEC(x, i)->ops->nvwsqrsummasklocal)
{
sum += N_VWSqrSumMaskLocal(MANYVECTOR_SUBVEC(x, i), MANYVECTOR_SUBVEC(w, i),
MANYVECTOR_SUBVEC(id, i));
SUNCheckLastErrNoRet();
/* otherwise, call nvwrmsnormmask, and accumulate to overall sum on root task */
}
else
{
contrib = N_VWrmsNormMask(MANYVECTOR_SUBVEC(x, i), MANYVECTOR_SUBVEC(w, i),
MANYVECTOR_SUBVEC(id, i));
SUNCheckLastErrNoRet();
/* get this task's rank in subvector communicator (note: serial
subvectors will result in rank==0) */
rank = SubvectorMPIRank(MANYVECTOR_SUBVEC(x, i));
if (rank < 0) { return (ZERO); }
if (rank == 0)
{
N = N_VGetLength(MANYVECTOR_SUBVEC(x, i));
SUNCheckLastErrNoRet();
sum += (contrib * contrib * N);
}
}
#else
/* accumulate subvector contribution to overall sum */
contrib = N_VWrmsNormMask(MANYVECTOR_SUBVEC(x, i), MANYVECTOR_SUBVEC(w, i),
MANYVECTOR_SUBVEC(id, i));
SUNCheckLastErrNoRet();
N = N_VGetLength(MANYVECTOR_SUBVEC(x, i));
SUNCheckLastErrNoRet();
sum += (contrib * contrib * N);
#endif
}
return (sum);
}
|
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x28(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq 0x40(%rsp), %rcx
movq (%rcx), %rcx
cmpq (%rcx), %rax
jge 0x517c
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq 0x20(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
movq 0x38(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq 0x20(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq 0x20(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
callq 0x3150
movsd %xmm0, 0x8(%rsp)
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq 0x20(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x3120
movq %rax, 0x18(%rsp)
movsd 0x8(%rsp), %xmm0
mulsd 0x8(%rsp), %xmm0
cvtsi2sdq 0x18(%rsp), %xmm2
movsd 0x10(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x50c3
movsd 0x10(%rsp), %xmm0
addq $0x48, %rsp
retq
nopw (%rax,%rax)
|
/opencor[P]sundials/src/nvector/manyvector/nvector_manyvector.c
|
shm::open(char const (&) [24])
|
void*
shm::open( const shm_key_t &key )
{
/**
* just like with init, use same output
* pointer stack location for both.
*/
void *out( nullptr );
auto handle_open_failure = [&]( const shm_key_t &key ) -> void*
{
#if USE_CPP_EXCEPTIONS==1
std::stringstream ss;
ss <<
"Failed to open shm with key \"" << key << "\", with the following error code (";
ss << std::strerror( errno ) << ")";
throw bad_shm_alloc( ss.str() );
#else
return( nullptr );
#endif
};
#if _USE_POSIX_SHM_ == 1
int fd( shm::failure );
const int flags( O_RDWR | O_CREAT );
mode_t mode( 0 );
fd = shm_open( key,
flags,
mode );
if( fd == failure )
{
return( handle_open_failure( key ) );
}
struct stat st;
std::memset( &st,
0x0,
sizeof( struct stat ) );
/* stat the file to get the size */
if( fstat( fd, &st ) != shm::success )
{
#if USE_CPP_EXCEPTIONS==1
std::stringstream ss;
ss << "Failed to stat shm region with the following error: " << std::strerror( errno ) << ",\n";
ss << "unlinking.";
shm_unlink( key );
throw bad_shm_alloc( ss.str() );
#else
shm_unlink( key );
return( nullptr );
#endif
}
out = mmap( nullptr,
st.st_size,
(PROT_READ | PROT_WRITE),
MAP_SHARED,
fd,
0 );
if( out == MAP_FAILED )
{
#if USE_CPP_EXCEPTIONS==1
std::stringstream ss;
ss << "Failed to mmap shm region with the following error: " << std::strerror( errno ) << ",\n";
ss << "unlinking.";
shm_unlink( key );
throw bad_shm_alloc( ss.str() );
#else
shm_unlink( key );
return( nullptr );
#endif
}
/* close fd */
::close( fd );
/* done, return mem */
return( out );
/** END POSIX MEMORY **/
#elif _USE_SYSTEMV_SHM_ == 1
/** START SYSTEMV MEMORY **/
//STEP1 shmget
const auto shmid =
shmget( key, sizeof(int), S_IRUSR | S_IWUSR );
if( shmid == shm::failure )
{
//if using exceptions, you won't return from this
return( handle_open_failure( key ) );
}
//STEP2 shmat
out = shmat(shmid, nullptr, 0);
if( out == (void*)-1 )
{
#if USE_CPP_EXCEPTIONS==1
std::stringstream ss;
ss << "Failed to SHM attach the shm region with the following error ("
<< std::strerror( errno ) << ").";
throw bad_shm_alloc( ss.str() );
#else
return( nullptr );
#endif
}
/** END SYSTEMV MEMORY **/
#endif
//if we're here, everything theoretically worked
return( out );
}
|
pushq %rbp
movq %rsp, %rbp
subq $0x460, %rsp # imm = 0x460
movq %rdi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movl $0xffffffff, -0x20(%rbp) # imm = 0xFFFFFFFF
movl $0x42, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movl -0x28(%rbp), %edx
movl $0x42, %esi
callq 0x2340
movl %eax, -0x20(%rbp)
cmpl $-0x1, -0x20(%rbp)
jne 0x371c
movq -0x10(%rbp), %rsi
leaq -0x19(%rbp), %rdi
callq 0x3a60
movq %rax, -0x8(%rbp)
jmp 0x3a3d
leaq -0xb8(%rbp), %rdi
xorl %esi, %esi
movl $0x90, %edx
callq 0x2100
movl -0x20(%rbp), %edi
leaq -0xb8(%rbp), %rsi
callq 0x2330
cmpl $0x0, %eax
je 0x38a0
leaq -0x240(%rbp), %rdi
callq 0x2180
leaq -0x230(%rbp), %rdi
leaq 0x1a32(%rip), %rsi # 0x5193
callq 0x2210
movq %rax, -0x430(%rbp)
jmp 0x376f
callq 0x2040
movl (%rax), %edi
callq 0x20a0
movq -0x430(%rbp), %rdi
movq %rax, %rsi
callq 0x2210
movq %rax, -0x438(%rbp)
jmp 0x3793
movq -0x438(%rbp), %rdi
leaq 0x19e4(%rip), %rsi # 0x5185
callq 0x2210
jmp 0x37a8
leaq -0x230(%rbp), %rdi
leaq 0x19d2(%rip), %rsi # 0x5188
callq 0x2210
jmp 0x37bd
movq -0x10(%rbp), %rdi
callq 0x23f0
jmp 0x37c8
movb $0x1, -0x271(%rbp)
movl $0x28, %edi
callq 0x20e0
movq %rax, -0x440(%rbp)
leaq -0x270(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0x2200
jmp 0x37f5
movq -0x440(%rbp), %rdi
leaq -0x270(%rbp), %rsi
callq 0x4690
jmp 0x380a
movq -0x440(%rbp), %rdi
movb $0x0, -0x271(%rbp)
leaq 0x3441(%rip), %rsi # 0x6c60
leaq -0x10d6(%rip), %rdx # 0x2750
callq 0x2360
jmp 0x3a56
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x248(%rbp)
movl %eax, -0x24c(%rbp)
jmp 0x388f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x248(%rbp)
movl %eax, -0x24c(%rbp)
jmp 0x3876
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x248(%rbp)
movl %eax, -0x24c(%rbp)
leaq -0x270(%rbp), %rdi
callq 0x2130
testb $0x1, -0x271(%rbp)
jne 0x3881
jmp 0x388d
movq -0x440(%rbp), %rdi
callq 0x2190
jmp 0x388f
leaq -0x240(%rbp), %rdi
callq 0x21a0
jmp 0x3a4a
movq -0x88(%rbp), %rsi
movl -0x20(%rbp), %r8d
xorl %eax, %eax
movl %eax, %r9d
movl $0x3, %edx
movl $0x1, %ecx
movq %r9, %rdi
callq 0x23a0
movq %rax, -0x18(%rbp)
movq $-0x1, %rax
cmpq %rax, -0x18(%rbp)
jne 0x3a2d
leaq -0x400(%rbp), %rdi
callq 0x2180
leaq -0x3f0(%rbp), %rdi
leaq 0x185f(%rip), %rsi # 0x5150
callq 0x2210
movq %rax, -0x448(%rbp)
jmp 0x38ff
callq 0x2040
movl (%rax), %edi
callq 0x20a0
movq -0x448(%rbp), %rdi
movq %rax, %rsi
callq 0x2210
movq %rax, -0x450(%rbp)
jmp 0x3923
movq -0x450(%rbp), %rdi
leaq 0x1854(%rip), %rsi # 0x5185
callq 0x2210
jmp 0x3938
leaq -0x3f0(%rbp), %rdi
leaq 0x1842(%rip), %rsi # 0x5188
callq 0x2210
jmp 0x394d
movq -0x10(%rbp), %rdi
callq 0x23f0
jmp 0x3958
movb $0x1, -0x421(%rbp)
movl $0x28, %edi
callq 0x20e0
movq %rax, -0x458(%rbp)
leaq -0x420(%rbp), %rdi
leaq -0x400(%rbp), %rsi
callq 0x2200
jmp 0x3985
movq -0x458(%rbp), %rdi
leaq -0x420(%rbp), %rsi
callq 0x4690
jmp 0x399a
movq -0x458(%rbp), %rdi
movb $0x0, -0x421(%rbp)
leaq 0x32b1(%rip), %rsi # 0x6c60
leaq -0x1266(%rip), %rdx # 0x2750
callq 0x2360
jmp 0x3a56
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x248(%rbp)
movl %eax, -0x24c(%rbp)
jmp 0x3a1f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x248(%rbp)
movl %eax, -0x24c(%rbp)
jmp 0x3a06
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x248(%rbp)
movl %eax, -0x24c(%rbp)
leaq -0x420(%rbp), %rdi
callq 0x2130
testb $0x1, -0x421(%rbp)
jne 0x3a11
jmp 0x3a1d
movq -0x458(%rbp), %rdi
callq 0x2190
jmp 0x3a1f
leaq -0x400(%rbp), %rdi
callq 0x21a0
jmp 0x3a4a
movl -0x20(%rbp), %edi
callq 0x2400
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x460, %rsp # imm = 0x460
popq %rbp
retq
movq -0x248(%rbp), %rdi
callq 0x2380
nopw %cs:(%rax,%rax)
|
/RaftLib[P]shm/lib/shm.cpp
|
shm::close(char const (&) [24], void**, unsigned long, bool, bool)
|
bool
shm::close( const shm_key_t &key,
void **ptr,
const std::size_t nbytes,
const bool zero,
const bool unlink )
{
if( zero && (ptr != nullptr) && ( *ptr != nullptr ) )
{
std::memset( *ptr, 0x0, nbytes );
}
#if _USE_POSIX_SHM_ == 1
if( ptr != nullptr )
{
/** get allocations size including extra dummy page **/
const auto page_size( sysconf( _SC_PAGESIZE ) );
const auto alloc_bytes(
static_cast< std::size_t >(
std::ceil(
static_cast< float >( nbytes ) /
static_cast< float >( page_size ) ) + 1 ) * page_size
);
if( ( *ptr != nullptr ) && ( munmap( *ptr, alloc_bytes ) != shm::success ) )
{
#if DEBUG
perror( "Failed to unmap shared memory, attempting to close!!" );
#endif
}
*ptr = nullptr;
}
if( unlink )
{
if( shm_unlink( key ) != 0 )
{
#if USE_CPP_EXCEPTIONS==1
switch( errno )
{
case( ENOENT ):
{
throw invalid_key_exception( "Invalid file descriptor specified" );
}
break;
default:
{
throw invalid_key_exception( "Undefined error, check error codes" );
}
}
#endif
}
}
//jump to return true if here.
/** END POSIX MEMORY IMPL **/
#elif _USE_SYSTEMV_SHM_ == 1
/** START SYSTEMV IMPL **/
/**
* we could have gotten here b/c something failed and the
* user code is now calling close on an invalid shm seg.
* so let's stat first to be sure.
*/
const auto shmid =
shmget( key, sizeof(int), S_IRUSR | S_IWUSR );
if( shmid == shm::failure )
{
#if USE_CPP_EXCEPTIONS==1
if( errno == ENOENT )
{
throw invalid_key_exception( "SHM key doesn't exist" );
}
#else
return( true );
#endif
}
/**
* NOTE: This may not work quite perfectly b/c
* if there are M communicating pairs and you
* call this and only one happens to be detached,
* then this may cause the segment to be deleted.
*/
if(unlink /** only do this once **/ && shmctl(shmid, IPC_RMID, nullptr) == -1)
{
#if USE_CPP_EXCEPTIONS==1
if( errno == EINVAL || errno == EIDRM )
{
throw invalid_key_exception( "Invalid SHM key" );
}
std::stringstream ss;
ss << "Failed to set the SystemV memory region to exit on detach, non-fatal error ("
<< std::strerror( errno ) << ")\n";
throw bad_shm_alloc( ss.str() );
#else
return( false );
#endif
}
//else we're here, and it exists
if( shmdt( *ptr ) == shm::failure )
{
#if USE_CPP_EXCEPTIONS==1
std::stringstream ss;
ss << "Failed to detach SHM with error code ("
<< std::strerror( errno ) << ").";
throw invalid_key_exception( ss.str() );
#else
return( false );
#endif
}
/** END SYSTEMV IMPL **/
#endif
return( true );
}
|
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movb %r8b, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
andb $0x1, %cl
movb %cl, -0x19(%rbp)
andb $0x1, %al
movb %al, -0x1a(%rbp)
testb $0x1, -0x19(%rbp)
je 0x3c3e
cmpq $0x0, -0x10(%rbp)
je 0x3c3e
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x3c3e
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rdx
xorl %esi, %esi
callq 0x2100
cmpq $0x0, -0x10(%rbp)
je 0x3d1a
movl $0x1e, %edi
callq 0x2160
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, -0x94(%rbp)
testq %rax, %rax
movss %xmm0, -0x90(%rbp)
js 0x3c9c
movss -0x94(%rbp), %xmm0
movss %xmm0, -0x90(%rbp)
movss -0x90(%rbp), %xmm0
cvtsi2ssq -0x28(%rbp), %xmm1
divss %xmm1, %xmm0
callq 0x46d0
movss 0x1369(%rip), %xmm1 # 0x5024
addss %xmm1, %xmm0
movaps %xmm0, %xmm1
cvttss2si %xmm1, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
movss 0x1352(%rip), %xmm1 # 0x5028
subss %xmm1, %xmm0
cvttss2si %xmm0, %rcx
andq %rdx, %rcx
orq %rcx, %rax
imulq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x3d0f
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x30(%rbp), %rsi
callq 0x2120
cmpl $0x0, %eax
je 0x3d0f
jmp 0x3d0f
movq -0x10(%rbp), %rax
movq $0x0, (%rax)
testb $0x1, -0x1a(%rbp)
je 0x3ecc
movq -0x8(%rbp), %rdi
callq 0x23f0
cmpl $0x0, %eax
je 0x3eca
callq 0x2040
movl (%rax), %eax
subl $0x2, %eax
jne 0x3e00
jmp 0x3d48
movb $0x1, -0x65(%rbp)
movl $0x28, %edi
callq 0x20e0
movq %rax, -0xa8(%rbp)
leaq -0x51(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
callq 0x2390
movq -0xa0(%rbp), %rdx
leaq 0x144d(%rip), %rsi # 0x51c8
leaq -0x50(%rbp), %rdi
callq 0x22a0
jmp 0x3d86
movq -0xa8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x4750
jmp 0x3d98
movq -0xa8(%rbp), %rdi
movb $0x0, -0x65(%rbp)
leaq 0x2f4e(%rip), %rsi # 0x6cf8
leaq 0x9df(%rip), %rdx # 0x4790
callq 0x2360
jmp 0x3ee2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x3dde
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x2130
leaq -0x51(%rbp), %rdi
callq 0x2240
testb $0x1, -0x65(%rbp)
jne 0x3def
jmp 0x3dfb
movq -0xa8(%rbp), %rdi
callq 0x2190
jmp 0x3ed9
movb $0x1, -0x8a(%rbp)
movl $0x28, %edi
callq 0x20e0
movq %rax, -0xb8(%rbp)
leaq -0x89(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
callq 0x2390
movq -0xb0(%rbp), %rdx
leaq 0x13b1(%rip), %rsi # 0x51ea
leaq -0x88(%rbp), %rdi
callq 0x22a0
jmp 0x3e47
movq -0xb8(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x4750
jmp 0x3e5c
movq -0xb8(%rbp), %rdi
movb $0x0, -0x8a(%rbp)
leaq 0x2e87(%rip), %rsi # 0x6cf8
leaq 0x918(%rip), %rdx # 0x4790
callq 0x2360
jmp 0x3ee2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x3ea5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x2130
leaq -0x89(%rbp), %rdi
callq 0x2240
testb $0x1, -0x8a(%rbp)
jne 0x3ebc
jmp 0x3ec8
movq -0xb8(%rbp), %rdi
callq 0x2190
jmp 0x3ed9
jmp 0x3ecc
movb $0x1, %al
andb $0x1, %al
addq $0xc0, %rsp
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x2380
nopw %cs:(%rax,%rax)
|
/RaftLib[P]shm/lib/shm.cpp
|
JsStandardConstruct
|
void JsStandardConstruct(struct JsObject *self, struct JsObject *thisobj,
int argc, struct JsValue **argv, struct JsValue *res){
struct JsObject* this0 = JsCreateStandardObject(NULL);
struct JsValue res0;
//获得构造函数的prototype属性
(*self->Get)(self,"prototype",NULL,&res0);
if(res0.type == JS_OBJECT)
this0->Prototype = res0.u.object;
//Call
(*self->Call)(self,this0,argc,argv,res);
if(res->type != JS_OBJECT){
res->type = JS_OBJECT;
res->u.object = this0;
}
}
|
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %rbx
movq %rcx, -0x30(%rbp)
movl %edx, %r12d
movq %rdi, %r14
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x4c2a
movq %rax, %r13
leaq 0xf501(%rip), %rsi # 0x15045
leaq -0x48(%rbp), %r15
movq %r14, %rdi
xorl %edx, %edx
movq %r15, %rcx
callq *0x20(%r14)
cmpl $0x5, (%r15)
jne 0x5b62
movq -0x40(%rbp), %rax
movq %rax, (%r13)
movq %r14, %rdi
movq %r13, %rsi
movl %r12d, %edx
movq -0x30(%rbp), %rcx
movq %rbx, %r8
callq *0x68(%r14)
cmpl $0x5, (%rbx)
je 0x5b85
movl $0x5, (%rbx)
movq %r13, 0x8(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/solq360[P]js-engine/libjs/core/JsObject.c
|
ShiftExpression_rshift_eval
|
static void
ShiftExpression_rshift_eval(na, context, res)
struct JsAstNode *na; /* (struct JsAstBinaryNode) */
struct JsContext *context;
struct JsValue *res;
{
struct JsAstBinaryNode *n = CAST_NODE(na, JsAstBinaryNode);
struct JsValue r1, r2, r3, r4;
EVAL(n->a, context, &r1);
JsGetValue( &r1, &r2);
EVAL(n->b, context, &r3);
JsGetValue( &r3, &r4);
ShiftExpression_rshift_common(&r2, &r4, context, res);
}
|
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x10(%rdi), %rdi
movl (%rdi), %eax
leaq 0x15f4f(%rip), %rcx # 0x1cad0
leaq -0x88(%rbp), %r12
movq %r12, %rdx
callq *(%rcx,%rax,8)
leaq -0x70(%rbp), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x121f8
movq 0x18(%r15), %rdi
movl (%rdi), %eax
leaq -0x58(%rbp), %r15
movq %r14, %rsi
movq %r15, %rdx
leaq 0x15f1c(%rip), %rcx # 0x1cad0
callq *(%rcx,%rax,8)
leaq -0x40(%rbp), %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x121f8
movq %r13, %rdi
callq 0x11f2a
movl %eax, %r15d
movq %r14, %rdi
callq 0x11f34
movl %eax, %ecx
sarl %cl, %r15d
movl $0x3, (%rbx)
cvtsi2sd %r15d, %xmm0
movsd %xmm0, 0x8(%rbx)
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/solq360[P]js-engine/libjs/eval/JsEval.c
|
RelationalExpression_le_eval
|
static void
RelationalExpression_le_eval(na, context, res)
struct JsAstNode *na; /* (struct JsAstBinaryNode) */
struct JsContext *context;
struct JsValue *res;
{
struct JsAstBinaryNode *n = CAST_NODE(na, JsAstBinaryNode);
struct JsValue r1, r2, r3, r4, r5;
EVAL(n->a, context, &r1);
JsGetValue( &r1, &r2);
EVAL(n->b, context, &r3);
JsGetValue( &r3, &r4);
JsRelationalExpressionCompare( &r4, &r2, &r5);
if (r5.type == JS_UNDEFINED){
res->type = JS_BOOLEAN;
res->u.boolean = FALSE;
}
else{
res->type = JS_BOOLEAN;
if(r5.u.boolean == TRUE){
res->u.boolean = FALSE;
}else{
res->u.boolean = TRUE;
}
}
}
|
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x10(%rdi), %rdi
movl (%rdi), %eax
leaq 0x15cd6(%rip), %r13 # 0x1cad0
leaq -0xa0(%rbp), %r12
movq %r12, %rdx
callq *(%r13,%rax,8)
leaq -0x88(%rbp), %rsi
movq %r12, %rdi
movq %rsi, %r12
callq 0x121f8
movq 0x18(%r15), %rdi
movl (%rdi), %eax
leaq -0x70(%rbp), %r15
movq %r14, %rsi
movq %r15, %rdx
callq *(%r13,%rax,8)
leaq -0x58(%rbp), %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x121f8
leaq -0x40(%rbp), %r15
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x12298
cmpl $0x0, (%r15)
movl $0x2, (%rbx)
je 0x6e63
cmpl $0x1, -0x38(%rbp)
jne 0x6e6c
movl $0x0, 0x8(%rbx)
jmp 0x6e73
movl $0x1, 0x8(%rbx)
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/solq360[P]js-engine/libjs/eval/JsEval.c
|
EqualityExpression_eq_eval
|
static void
EqualityExpression_eq_eval(na, context, res)
struct JsAstNode *na; /* (struct JsAstBinaryNode) */
struct JsContext *context;
struct JsValue *res;
{
struct JsAstBinaryNode *n = CAST_NODE(na, JsAstBinaryNode);
struct JsValue r1, r2, r3, r4;
EVAL(n->a, context, &r1);
JsGetValue( &r1, &r2);
EVAL(n->b, context, &r3);
JsGetValue( &r3, &r4);
JsEqualityExpressionEqCompare( &r4, &r2, res);
}
|
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, -0x30(%rbp)
movq %rsi, %r14
movq %rdi, %r15
movq 0x10(%rdi), %rdi
movl (%rdi), %eax
leaq 0x15a3a(%rip), %rbx # 0x1cad0
leaq -0x90(%rbp), %r12
movq %r12, %rdx
callq *(%rbx,%rax,8)
leaq -0x78(%rbp), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x121f8
movq 0x18(%r15), %rdi
movl (%rdi), %eax
leaq -0x60(%rbp), %r15
movq %r14, %rsi
movq %r15, %rdx
callq *(%rbx,%rax,8)
leaq -0x48(%rbp), %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x121f8
movq %r14, %rdi
movq %r13, %rsi
movq -0x30(%rbp), %rdx
callq 0x123bf
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/solq360[P]js-engine/libjs/eval/JsEval.c
|
LogicalORExpression_eval
|
static void
LogicalORExpression_eval(na, context, res)
struct JsAstNode *na; /* (struct JsAstBinaryNode) */
struct JsContext *context;
struct JsValue *res;
{
struct JsAstBinaryNode *n = CAST_NODE(na, JsAstBinaryNode);
struct JsValue r1, r3, r5;
EVAL(n->a, context, &r1);
JsGetValue( &r1, res);
JsToBoolean(res, &r3);
if (r3.u.boolean == TRUE)
return;
EVAL(n->b, context, &r5);
JsGetValue( &r5, res);
}
|
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x10(%rdi), %rdi
movl (%rdi), %eax
leaq 0x1558f(%rip), %r13 # 0x1cad0
leaq -0x70(%rbp), %r12
movq %r12, %rdx
callq *(%r13,%rax,8)
movq %r12, %rdi
movq %rbx, %rsi
callq 0x121f8
leaq -0x58(%rbp), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x11de5
cmpl $0x1, 0x8(%r12)
je 0x758f
movq 0x18(%r15), %rdi
movl (%rdi), %eax
leaq -0x40(%rbp), %r15
movq %r14, %rsi
movq %r15, %rdx
callq *(%r13,%rax,8)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x121f8
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/solq360[P]js-engine/libjs/eval/JsEval.c
|
AssignmentExpression_modeq_eval
|
static void
AssignmentExpression_modeq_eval(na, context, res)
struct JsAstNode *na; /* (struct JsAstAssignmentExpressionNode) */
struct JsContext *context;
struct JsValue *res;
{
struct JsAstAssignmentExpressionNode *n =
CAST_NODE(na, JsAstAssignmentExpressionNode);
struct JsValue r1, r2, r3, r4, v0;
EVAL(n->lhs, context, &r1);
JsGetValue( &r1, &r2);
EVAL(n->expr, context, &r3);
JsGetValue( &r3, &r4);
MultiplicativeExpression_mod_common(&r2, &r4, context, res);
JsPutValue( &r1, res, &v0);
}
|
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
movq 0x10(%rdi), %rdi
movl (%rdi), %eax
leaq 0x15276(%rip), %rcx # 0x1cad0
leaq -0xa0(%rbp), %r14
movq %r14, %rdx
callq *(%rcx,%rax,8)
leaq -0x88(%rbp), %r13
movq %r14, %rdi
movq %r13, %rsi
callq 0x121f8
movq 0x18(%r12), %rdi
movl (%rdi), %eax
leaq -0x70(%rbp), %r12
movq %r15, %rsi
movq %r12, %rdx
leaq 0x1523f(%rip), %rcx # 0x1cad0
callq *(%rcx,%rax,8)
leaq -0x58(%rbp), %r15
movq %r12, %rdi
movq %r15, %rsi
callq 0x121f8
movq %r13, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x94a1
leaq -0x40(%rbp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1223b
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/solq360[P]js-engine/libjs/eval/JsEval.c
|
AssignmentExpression_lshifteq_eval
|
static void
AssignmentExpression_lshifteq_eval(na, context, res)
struct JsAstNode *na; /* (struct JsAstAssignmentExpressionNode) */
struct JsContext *context;
struct JsValue *res;
{
struct JsAstAssignmentExpressionNode *n =
CAST_NODE(na, JsAstAssignmentExpressionNode);
struct JsValue r1, r2,v0;
EVAL(n->lhs, context, &r1);
JsGetValue( &r1, &r2);
ShiftExpression_lshift_common(&r2, n->expr, context, res);
JsPutValue( &r1, res,&v0);
}
|
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x10(%rdi), %rdi
movl (%rdi), %eax
leaq 0x15075(%rip), %rcx # 0x1cad0
leaq -0x70(%rbp), %r12
movq %r12, %rdx
callq *(%rcx,%rax,8)
leaq -0x58(%rbp), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x121f8
movq 0x18(%r15), %rsi
movq %r13, %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x95e4
leaq -0x40(%rbp), %rdx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1223b
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/solq360[P]js-engine/libjs/eval/JsEval.c
|
ExpressionStatement_eval
|
static void
ExpressionStatement_eval(na, context, res)
struct JsAstNode *na; /* (struct JsAstUnaryNode) */
struct JsContext *context;
struct JsValue *res;
{
struct JsAstUnaryNode *n = CAST_NODE(na, JsAstUnaryNode);
struct JsValue r1;
struct JsValue *v = (struct JsValue*)JsMalloc(sizeof(struct JsValue));
TRACE(na->location, context, JS_TRACE_STATEMENT);
EVAL(n->a, context, &r1);
JsGetValue(&r1, v);
JS_SET_COMPLETION(res, JS_COMPLETION_NORMAL, v);
}
|
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
movl $0x18, %edi
callq 0xfd41
movq %rax, %r14
movq 0x8(%r12), %rax
movq %rax, 0x18(%r15)
xorl %eax, %eax
callq 0x108df
cmpl $0x1, 0x4(%rax)
jne 0x8110
xorl %eax, %eax
callq 0x108df
cmpq $0x0, 0x8(%rax)
je 0x8110
xorl %eax, %eax
callq 0x108df
movq (%r15), %rdi
movq 0x8(%r12), %rsi
movl $0x2, %edx
callq *0x8(%rax)
movq 0x10(%r12), %rdi
movl (%rdi), %eax
leaq 0x149b2(%rip), %rcx # 0x1cad0
leaq -0x38(%rbp), %r12
movq %r15, %rsi
movq %r12, %rdx
callq *(%rcx,%rax,8)
movq %r12, %rdi
movq %r14, %rsi
callq 0x121f8
movl $0x7, (%rbx)
movl $0x0, 0x10(%rbx)
movq %r14, 0x8(%rbx)
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
|
/solq360[P]js-engine/libjs/eval/JsEval.c
|
SyncBlockcStatement_eval
|
static void SyncBlockcStatement_eval(struct JsAstNode *na,
struct JsContext *context, struct JsValue *res){
struct JsAstSyncBlockStatementNode *n = CAST_NODE(na, JsAstSyncBlockStatementNode);
TRACE(na->location, context, JS_TRACE_STATEMENT);
struct JsObject* lockObj = NULL;
struct JsValue* e = NULL;
struct JsValue v0,v1;
if(n->type == JS_SYNC_THIS_BLOCK_NODE){
//this block
lockObj = context->thisObj;
}else if(n->type == JS_SYNC_IDENT_BLOCK_NODE){
JsFindValueRef(context,n->ident,&v0);
JsGetValue(&v0,&v1);
if(v1.type != JS_OBJECT || v1.u.object == NULL){
JsThrowString("ident is't a object");
}
lockObj = v1.u.object;
}else{
JsThrowString("synchronzied syntax error");
}
//对Block加锁
JsLockup(lockObj->SyncLock);
JS_TRY(0){
EVAL(n->a,context,res);
}
JS_CATCH(e){
//如果期间发现异常, 则先解锁, 在抛出
JsUnlock(lockObj->SyncLock);
JsReThrowException(e);
return;
}
//对Block解锁
JsUnlock(lockObj->SyncLock);
return;
}
|
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x8(%rdi), %rax
movq %rax, 0x18(%rsi)
xorl %eax, %eax
callq 0x108df
cmpl $0x1, 0x4(%rax)
jne 0x93bf
xorl %eax, %eax
callq 0x108df
cmpq $0x0, 0x8(%rax)
je 0x93bf
xorl %eax, %eax
callq 0x108df
movq (%r14), %rdi
movq 0x8(%r15), %rsi
movl $0x2, %edx
callq *0x8(%rax)
movl 0x10(%r15), %eax
cmpl $0x1, %eax
je 0x93d6
testl %eax, %eax
jne 0x949c
movq 0x20(%r14), %r13
jmp 0x9424
movq 0x18(%r15), %rsi
leaq -0x58(%rbp), %r12
movq %r14, %rdi
movq %r12, %rdx
callq 0x1024d
leaq -0x40(%rbp), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x121f8
cmpl $0x5, (%r13)
setne %al
movq 0x8(%r13), %rcx
testq %rcx, %rcx
sete %dl
orb %al, %dl
movq %rcx, %r13
cmpb $0x1, %dl
jne 0x9424
leaq 0xbd47(%rip), %rdi # 0x15162
callq 0xfaa0
movq -0x38(%rbp), %r13
movq 0x10(%r13), %rdi
callq 0xfd76
movl $0xc8, %edi
callq 0xfd41
movq %rax, %r12
movq %rax, %rdi
callq 0x4160
testl %eax, %eax
jne 0x9464
movq %r12, %rdi
callq 0xfa07
movq 0x20(%r15), %rdi
movl (%rdi), %eax
leaq 0x13675(%rip), %rcx # 0x1cad0
movq %r14, %rsi
movq %rbx, %rdx
callq *(%rcx,%rax,8)
xorl %eax, %eax
movl %eax, %ebx
callq 0xfa7b
movl %ebx, %eax
callq 0xfc20
movq %rax, %rbx
movq 0x10(%r13), %rdi
callq 0xfd9b
testq %rbx, %rbx
je 0x948d
movq %rbx, %rdi
callq 0xfb75
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4350
|
/solq360[P]js-engine/libjs/eval/JsEval.c
|
JsCreateEngine
|
struct JsEngine* JsCreateEngine(){
struct JsVm* vm = JsGetVm();
struct JsEngine* e = (struct JsEngine*)JsMalloc(sizeof(struct JsEngine));
e->vm = vm;
JsEngine2Vm(e);
e->state = JS_ENGINE_KERNEL;
e->exec = NULL;
e->waits = JsCreateList();
e->pools = JsCreateList();
e->lock = JsCreateLock();
return e;
}
|
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
xorl %eax, %eax
callq 0x108df
movq %rax, %rbx
movl $0x30, %edi
callq 0xfd41
movq %rax, %r14
movq %rbx, (%rax)
movq %rax, %rdi
callq 0x10882
movl $0x2, 0x8(%r14)
movq $0x0, 0x10(%r14)
xorl %eax, %eax
callq 0xff58
movq %rax, 0x18(%r14)
xorl %eax, %eax
callq 0xff58
movq %rax, 0x20(%r14)
xorl %eax, %eax
callq 0xfd02
movq %rax, 0x28(%r14)
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
|
/solq360[P]js-engine/libjs/vm/JsEngine.c
|
JsNumberInit
|
void JsNumberInit(struct JsVm* vm){
struct JsObject* number = JsCreateStandardFunctionObject(NULL,NULL,TRUE);
struct JsObject* number_proto = JsCreateNumberObject(NULL,0);
JsNumberFunctionInit(number,number_proto);
JsNumberProtoInit(number,number_proto);
struct JsValue* v = (struct JsValue*)JsMalloc(sizeof(struct JsValue));
v->type = JS_OBJECT;
v->u.object = number;
(*vm->Global->Put)(vm->Global,"Number",v,JS_OBJECT_ATTR_STRICT);
}
|
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %edi, %edi
xorl %esi, %esi
movl $0x1, %edx
callq 0x4e1d
movq %rax, %r14
xorps %xmm0, %xmm0
xorl %edi, %edi
callq 0x10d0a
movq %rax, %r15
leaq 0x1c1(%rip), %rax # 0x10d6f
movq %rax, 0x68(%r14)
leaq 0x1db(%rip), %rax # 0x10d94
movq %rax, 0x60(%r14)
movl $0x18, %edi
callq 0xfd41
movl $0x5, %r13d
movl %r13d, (%rax)
movq %r15, 0x8(%rax)
leaq 0x446a(%rip), %rsi # 0x15045
movq %r14, %rdi
movq %rax, %rdx
movl $0x7, %ecx
callq *0x28(%r14)
movl $0x18, %edi
callq 0xfd41
movl $0x3, (%rax)
movabsq $0x7ff8000000000000, %rcx # imm = 0x7FF8000000000000
movq %rcx, 0x8(%rax)
leaq 0x57c6(%rip), %rsi # 0x163d5
movq %r14, %rdi
movq %rax, %rdx
movl $0x7, %ecx
callq *0x28(%r14)
movl $0x18, %edi
callq 0xfd41
movl $0x18, %edi
callq 0xfd41
movl %r13d, (%rax)
movq %r14, 0x8(%rax)
leaq 0x449e(%rip), %rsi # 0x150de
movq %r15, %rdi
movq %rax, %rdx
movl $0x2, %ecx
callq *0x28(%r15)
movl $0x18, %edi
callq 0xfd41
movq %rax, %r12
movl %r13d, (%rax)
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4e1d
movq %rax, 0x8(%r12)
leaq 0x185(%rip), %rcx # 0x10dfb
movq %rcx, 0x68(%rax)
leaq 0x43d5(%rip), %rsi # 0x15056
movq %r15, %rdi
movq %r12, %rdx
movl $0x2, %ecx
callq *0x28(%r15)
movl $0x18, %edi
callq 0xfd41
movq %rax, %r12
movl %r13d, (%rax)
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4e1d
movq %rax, 0x8(%r12)
leaq 0x190(%rip), %rcx # 0x10e47
movq %rcx, 0x68(%rax)
leaq 0x439d(%rip), %rsi # 0x1505f
movq %r15, %rdi
movq %r12, %rdx
movl $0x2, %ecx
callq *0x28(%r15)
movl $0x18, %edi
callq 0xfd41
movl %r13d, (%rax)
movq %r14, 0x8(%rax)
movq 0x18(%rbx), %rdi
movq 0x28(%rdi), %r8
leaq 0x56f3(%rip), %rsi # 0x163e4
movq %rax, %rdx
movl $0x7, %ecx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%r8
|
/solq360[P]js-engine/libjs/init/JsNumber.c
|
JsObjectProtoHasOwnPropertyCall
|
static void JsObjectProtoHasOwnPropertyCall(struct JsObject *obj, struct JsObject *thisobj,
int argc, struct JsValue **argv, struct JsValue *res){
struct JsValue v;
char* prop = "undefined";
if(argc >0 ){
JsToString(argv[0],&v);
(*thisobj->HasOwnProperty)(thisobj,v.u.string,res);
prop = v.u.string;
}
(*thisobj->HasOwnProperty)(thisobj,prop,res);
}
|
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %r8, %rbx
movq %rsi, %r14
testl %edx, %edx
jle 0x113a7
movq (%rcx), %rdi
leaq -0x30(%rbp), %r15
movq %r15, %rsi
callq 0x12007
movq 0x8(%r15), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq *0x50(%r14)
movq 0x8(%r15), %rsi
jmp 0x113ae
leaq 0x3d72(%rip), %rsi # 0x15120
movq %r14, %rdi
movq %rbx, %rdx
callq *0x50(%r14)
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
|
/solq360[P]js-engine/libjs/init/JsOF.c
|
JsObjectProtoIsPrototypeOfCall
|
static void JsObjectProtoIsPrototypeOfCall(struct JsObject *obj, struct JsObject *thisobj,
int argc, struct JsValue **argv, struct JsValue *res){
struct JsObject* prototype;
res->type = JS_BOOLEAN;
if(argc <= 0){
res->u.boolean = FALSE;
return;
}
if(argv[0]->type != JS_OBJECT){
res->type = JS_BOOLEAN;
res->u.boolean = FALSE;
return ;
}
prototype = argv[0]->u.object->Prototype;
//循环查询
while(prototype != NULL){
if(prototype == thisobj){
res->type = JS_BOOLEAN;
res->u.boolean = TRUE;
return;
}
//下一个对象的原形
prototype = prototype->Prototype;
}
//没有查询到
res->type = JS_BOOLEAN;
res->u.boolean = FALSE;
}
|
movl $0x2, (%r8)
xorl %eax, %eax
testl %edx, %edx
jle 0x113f3
pushq %rbp
movq %rsp, %rbp
movq (%rcx), %rcx
cmpl $0x5, (%rcx)
jne 0x113f2
movq 0x8(%rcx), %rcx
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x113f2
cmpq %rsi, %rcx
jne 0x113e0
movl $0x1, %eax
popq %rbp
movl %eax, 0x8(%r8)
retq
|
/solq360[P]js-engine/libjs/init/JsOF.c
|
JsToNumber
|
void JsToNumber(struct JsValue *val, struct JsValue *res){
res->type = JS_NUMBER;
switch (val->type) {
case JS_UNDEFINED:
res->u.number = JS_VALUE_NUMBER_NAN;
break;
case JS_NULL:
res->u.number = 0.0;
break;
case JS_BOOLEAN:
res->u.number = (val->u.boolean ? 1.0 : 0.0);
break;
case JS_NUMBER:
*res = *val;
break;
case JS_STRING:{
char * szOrbits, *pEnd;
double d1;
szOrbits = val->u.string;
d1 = strtod (szOrbits,&pEnd);
if(*pEnd == '\0'){
res->u.number = d1;
}else{
//如果不是字符串末尾, 则表示没有解析完该字符串
res->u.number = JS_VALUE_NUMBER_NAN;
}
break;
}
case JS_OBJECT:{
struct JsValue primitive;
JsToPrimitive(val,JS_OBJECT_HIT_TYPE_NUMBER,&primitive);
JsToNumber(&primitive, res);
break;
}
default:
JsThrowString("JsToNumbeError");
}
}
|
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl $0x3, (%rsi)
movl (%rdi), %eax
cmpq $0x5, %rax
ja 0x11f0c
movq %rsi, %rbx
leaq 0x462e(%rip), %rcx # 0x164a8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movabsq $0x7ff8000000000000, %rax # imm = 0x7FF8000000000000
movq %rax, 0x8(%rbx)
jmp 0x11f03
movq 0x8(%rdi), %rdi
leaq -0x28(%rbp), %r14
movq %r14, %rsi
callq 0x40b0
movq (%r14), %rax
cmpb $0x0, (%rax)
je 0x11ec6
movsd 0x463d(%rip), %xmm0 # 0x164f0
jmp 0x11ec6
cmpl $0x0, 0x8(%rdi)
xorps %xmm0, %xmm0
je 0x11ec6
movsd 0x31da(%rip), %xmm0 # 0x150a0
movsd %xmm0, 0x8(%rbx)
jmp 0x11f03
movq 0x10(%rdi), %rax
movq %rax, 0x10(%rbx)
movups (%rdi), %xmm0
movups %xmm0, (%rbx)
jmp 0x11f03
movq $0x0, 0x8(%rbx)
jmp 0x11f03
leaq -0x28(%rbp), %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x11da4
movq %r14, %rdi
movq %rbx, %rsi
callq 0x11e53
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x460e(%rip), %rdi # 0x16521
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0xfaa0
|
/solq360[P]js-engine/libjs/core/JsValue.c
|
JsToUint32
|
unsigned int JsToUint32(struct JsValue *val){
struct JsValue i;
JsToInteger(val, &i);
if (val->type != JS_NUMBER || isnan(i.u.number) || i.u.number == 0.0)
return 0;
else {
i.u.number = fmod(i.u.number ,4294967296.0); /* 2^32 */
if (i.u.number < 0)
i.u.number += 4294967296;
return (unsigned int)i.u.number;
}
}
|
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq -0x20(%rbp), %rsi
callq 0x11e53
xorl %eax, %eax
cmpl $0x3, (%rbx)
jne 0x11f96
movsd -0x18(%rbp), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
je 0x11f96
movsd 0x4591(%rip), %xmm1 # 0x164f8
callq 0x4150
movsd 0x4584(%rip), %xmm2 # 0x164f8
addsd %xmm0, %xmm2
movapd %xmm0, %xmm1
cmpltsd 0x457b(%rip), %xmm1 # 0x16500
andpd %xmm1, %xmm2
andnpd %xmm0, %xmm1
orpd %xmm2, %xmm1
cvttsd2si %xmm1, %rax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
|
/solq360[P]js-engine/libjs/core/JsValue.c
|
JsToString
|
void JsToString(struct JsValue *val, struct JsValue *res){
res->type = JS_STRING;
switch (val->type) {
case JS_UNDEFINED:
res->u.string = "undefined";
break;
case JS_NULL:
res->u.string = "null";
break;
case JS_BOOLEAN:{
if(val->u.boolean == TRUE)
res->u.string ="true";
else
res->u.string = "false";
break;
}
case JS_NUMBER:{ /* 9.8.1 */
char* buf;
double value ;
value = val->u.number;
//最大长度为128位
buf = (char*)JsMalloc(128);
if(value - (int)value == 0){
//整数
sprintf(buf,"%d",(int)value);
}else{
sprintf(buf,"%f",value);
}
res->u.string = buf;
break;
}
case JS_STRING:
*res = *val;
break;
case JS_OBJECT:{
struct JsValue prim;
JsToPrimitive(val,JS_OBJECT_HIT_TYPE_STRING, &prim);
JsToString(&prim, res);
break;
}
default:
JsThrowString("JsToStringError");
}
}
|
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movl $0x4, (%rsi)
movl (%rdi), %eax
cmpq $0x5, %rax
ja 0x120d8
movq %rsi, %rbx
leaq 0x4492(%rip), %rcx # 0x164c0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x30e2(%rip), %rax # 0x15120
jmp 0x120f3
movq 0x10(%rdi), %rax
movq %rax, 0x10(%rbx)
movupd (%rdi), %xmm0
movupd %xmm0, (%rbx)
jmp 0x1210e
cmpl $0x1, 0x8(%rdi)
jne 0x120ec
leaq 0x427b(%rip), %rax # 0x162e4
jmp 0x120f3
movsd 0x8(%rdi), %xmm0
movaps %xmm0, -0x20(%rbp)
movl $0x80, %edi
callq 0xfd41
movq %rax, %r14
movapd -0x20(%rbp), %xmm1
cvttpd2dq %xmm1, %xmm0
cvtdq2pd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
movapd %xmm1, %xmm0
jne 0x120f9
jp 0x120f9
cvttsd2si %xmm0, %edx
leaq 0x2ff0(%rip), %rsi # 0x15098
movq %r14, %rdi
xorl %eax, %eax
callq 0x4290
jmp 0x1210a
leaq 0x306f(%rip), %rax # 0x1512a
jmp 0x120f3
leaq -0x38(%rbp), %r14
xorl %esi, %esi
movq %r14, %rdx
callq 0x11da4
movq %r14, %rdi
movq %rbx, %rsi
callq 0x12007
jmp 0x1210e
leaq 0x4451(%rip), %rdi # 0x16530
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0xfaa0
leaq 0x41f6(%rip), %rax # 0x162e9
movq %rax, 0x8(%rbx)
jmp 0x1210e
leaq 0x3681(%rip), %rsi # 0x15781
movq %r14, %rdi
movb $0x1, %al
callq 0x4290
movq %r14, 0x8(%rbx)
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
|
/solq360[P]js-engine/libjs/core/JsValue.c
|
JsEqualityExpressionEqCompare
|
void JsEqualityExpressionEqCompare( struct JsValue *x, struct JsValue *y,
struct JsValue *res){
struct JsValue tmp;
int xtype, ytype;
int hit;
res->type = JS_BOOLEAN;
if (x->type == y->type)
switch (x->type){
case JS_UNDEFINED:
case JS_NULL:
res->u.boolean = TRUE;
return;
case JS_NUMBER:
if (isnan(x->u.number) || isnan(y->u.number))
res->u.boolean = FALSE;
else
res->u.boolean = (x->u.number == y->u.number ? TRUE : FALSE);
return;
case JS_STRING:
res->u.boolean = (strcmp(x->u.string,y->u.string) == 0 ? TRUE: FALSE);
return;
case JS_BOOLEAN:
res->u.boolean = (x->u.boolean == y->u.boolean ? TRUE : FALSE);
return;
case JS_OBJECT:
//refer the same object
res->u.boolean = (x->u.object == y->u.object ? TRUE: FALSE);
return;
default:
//未发现正确的类型
JsAssert(FALSE);
}
xtype = x->type;
ytype = y->type;
if (xtype == JS_NULL && ytype == JS_UNDEFINED)
res->u.boolean = TRUE;
else if (xtype == JS_UNDEFINED && ytype == JS_NULL)
res->u.boolean = TRUE;
else if (xtype == JS_NUMBER && ytype == JS_STRING) {
JsToNumber(y, &tmp);
JsEqualityExpressionEqCompare(x, &tmp, res);
} else if (xtype == JS_STRING && ytype == JS_NUMBER) {
JsToNumber(x, &tmp);
JsEqualityExpressionEqCompare(&tmp, y, res);
} else if (xtype == JS_BOOLEAN) {
JsToNumber( x, &tmp);
JsEqualityExpressionEqCompare(&tmp, y, res);
} else if (ytype == JS_BOOLEAN){
JsToNumber(y, &tmp);
JsEqualityExpressionEqCompare(x, &tmp, res);
} else if ((xtype == JS_STRING || xtype == JS_NUMBER) &&
ytype == JS_OBJECT) {
if(xtype == JS_STRING)
hit = JS_OBJECT_HIT_TYPE_STRING;
else
hit = JS_OBJECT_HIT_TYPE_NUMBER;
JsToPrimitive(y, hit, &tmp);
JsEqualityExpressionEqCompare(x, &tmp, res);
} else if ((ytype == JS_STRING || ytype == JS_NUMBER) &&
xtype == JS_OBJECT){
if(ytype == JS_STRING)
hit = JS_OBJECT_HIT_TYPE_STRING;
else
hit = JS_OBJECT_HIT_TYPE_NUMBER;
JsToPrimitive(x, hit, &tmp);
JsEqualityExpressionEqCompare(&tmp, y, res);
} else{
res->u.boolean = FALSE;
}
}
|
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x2, (%rdx)
movl (%rdi), %eax
movl (%rsi), %ecx
cmpl %ecx, %eax
jne 0x1245c
cmpl $0x5, %eax
ja 0x1244f
movl %eax, %eax
leaq 0x4175(%rip), %rcx # 0x16568
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x8(%r15), %eax
xorl %ecx, %ecx
cmpl 0x8(%r14), %eax
jmp 0x124df
movsd 0x8(%r15), %xmm0
ucomisd %xmm0, %xmm0
jp 0x1255d
movsd 0x8(%r14), %xmm1
ucomisd %xmm1, %xmm1
jp 0x1255d
cmpeqsd %xmm1, %xmm0
movq %xmm0, %rax
andl $0x1, %eax
movl %eax, 0x8(%rbx)
jmp 0x124e5
movq 0x8(%r15), %rax
xorl %ecx, %ecx
cmpq 0x8(%r14), %rax
jmp 0x124df
xorl %edi, %edi
callq 0xf9bf
movl (%r15), %eax
movl (%r14), %ecx
movl %eax, %edx
xorl $0x1, %edx
orl %ecx, %edx
je 0x1246e
movl %ecx, %edx
xorl $0x1, %edx
orl %eax, %edx
jne 0x12477
movl $0x1, 0x8(%rbx)
jmp 0x124e5
movl %eax, %edx
xorl $0x3, %edx
movl %ecx, %esi
xorl $0x4, %esi
orl %edx, %esi
jne 0x1249c
leaq -0x38(%rbp), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x11e53
movq %r15, %rdi
movq %r12, %rsi
jmp 0x124c4
movl %eax, %edx
xorl $0x4, %edx
movl %ecx, %esi
xorl $0x3, %esi
orl %edx, %esi
je 0x124af
cmpl $0x2, %eax
jne 0x124f2
leaq -0x38(%rbp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x11e53
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x123bf
jmp 0x124e5
movq 0x8(%r15), %rdi
movq 0x8(%r14), %rsi
callq 0x4180
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
movl %ecx, 0x8(%rbx)
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x2, %ecx
je 0x12485
leal -0x3(%rax), %edx
cmpl $0x2, %edx
setb %dl
cmpl $0x5, %ecx
sete %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x1252d
xorl %esi, %esi
cmpl $0x4, %eax
setne %sil
leaq -0x38(%rbp), %r12
movq %r14, %rdi
movq %r12, %rdx
callq 0x11da4
jmp 0x12494
leal -0x3(%rcx), %edx
cmpl $0x2, %edx
setae %dl
cmpl $0x5, %eax
setne %al
orb %dl, %al
jne 0x1255d
xorl %esi, %esi
cmpl $0x4, %ecx
setne %sil
leaq -0x38(%rbp), %r12
movq %r15, %rdi
movq %r12, %rdx
callq 0x11da4
jmp 0x124be
movl $0x0, 0x8(%rbx)
jmp 0x124e5
|
/solq360[P]js-engine/libjs/eval/JsCompare.c
|
encode_decode_large
|
int encode_decode_large(struct test_state *state)
{
int status, i;
size_t to;
struct aec_stream *strm = state->strm;
strm->avail_in = state->ibuf_len;
strm->avail_out = state->cbuf_len;
strm->next_in = state->ubuf;
strm->next_out = state->cbuf;
status = aec_encode_init(strm);
if (status != AEC_OK) {
printf("Init failed.\n");
return 99;
}
status = aec_encode(strm, AEC_FLUSH);
if (status != AEC_OK) {
printf("Encode failed.\n");
return 99;
}
aec_encode_end(strm);
strm->avail_in = strm->total_out;
strm->avail_out = state->buf_len;
strm->next_in = state->cbuf;
strm->next_out = state->obuf;
to = strm->total_out;
status = aec_decode_init(strm);
if (status != AEC_OK) {
printf("Init failed.\n");
return 99;
}
status = aec_decode(strm, AEC_FLUSH);
if (status != AEC_OK) {
printf("Decode failed.\n");
return 99;
}
if (memcmp(state->ubuf, state->obuf, state->ibuf_len)) {
printf("\n%s: Uncompressed output differs from input.\n", CHECK_FAIL);
printf("\nuncompressed buf");
for (i = 0; i < 80; i++) {
if (i % 8 == 0)
printf("\n");
printf("%02x ", state->ubuf[i]);
}
printf("\n\ncompressed buf len %li", to);
for (i = 0; i < 80; i++) {
if (i % 8 == 0)
printf("\n");
printf("%02x ", state->cbuf[i]);
}
printf("\n\ndecompressed buf");
for (i = 0; i < 80; i++) {
if (i % 8 == 0)
printf("\n");
printf("%02x ", state->obuf[i]);
}
printf("\n");
return 99;
}
aec_decode_end(strm);
return 0;
}
|
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %rax
movq 0x58(%rdi), %r15
movq %rax, 0x8(%r15)
movq 0x38(%rdi), %rax
movq %rax, 0x20(%r15)
movq 0x10(%rdi), %rax
movq %rax, (%r15)
movq 0x18(%rdi), %rax
movq %rax, 0x18(%r15)
movq %r15, %rdi
callq 0x1050
testl %eax, %eax
je 0x223f
leaq 0xfaa(%rip), %rdi # 0x31e7
jmp 0x2257
movq %r15, %rdi
movl $0x1, %esi
callq 0x1080
testl %eax, %eax
je 0x226d
leaq 0xf81(%rip), %rdi # 0x31d8
callq 0x1060
movl $0x63, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %r15, %rdi
callq 0x10e0
movq 0x28(%r15), %r14
movq %r14, 0x8(%r15)
movq 0x30(%rbx), %rax
movq %rax, 0x20(%r15)
movq 0x18(%rbx), %rax
movq %rax, (%r15)
movq 0x20(%rbx), %rax
movq %rax, 0x18(%r15)
movq %r15, %rdi
callq 0x10b0
testl %eax, %eax
jne 0x2236
movq %r15, %rdi
movl $0x1, %esi
callq 0x10d0
testl %eax, %eax
je 0x22ba
leaq 0xf11(%rip), %rdi # 0x31c9
jmp 0x2257
movq 0x10(%rbx), %rdi
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
callq 0x10c0
testl %eax, %eax
je 0x23c6
leaq 0xe66(%rip), %rdi # 0x3140
leaq 0xe8d(%rip), %rsi # 0x316e
xorl %eax, %eax
callq 0x1070
leaq 0xe8f(%rip), %rdi # 0x317e
xorl %eax, %eax
callq 0x1070
leaq 0xe93(%rip), %r15 # 0x3190
xorl %r12d, %r12d
testb $0x7, %r12b
jne 0x2310
movl $0xa, %edi
callq 0x1040
movq 0x10(%rbx), %rax
movzbl (%rax,%r12), %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x1070
incq %r12
cmpq $0x50, %r12
jne 0x2300
leaq 0xe63(%rip), %rdi # 0x3196
movq %r14, %rsi
xorl %eax, %eax
callq 0x1070
leaq 0xe4c(%rip), %r14 # 0x3190
xorl %r15d, %r15d
testb $0x7, %r15b
jne 0x2357
movl $0xa, %edi
callq 0x1040
movq 0x18(%rbx), %rax
movzbl (%rax,%r15), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1070
incq %r15
cmpq $0x50, %r15
jne 0x2347
leaq 0xe35(%rip), %rdi # 0x31af
xorl %eax, %eax
callq 0x1070
leaq 0xe08(%rip), %r14 # 0x3190
xorl %r15d, %r15d
testb $0x7, %r15b
jne 0x239b
movl $0xa, %edi
callq 0x1040
movq 0x20(%rbx), %rax
movzbl (%rax,%r15), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1070
incq %r15
cmpq $0x50, %r15
jne 0x238b
movl $0xa, %edi
callq 0x1040
jmp 0x225c
movq %r15, %rdi
callq 0x1090
xorl %eax, %eax
jmp 0x2261
|
/opensatelliteproject[P]libaec/tests/check_aec.c
|
SQStringTable::Resize(long long)
|
void SQStringTable::Resize(SQInteger size)
{
SQInteger oldsize=_numofslots;
SQString **oldtable=_strings;
AllocNodes(size);
for (SQInteger i=0; i<oldsize; i++){
SQString *p = oldtable[i];
while(p){
SQString *next = p->_next;
SQHash h = p->_hash&(_numofslots-1);
p->_next = _strings[h];
_strings[h] = p;
p = next;
}
}
SQ_FREE(oldtable,oldsize*sizeof(SQString*));
}
|
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq 0x40(%rsp), %rdi
movq %rdi, (%rsp)
movq 0x8(%rdi), %rax
movq %rax, 0x30(%rsp)
movq (%rdi), %rax
movq %rax, 0x28(%rsp)
movq 0x38(%rsp), %rsi
callq 0x141a0
movq $0x0, 0x20(%rsp)
movq 0x20(%rsp), %rax
cmpq 0x30(%rsp), %rax
jge 0x40458
movq 0x28(%rsp), %rax
movq 0x20(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
je 0x40443
movq (%rsp), %rax
movq 0x18(%rsp), %rcx
movq 0x20(%rcx), %rcx
movq %rcx, 0x10(%rsp)
movq 0x18(%rsp), %rcx
movq 0x30(%rcx), %rcx
movq 0x8(%rax), %rdx
subq $0x1, %rdx
andq %rdx, %rcx
movq %rcx, 0x8(%rsp)
movq (%rax), %rcx
movq 0x8(%rsp), %rdx
movq (%rcx,%rdx,8), %rdx
movq 0x18(%rsp), %rcx
movq %rdx, 0x20(%rcx)
movq 0x18(%rsp), %rdx
movq (%rax), %rax
movq 0x8(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x10(%rsp), %rax
movq %rax, 0x18(%rsp)
jmp 0x403de
jmp 0x40445
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x403bb
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
shlq $0x3, %rsi
callq 0x145b0
addq $0x48, %rsp
retq
|
/KatuH[P]squall/build_O0/_deps/squirrel-src/squirrel/sqstate.cpp
|
SQTable::Get(SQObjectPtr const&, SQObjectPtr&)
|
bool SQTable::Get(const SQObjectPtr &key,SQObjectPtr &val)
{
if(sq_type(key) == OT_NULL)
return false;
_HashNode *n = _Get(key, HashObj(key) & (_numofnodes - 1));
if (n) {
val = _realval(n->val);
return true;
}
return false;
}
|
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq %rdx, 0x28(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x30(%rsp), %rax
cmpl $0x1000001, (%rax) # imm = 0x1000001
jne 0x40ef4
movb $0x0, 0x47(%rsp)
jmp 0x40f8b
movq 0x30(%rsp), %rax
movq %rax, (%rsp)
movq 0x30(%rsp), %rdi
callq 0x13b60
movq 0x8(%rsp), %rdi
movq (%rsp), %rsi
movq %rax, %rdx
movq 0x48(%rdi), %rax
subq $0x1, %rax
andq %rax, %rdx
callq 0x14dc0
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
je 0x40f86
movq 0x20(%rsp), %rax
cmpl $0x8010000, (%rax) # imm = 0x8010000
je 0x40f55
movq 0x20(%rsp), %rax
movq (%rax), %rcx
movq %rcx, 0x10(%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x18(%rsp)
jmp 0x40f70
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x18(%rax), %rcx
movq %rcx, 0x10(%rsp)
movq 0x20(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x14550
movb $0x1, 0x47(%rsp)
jmp 0x40f8b
movb $0x0, 0x47(%rsp)
movb 0x47(%rsp), %al
andb $0x1, %al
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
|
/KatuH[P]squall/build_O0/_deps/squirrel-src/squirrel/sqtable.cpp
|
SQVM::LeaveFrame()
|
void SQVM::LeaveFrame() {
SQInteger last_top = _top;
SQInteger last_stackbase = _stackbase;
SQInteger css = --_callsstacksize;
/* First clean out the call stack frame */
ci->_closure.Null();
_stackbase -= ci->_prevstkbase;
_top = _stackbase + ci->_prevtop;
ci = (css) ? &_callsstack[css-1] : NULL;
if(_openouters) CloseOuters(&(_stack._vals[last_stackbase]));
while (last_top >= _top) {
_stack._vals[last_top--].Null();
}
}
|
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x48(%rax), %rcx
movq %rcx, 0x28(%rsp)
movq 0x50(%rax), %rcx
movq %rcx, 0x20(%rsp)
movq 0xc8(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0xc8(%rax)
movq %rcx, 0x18(%rsp)
movq 0x108(%rax), %rdi
addq $0x10, %rdi
callq 0x14ac0
movq 0x10(%rsp), %rax
movq 0x108(%rax), %rcx
movslq 0x2c(%rcx), %rdx
movq 0x50(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x50(%rax)
movq 0x50(%rax), %rcx
movq 0x108(%rax), %rdx
movslq 0x30(%rdx), %rdx
addq %rdx, %rcx
movq %rcx, 0x48(%rax)
cmpq $0x0, 0x18(%rsp)
je 0x43f18
movq 0x10(%rsp), %rax
movq 0xc0(%rax), %rax
movq 0x18(%rsp), %rcx
subq $0x1, %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
jmp 0x43f21
xorl %eax, %eax
movq %rax, 0x8(%rsp)
jmp 0x43f21
movq 0x10(%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, 0x108(%rax)
cmpq $0x0, 0x58(%rax)
je 0x43f53
movq 0x10(%rsp), %rdi
movq 0x30(%rdi), %rsi
movq 0x20(%rsp), %rax
shlq $0x4, %rax
addq %rax, %rsi
callq 0x143d0
jmp 0x43f55
movq 0x10(%rsp), %rcx
movq 0x28(%rsp), %rax
cmpq 0x48(%rcx), %rax
jl 0x43f8d
movq 0x10(%rsp), %rax
movq 0x30(%rax), %rdi
movq 0x28(%rsp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, 0x28(%rsp)
shlq $0x4, %rax
addq %rax, %rdi
callq 0x14ac0
jmp 0x43f55
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
|
/KatuH[P]squall/build_O0/_deps/squirrel-src/squirrel/sqvm.cpp
|
SQVM::PLOCAL_INC(long long, SQObjectPtr&, SQObjectPtr&, SQObjectPtr&)
|
bool SQVM::PLOCAL_INC(SQInteger op,SQObjectPtr &target, SQObjectPtr &a, SQObjectPtr &incr)
{
SQObjectPtr trg;
_RET_ON_FAIL(ARITH_OP( op , trg, a, incr));
target = a;
a = trg;
return true;
}
|
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq %rsi, 0x50(%rsp)
movq %rdx, 0x48(%rsp)
movq %rcx, 0x40(%rsp)
movq %r8, 0x38(%rsp)
movq 0x58(%rsp), %rax
movq %rax, (%rsp)
leaq 0x28(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x143c0
movq (%rsp), %rdi
movq 0x8(%rsp), %rdx
movq 0x50(%rsp), %rsi
movq 0x40(%rsp), %rcx
movq 0x38(%rsp), %r8
callq 0x14f70
movb %al, 0x17(%rsp)
jmp 0x43ff8
movb 0x17(%rsp), %al
testb $0x1, %al
jne 0x4402b
jmp 0x44002
movb $0x0, 0x67(%rsp)
movl $0x1, 0x18(%rsp)
jmp 0x4405a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x14f50
jmp 0x4406f
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdi
callq 0x14a10
jmp 0x4403c
movq 0x40(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x14a10
jmp 0x4404d
movb $0x1, 0x67(%rsp)
movl $0x1, 0x18(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x14f50
movb 0x67(%rsp), %al
andb $0x1, %al
addq $0x68, %rsp
retq
movq 0x20(%rsp), %rdi
callq 0x14f00
nopl (%rax)
|
/KatuH[P]squall/build_O0/_deps/squirrel-src/squirrel/sqvm.cpp
|
leveldb::CorruptionTest::Check(int, int)
|
void Check(int min_expected, int max_expected) {
int next_expected = 0;
int missed = 0;
int bad_keys = 0;
int bad_values = 0;
int correct = 0;
std::string value_space;
Iterator* iter = db_->NewIterator(ReadOptions());
for (iter->SeekToFirst(); iter->Valid(); iter->Next()) {
uint64_t key;
Slice in(iter->key());
if (in == "" || in == "~") {
// Ignore boundary keys.
continue;
}
if (!ConsumeDecimalNumber(&in, &key) || !in.empty() ||
key < next_expected) {
bad_keys++;
continue;
}
missed += (key - next_expected);
next_expected = key + 1;
if (iter->value() != Value(key, &value_space)) {
bad_values++;
} else {
correct++;
}
}
delete iter;
std::fprintf(
stderr,
"expected=%d..%d; got=%d; bad_keys=%d; bad_values=%d; missed=%d\n",
min_expected, max_expected, correct, bad_keys, bad_values, missed);
ASSERT_LE(min_expected, correct);
ASSERT_GE(max_expected, correct);
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %esi, 0x48(%rsp)
movl %esi, 0x54(%rsp)
andl $0x0, 0x1c(%rsp)
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movl %edx, 0x4c(%rsp)
movl %edx, 0x50(%rsp)
movb $0x0, (%rax)
movq 0x88(%rdi), %rdi
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rsi
movups %xmm0, (%rsi)
movb $0x1, 0x1(%rsi)
movq (%rdi), %rax
callq *0x30(%rax)
movq %rax, %r14
movq (%rax), %rax
movq %r14, %rdi
callq *0x18(%rax)
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
movl $0x0, 0xc(%rsp)
movl $0x0, %ecx
movq %rcx, 0x38(%rsp)
movl $0x0, %r12d
movl $0x0, %ecx
movq %rcx, 0x30(%rsp)
testb %al, %al
je 0xaeb2
movl $0x0, 0xc(%rsp)
leaq 0x20(%rsp), %r15
leaq 0x10(%rsp), %rbp
xorl %r13d, %r13d
movq $0x0, 0x30(%rsp)
xorl %r12d, %r12d
movq $0x0, 0x38(%rsp)
movq (%r14), %rax
movq %r14, %rdi
callq *0x40(%rax)
movq %rax, 0x20(%rsp)
movq %rdx, 0x28(%rsp)
testq %rdx, %rdx
je 0xae86
cmpq $0x1, %rdx
jne 0xadd4
cmpb $0x7e, (%rax)
je 0xae86
movq %r15, %rdi
movq %rbp, %rsi
callq 0x27666
testb %al, %al
je 0xadf8
cmpq $0x0, 0x28(%rsp)
jne 0xadf8
movq 0x10(%rsp), %rbx
movslq %r13d, %rax
cmpq %rax, %rbx
jae 0xae00
incl %r12d
jmp 0xae86
movq (%r14), %rax
movq %r14, %rdi
callq *0x48(%rax)
movq %rax, %r15
movq %rdx, %rbp
movl 0x10(%rsp), %eax
movl $0x7fffffff, %ecx # imm = 0x7FFFFFFF
andl %ecx, %eax
movl %eax, 0x40(%rsp)
cmpl %ecx, %eax
je 0xae26
testl %eax, %eax
jne 0xae2e
movl $0x1, 0x40(%rsp)
movl %ebx, %eax
subl %r13d, %eax
movq 0x38(%rsp), %rcx
addl %eax, %ecx
movq %rcx, 0x38(%rsp)
movl %ebx, %r13d
incl %r13d
leaq 0x40(%rsp), %rdi
movl $0x3e8, %esi # imm = 0x3E8
leaq 0x58(%rsp), %rdx
callq 0xc95c
cmpq %rdx, %rbp
jne 0xae70
movq %r15, %rdi
movq %rax, %rsi
movq %rbp, %rdx
callq 0xa610
testl %eax, %eax
je 0xaea2
movq 0x30(%rsp), %rax
incl %eax
movq %rax, 0x30(%rsp)
leaq 0x20(%rsp), %r15
leaq 0x10(%rsp), %rbp
movq (%r14), %rax
movq %r14, %rdi
callq *0x30(%rax)
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
testb %al, %al
jne 0xada9
jmp 0xaeb2
movl 0xc(%rsp), %eax
incl %eax
movl %eax, 0xc(%rsp)
movl %eax, 0x1c(%rsp)
jmp 0xae7c
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
movq 0x760fe(%rip), %rax # 0x80fc0
movq (%rax), %rdi
leaq 0x4e5be(%rip), %rsi # 0x5948a
movl 0x48(%rsp), %edx
movl 0x4c(%rsp), %ecx
movl 0xc(%rsp), %r8d
movl %r12d, %r9d
xorl %eax, %eax
pushq 0x38(%rsp)
pushq 0x38(%rsp)
callq 0xa900
popq %rcx
popq %rdx
leaq 0x4e5d6(%rip), %rsi # 0x594ca
leaq 0x4e5dc(%rip), %rdx # 0x594d7
leaq 0x20(%rsp), %rbx
leaq 0x54(%rsp), %rcx
leaq 0x1c(%rsp), %r8
movq %rbx, %rdi
callq 0xff21
cmpb $0x0, (%rbx)
je 0xaf81
movq 0x28(%rsp), %rbx
testq %rbx, %rbx
je 0xaf3a
movq (%rbx), %rdi
leaq 0x10(%rbx), %rax
cmpq %rax, %rdi
je 0xaf32
callq 0xa570
movq %rbx, %rdi
callq 0xa570
leaq 0x4e59e(%rip), %rsi # 0x594df
leaq 0x4e58f(%rip), %rdx # 0x594d7
leaq 0x20(%rsp), %rbx
leaq 0x50(%rsp), %rcx
leaq 0x1c(%rsp), %r8
movq %rbx, %rdi
callq 0xf505
cmpb $0x0, (%rbx)
jne 0xaffb
leaq 0x10(%rsp), %rdi
callq 0x36908
movq 0x28(%rsp), %rax
testq %rax, %rax
je 0xafb4
movq (%rax), %r8
jmp 0xafbb
leaq 0x10(%rsp), %rdi
callq 0x36908
movq 0x28(%rsp), %rax
testq %rax, %rax
je 0xaf9a
movq (%rax), %r8
jmp 0xafa1
leaq 0x56e24(%rip), %r8 # 0x61dc5
leaq 0x4e0a1(%rip), %rdx # 0x59049
leaq 0x40(%rsp), %rbx
pushq $0x2
popq %rsi
pushq $0x6d
jmp 0xafcc
leaq 0x56e0a(%rip), %r8 # 0x61dc5
leaq 0x4e087(%rip), %rdx # 0x59049
leaq 0x40(%rsp), %rbx
pushq $0x2
popq %rsi
pushq $0x6e
popq %rcx
movq %rbx, %rdi
callq 0x332a2
leaq 0x10(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3332c
movq %rbx, %rdi
callq 0x33308
movq (%r14), %rdi
testq %rdi, %rdi
je 0xaffb
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x28(%rsp), %rbx
testq %rbx, %rbx
je 0xb01e
movq (%rbx), %rdi
leaq 0x10(%rbx), %rax
cmpq %rax, %rdi
je 0xb016
callq 0xa570
movq %rbx, %rdi
callq 0xa570
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0xb032
callq 0xa570
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
|
/walterzhaoJR[P]leveldb/db/corruption_test.cc
|
leveldb::CorruptionTest_TableFile_Test::TestBody()
|
TEST_F(CorruptionTest, TableFile) {
Build(100);
DBImpl* dbi = reinterpret_cast<DBImpl*>(db_);
dbi->TEST_CompactMemTable();
dbi->TEST_CompactRange(0, nullptr, nullptr);
dbi->TEST_CompactRange(1, nullptr, nullptr);
Corrupt(kTableFile, 100, 1);
Check(90, 99);
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x64
popq %rsi
callq 0xe9da
movq 0x88(%rbx), %r14
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x12dc2
movq (%r15), %rdi
testq %rdi, %rdi
je 0xb076
callq 0xa810
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x12e98
pushq $0x1
popq %rbp
movq %r14, %rdi
movl %ebp, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x12e98
pushq $0x2
popq %rsi
pushq $0x64
popq %rdx
movq %rbx, %rdi
movl %ebp, %ecx
callq 0xebf4
pushq $0x5a
popq %rsi
pushq $0x63
popq %rdx
movq %rbx, %rdi
callq 0xacf0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
|
/walterzhaoJR[P]leveldb/db/corruption_test.cc
|
leveldb::CorruptionTest_TableFileRepair_Test::TestBody()
|
TEST_F(CorruptionTest, TableFileRepair) {
options_.block_size = 2 * kValueSize; // Limit scope of corruption
options_.paranoid_checks = true;
Reopen();
Build(100);
DBImpl* dbi = reinterpret_cast<DBImpl*>(db_);
dbi->TEST_CompactMemTable();
dbi->TEST_CompactRange(0, nullptr, nullptr);
dbi->TEST_CompactRange(1, nullptr, nullptr);
Corrupt(kTableFile, 100, 1);
RepairDB();
Reopen();
Check(95, 99);
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq $0x7d0, 0x60(%rdi) # imm = 0x7D0
movb $0x1, 0x32(%rdi)
callq 0xf3a6
pushq $0x64
popq %rsi
movq %rbx, %rdi
callq 0xe9da
movq 0x88(%rbx), %r14
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x12dc2
movq (%r15), %rdi
testq %rdi, %rdi
je 0xb106
callq 0xa810
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x12e98
pushq $0x1
popq %rbp
movq %r14, %rdi
movl %ebp, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x12e98
pushq $0x2
popq %rsi
pushq $0x64
popq %rdx
movq %rbx, %rdi
movl %ebp, %ecx
callq 0xebf4
movq %rbx, %rdi
callq 0xf52e
movq %rbx, %rdi
callq 0xf3a6
pushq $0x5f
popq %rsi
pushq $0x63
popq %rdx
movq %rbx, %rdi
callq 0xacf0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
|
/walterzhaoJR[P]leveldb/db/corruption_test.cc
|
testing::internal::ExecDeathTest::AssumeRole() (.cold.1)
|
static pid_t ExecDeathTestSpawnChild(char* const* argv, int close_fd) {
ExecDeathTestArgs args = { argv, close_fd };
pid_t child_pid = -1;
# if GTEST_OS_QNX
// Obtains the current directory and sets it to be closed in the child
// process.
const int cwd_fd = open(".", O_RDONLY);
GTEST_DEATH_TEST_CHECK_(cwd_fd != -1);
GTEST_DEATH_TEST_CHECK_SYSCALL_(fcntl(cwd_fd, F_SETFD, FD_CLOEXEC));
// We need to execute the test program in the same environment where
// it was originally invoked. Therefore we change to the original
// working directory first.
const char* const original_dir =
UnitTest::GetInstance()->original_working_dir();
// We can safely call chdir() as it's a direct system call.
if (chdir(original_dir) != 0) {
DeathTestAbort(std::string("chdir(\"") + original_dir + "\") failed: " +
GetLastErrnoDescription());
return EXIT_FAILURE;
}
int fd_flags;
// Set close_fd to be closed after spawn.
GTEST_DEATH_TEST_CHECK_SYSCALL_(fd_flags = fcntl(close_fd, F_GETFD));
GTEST_DEATH_TEST_CHECK_SYSCALL_(fcntl(close_fd, F_SETFD,
fd_flags | FD_CLOEXEC));
struct inheritance inherit = {0};
// spawn is a system call.
child_pid =
spawn(args.argv[0], 0, nullptr, &inherit, args.argv, GetEnviron());
// Restores the current working directory.
GTEST_DEATH_TEST_CHECK_(fchdir(cwd_fd) != -1);
GTEST_DEATH_TEST_CHECK_SYSCALL_(close(cwd_fd));
# else // GTEST_OS_QNX
# if GTEST_OS_LINUX
// When a SIGPROF signal is received while fork() or clone() are executing,
// the process may hang. To avoid this, we ignore SIGPROF here and re-enable
// it after the call to fork()/clone() is complete.
struct sigaction saved_sigprof_action;
struct sigaction ignore_sigprof_action;
memset(&ignore_sigprof_action, 0, sizeof(ignore_sigprof_action));
sigemptyset(&ignore_sigprof_action.sa_mask);
ignore_sigprof_action.sa_handler = SIG_IGN;
GTEST_DEATH_TEST_CHECK_SYSCALL_(sigaction(
SIGPROF, &ignore_sigprof_action, &saved_sigprof_action));
# endif // GTEST_OS_LINUX
# if GTEST_HAS_CLONE
const bool use_fork = GTEST_FLAG(death_test_use_fork);
if (!use_fork) {
static const bool stack_grows_down = StackGrowsDown();
const auto stack_size = static_cast<size_t>(getpagesize() * 2);
// MMAP_ANONYMOUS is not defined on Mac, so we use MAP_ANON instead.
void* const stack = mmap(nullptr, stack_size, PROT_READ | PROT_WRITE,
MAP_ANON | MAP_PRIVATE, -1, 0);
GTEST_DEATH_TEST_CHECK_(stack != MAP_FAILED);
// Maximum stack alignment in bytes: For a downward-growing stack, this
// amount is subtracted from size of the stack space to get an address
// that is within the stack space and is aligned on all systems we care
// about. As far as I know there is no ABI with stack alignment greater
// than 64. We assume stack and stack_size already have alignment of
// kMaxStackAlignment.
const size_t kMaxStackAlignment = 64;
void* const stack_top =
static_cast<char*>(stack) +
(stack_grows_down ? stack_size - kMaxStackAlignment : 0);
GTEST_DEATH_TEST_CHECK_(
static_cast<size_t>(stack_size) > kMaxStackAlignment &&
reinterpret_cast<uintptr_t>(stack_top) % kMaxStackAlignment == 0);
child_pid = clone(&ExecDeathTestChildMain, stack_top, SIGCHLD, &args);
GTEST_DEATH_TEST_CHECK_(munmap(stack, stack_size) != -1);
}
# else
const bool use_fork = true;
# endif // GTEST_HAS_CLONE
if (use_fork && (child_pid = fork()) == 0) {
ExecDeathTestChildMain(&args);
_exit(0);
}
# endif // GTEST_OS_QNX
# if GTEST_OS_LINUX
GTEST_DEATH_TEST_CHECK_SYSCALL_(
sigaction(SIGPROF, &saved_sigprof_action, nullptr));
# endif // GTEST_OS_LINUX
GTEST_DEATH_TEST_CHECK_(child_pid != -1);
return child_pid;
}
|
pushq %rbx
subq $0x10, %rsp
leaq 0x765b4(%rip), %rdi # 0x81b58
callq 0xabe0
testl %eax, %eax
je 0xb5d3
leaq 0xc(%rsp), %rdi
leaq 0xb(%rsp), %rbx
movq %rbx, %rsi
callq 0x4f3e8
movb (%rbx), %al
movb %al, 0x76589(%rip) # 0x81b50
leaq 0x7658a(%rip), %rdi # 0x81b58
callq 0xa3d0
addq $0x10, %rsp
popq %rbx
retq
|
/walterzhaoJR[P]leveldb/third_party/googletest/googletest/src/gtest-death-test.cc
|
leveldb::test::RandomKey[abi:cxx11](leveldb::Random*, int)
|
std::string RandomKey(Random* rnd, int len) {
// Make sure to generate a wide variety of characters so we
// test the boundary conditions for short-key optimizations.
static const char kTestChars[] = {'\0', '\1', 'a', 'b', 'c',
'd', 'e', '\xfd', '\xfe', '\xff'};
std::string result;
for (int i = 0; i < len; i++) {
result += kTestChars[rnd->Uniform(sizeof(kTestChars))];
}
return result;
}
|
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %r14
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
testl %edx, %edx
jle 0xca6b
movl %edx, %ebx
movq %rsi, %r15
movl $0xcccccccd, %r12d # imm = 0xCCCCCCCD
leaq 0x4c60f(%rip), %r13 # 0x59030
movl (%r15), %eax
imulq $0x41a7, %rax, %rax # imm = 0x41A7
movq %rax, %rcx
shrq $0x1f, %rcx
andl $0x7fffffff, %eax # imm = 0x7FFFFFFF
leal (%rcx,%rax), %edx
addl $0x80000001, %edx # imm = 0x80000001
addl %eax, %ecx
cmovnsl %ecx, %edx
movl %edx, (%r15)
movq %rdx, %rax
imulq %r12, %rax
shrq $0x23, %rax
addl %eax, %eax
leal (%rax,%rax,4), %eax
subl %eax, %edx
movsbl (%rdx,%r13), %esi
movq %r14, %rdi
callq 0xa510
decl %ebx
jne 0xca21
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
|
/walterzhaoJR[P]leveldb/util/testutil.cc
|
testing::AssertionResult testing::internal::PredicateFormatterFromMatcher<leveldb::test::IsOKMatcher>::operator()<leveldb::Status>(char const*, leveldb::Status const&) const
|
AssertionResult operator()(const char* value_text, const T& x) const {
// We convert matcher_ to a Matcher<const T&> *now* instead of
// when the PredicateFormatterFromMatcher object was constructed,
// as matcher_ may be polymorphic (e.g. NotNull()) and we won't
// know which type to instantiate it to until we actually see the
// type of x here.
//
// We write SafeMatcherCast<const T&>(matcher_) instead of
// Matcher<const T&>(matcher_), as the latter won't compile when
// matcher_ has type Matcher<T> (e.g. An<int>()).
// We don't write MatcherCast<const T&> either, as that allows
// potentially unsafe downcasting of the matcher argument.
const Matcher<const T&> matcher = SafeMatcherCast<const T&>(matcher_);
// The expected path here is that the matcher should match (i.e. that most
// tests pass) so optimize for this case.
if (matcher.Matches(x)) {
return AssertionSuccess();
}
::std::stringstream ss;
ss << "Value of: " << value_text << "\n"
<< "Expected: ";
matcher.DescribeTo(&ss);
// Rerun the matcher to "PrintAndExplain" the failure.
StringMatchResultListener listener;
if (MatchPrintAndExplain(x, matcher, &listener)) {
ss << "\n The matcher failed on the initial attempt; but passed when "
"rerun to generate the explanation.";
}
ss << "\n Actual: " << listener.str();
return AssertionFailure() << ss.str();
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x368, %rsp # imm = 0x368
movq %rcx, %r12
movq %rdx, %r13
movq %rdi, %rbx
movl $0x8, %edi
callq 0xa5c0
movq %rax, %r14
leaq 0x6fcae(%rip), %rax # 0x7f308
movq %rax, (%r14)
movq %r14, 0x8(%rsp)
movl $0x18, %edi
callq 0xa5c0
movq %rax, %r15
movabsq $0x100000001, %rax # imm = 0x100000001
movq %rax, 0x8(%r15)
leaq 0x6fcfc(%rip), %rax # 0x7f380
movq %rax, (%r15)
movq %r14, 0x10(%r15)
movq %r15, 0x10(%rsp)
leaq 0x6fca9(%rip), %rax # 0x7f340
movq %rax, (%rsp)
cmpq $0x0, (%r12)
je 0xf6e2
leaq 0x48(%rsp), %rdi
callq 0xa430
leaq 0x58(%rsp), %r15
leaq 0x49f01(%rip), %rsi # 0x595b9
movl $0xa, %edx
movq %r15, %rdi
callq 0xa6b0
testq %r13, %r13
je 0xf6fa
movq %r13, %rdi
callq 0xa240
movq %r15, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0xa6b0
jmp 0xf713
movq %rbx, %rdi
callq 0x36cce
leaq 0x6fc6f(%rip), %rax # 0x7f360
movq %rax, (%rsp)
jmp 0xf8a4
movq 0x58(%rsp), %rax
movq -0x18(%rax), %rax
leaq (%r15,%rax), %rdi
movl 0x78(%rsp,%rax), %esi
orl $0x1, %esi
callq 0xaaf0
leaq 0x526aa(%rip), %rsi # 0x61dc4
movl $0x1, %edx
movq %r15, %rdi
callq 0xa6b0
leaq 0x52005(%rip), %rsi # 0x61733
movl $0xa, %edx
movq %r15, %rdi
callq 0xa6b0
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x10(%rax)
leaq 0x1e0(%rsp), %r14
leaq 0x1f0(%rsp), %rax
movq %rax, -0x18(%rax)
leaq 0x6fc76(%rip), %r13 # 0x7f3d8
movq %r13, -0x20(%rax)
movq %r14, %rdi
callq 0xa430
movq %rsp, %rsi
leaq 0x1d0(%rsp), %rdx
movq %r12, %rdi
callq 0x10655
testb %al, %al
je 0xf799
leaq 0x49e38(%rip), %rsi # 0x595c4
movl $0x60, %edx
movq %r15, %rdi
callq 0xa6b0
leaq 0x49e85(%rip), %rsi # 0x59625
movl $0xb, %edx
movq %r15, %rdi
callq 0xa6b0
leaq 0x1f8(%rsp), %rsi
leaq 0x28(%rsp), %r12
movq %r12, %rdi
callq 0xaa40
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %r15, %rdi
callq 0xa6b0
movq (%r12), %rdi
leaq 0x38(%rsp), %rbp
cmpq %rbp, %rdi
je 0xf7e6
callq 0xa570
leaq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x36cdd
leaq 0x60(%rsp), %rsi
leaq 0x28(%rsp), %r12
movq %r12, %rdi
callq 0xaa40
movq %r15, %rdi
movq %r12, %rsi
callq 0x101d2
movq %rbx, %rdi
movq %rax, %rsi
callq 0x36c12
movq (%r12), %rdi
cmpq %rbp, %rdi
je 0xf829
callq 0xa570
movq 0x20(%rsp), %r15
testq %r15, %r15
je 0xf84c
movq (%r15), %rdi
leaq 0x10(%r15), %rax
cmpq %rax, %rdi
je 0xf844
callq 0xa570
movq %r15, %rdi
callq 0xa570
leaq 0x260(%rsp), %r15
movq %r13, -0x90(%r15)
movq 0x7171e(%rip), %r12 # 0x80f80
movq %r14, %rdi
movq %r12, %rsi
callq 0xa480
movq %r15, %rdi
callq 0xa1b0
leaq 0x48(%rsp), %rdi
movq %r12, %rsi
callq 0xa480
leaq 0xc8(%rsp), %rdi
callq 0xa1b0
movq 0x10(%rsp), %r15
leaq 0x6fac5(%rip), %rax # 0x7f360
movq %rax, (%rsp)
testq %r15, %r15
je 0xf8ac
movq %r15, %rdi
callq 0x1098a
movq %rbx, %rax
addq $0x368, %rsp # imm = 0x368
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
|
/walterzhaoJR[P]leveldb/third_party/googletest/googlemock/include/gmock/gmock-matchers.h
|
leveldb::CorruptionTest::Key(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*)
|
Slice Key(int i, std::string* storage) {
char buf[100];
std::snprintf(buf, sizeof(buf), "%016d", i);
storage->assign(buf, strlen(buf));
return Slice(*storage);
}
|
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rdx, %rbx
movl %esi, %ecx
leaq 0x49c40(%rip), %rdx # 0x595b3
movq %rsp, %r14
movl $0x64, %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0xaa50
movq %r14, %rdi
callq 0xa240
movq 0x8(%rbx), %rdx
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rcx
movq %rax, %r8
callq 0xaa10
movq (%rbx), %rax
movq 0x8(%rbx), %rdx
addq $0x68, %rsp
popq %rbx
popq %r14
retq
|
/walterzhaoJR[P]leveldb/db/corruption_test.cc
|
leveldb::CorruptionTest_Recovery_Test::~CorruptionTest_Recovery_Test()
|
TEST_F(CorruptionTest, Recovery) {
Build(100);
Check(100, 100);
Corrupt(kLogFile, 19, 1); // WriteBatch tag for first record
Corrupt(kLogFile, log::kBlockSize + 1000, 1); // Somewhere in second block
Reopen();
// The 64 records in the first two log blocks are completely lost.
Check(36, 36);
}
|
pushq %rbx
movq %rdi, %rbx
callq 0xfa7a
movq %rbx, %rdi
popq %rbx
jmp 0xa570
|
/walterzhaoJR[P]leveldb/db/corruption_test.cc
|
leveldb::CorruptionTest_TableFileRepair_Test::~CorruptionTest_TableFileRepair_Test()
|
TEST_F(CorruptionTest, TableFileRepair) {
options_.block_size = 2 * kValueSize; // Limit scope of corruption
options_.paranoid_checks = true;
Reopen();
Build(100);
DBImpl* dbi = reinterpret_cast<DBImpl*>(db_);
dbi->TEST_CompactMemTable();
dbi->TEST_CompactRange(0, nullptr, nullptr);
dbi->TEST_CompactRange(1, nullptr, nullptr);
Corrupt(kTableFile, 100, 1);
RepairDB();
Reopen();
Check(95, 99);
}
|
pushq %rbx
movq %rdi, %rbx
callq 0xfa7a
movq %rbx, %rdi
popq %rbx
jmp 0xa570
|
/walterzhaoJR[P]leveldb/db/corruption_test.cc
|
leveldb::CorruptionTest_TableFileIndexData_Test::~CorruptionTest_TableFileIndexData_Test()
|
TEST_F(CorruptionTest, TableFileIndexData) {
Build(10000); // Enough to build multiple Tables
DBImpl* dbi = reinterpret_cast<DBImpl*>(db_);
dbi->TEST_CompactMemTable();
Corrupt(kTableFile, -2000, 500);
Reopen();
Check(5000, 9999);
}
|
pushq %rbx
movq %rdi, %rbx
callq 0xfa7a
movq %rbx, %rdi
popq %rbx
jmp 0xa570
|
/walterzhaoJR[P]leveldb/db/corruption_test.cc
|
leveldb::CorruptionTest_SequenceNumberRecovery_Test::~CorruptionTest_SequenceNumberRecovery_Test()
|
TEST_F(CorruptionTest, SequenceNumberRecovery) {
ASSERT_LEVELDB_OK(db_->Put(WriteOptions(), "foo", "v1"));
ASSERT_LEVELDB_OK(db_->Put(WriteOptions(), "foo", "v2"));
ASSERT_LEVELDB_OK(db_->Put(WriteOptions(), "foo", "v3"));
ASSERT_LEVELDB_OK(db_->Put(WriteOptions(), "foo", "v4"));
ASSERT_LEVELDB_OK(db_->Put(WriteOptions(), "foo", "v5"));
RepairDB();
Reopen();
std::string v;
ASSERT_LEVELDB_OK(db_->Get(ReadOptions(), "foo", &v));
ASSERT_EQ("v5", v);
// Write something. If sequence number was not recovered properly,
// it will be hidden by an earlier write.
ASSERT_LEVELDB_OK(db_->Put(WriteOptions(), "foo", "v6"));
ASSERT_LEVELDB_OK(db_->Get(ReadOptions(), "foo", &v));
ASSERT_EQ("v6", v);
Reopen();
ASSERT_LEVELDB_OK(db_->Get(ReadOptions(), "foo", &v));
ASSERT_EQ("v6", v);
}
|
pushq %rbx
movq %rdi, %rbx
callq 0xfa7a
movq %rbx, %rdi
popq %rbx
jmp 0xa570
|
/walterzhaoJR[P]leveldb/db/corruption_test.cc
|
leveldb::CorruptionTest_CorruptedDescriptor_Test::~CorruptionTest_CorruptedDescriptor_Test()
|
TEST_F(CorruptionTest, CorruptedDescriptor) {
ASSERT_LEVELDB_OK(db_->Put(WriteOptions(), "foo", "hello"));
DBImpl* dbi = reinterpret_cast<DBImpl*>(db_);
dbi->TEST_CompactMemTable();
dbi->TEST_CompactRange(0, nullptr, nullptr);
Corrupt(kDescriptorFile, 0, 1000);
Status s = TryReopen();
ASSERT_TRUE(!s.ok());
RepairDB();
Reopen();
std::string v;
ASSERT_LEVELDB_OK(db_->Get(ReadOptions(), "foo", &v));
ASSERT_EQ("hello", v);
}
|
pushq %rbx
movq %rdi, %rbx
callq 0xfa7a
movq %rbx, %rdi
popq %rbx
jmp 0xa570
|
/walterzhaoJR[P]leveldb/db/corruption_test.cc
|
leveldb::CorruptionTest_CompactionInputError_Test::~CorruptionTest_CompactionInputError_Test()
|
TEST_F(CorruptionTest, CompactionInputError) {
Build(10);
DBImpl* dbi = reinterpret_cast<DBImpl*>(db_);
dbi->TEST_CompactMemTable();
const int last = config::kMaxMemCompactLevel;
ASSERT_EQ(1, Property("leveldb.num-files-at-level" + NumberToString(last)));
Corrupt(kTableFile, 100, 1);
Check(5, 9);
// Force compactions by writing lots of values
Build(10000);
Check(10000, 10000);
}
|
pushq %rbx
movq %rdi, %rbx
callq 0xfa7a
movq %rbx, %rdi
popq %rbx
jmp 0xa570
|
/walterzhaoJR[P]leveldb/db/corruption_test.cc
|
testing::AssertionResult testing::internal::CmpHelperOpFailure<int, int>(char const*, char const*, int const&, int const&, char const*)
|
AssertionResult CmpHelperOpFailure(const char* expr1, const char* expr2,
const T1& val1, const T2& val2,
const char* op) {
return AssertionFailure()
<< "Expected: (" << expr1 << ") " << op << " (" << expr2
<< "), actual: " << FormatForComparisonFailureMessage(val1, val2)
<< " vs " << FormatForComparisonFailureMessage(val2, val1);
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %r8, 0x8(%rsp)
movq %rcx, %r15
movq %rdi, %rbx
leaq 0x30(%rsp), %r13
movq %rsi, (%r13)
leaq 0x28(%rsp), %r12
movq %rdx, (%r12)
leaq 0x20(%rsp), %rbp
movq %r9, (%rbp)
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x36cdd
leaq 0x4955d(%rip), %rsi # 0x594ef
movq %r14, %rdi
callq 0x1009a
movq %rax, %rdi
movq %r13, %rsi
callq 0x100f8
leaq 0x4a3a4(%rip), %rsi # 0x5a350
movq %rax, %rdi
callq 0x10174
movq %rax, %rdi
movq %rbp, %rsi
callq 0x100f8
leaq 0x50031(%rip), %rsi # 0x5fff7
movq %rax, %rdi
callq 0x10174
movq %rax, %rdi
movq %r12, %rsi
callq 0x100f8
leaq 0x4951b(%rip), %rsi # 0x594fb
movq %rax, %rdi
callq 0x1009a
movq %rax, %r14
leaq 0x58(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x1032a
movq %r14, %rdi
movq %r12, %rsi
callq 0x101d2
leaq 0x494fa(%rip), %rsi # 0x59507
movq %rax, %rdi
callq 0x10228
movq %rax, %r14
leaq 0x38(%rsp), %r15
movq %r15, %rdi
movq 0x8(%rsp), %rsi
callq 0x1032a
movq %r14, %rdi
movq %r15, %rsi
callq 0x101d2
movq %rbx, %rdi
movq %rax, %rsi
callq 0x36c12
movq (%r15), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x10052
callq 0xa570
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10065
callq 0xa570
movq 0x18(%rsp), %r14
testq %r14, %r14
je 0x10088
movq (%r14), %rdi
leaq 0x10(%r14), %rax
cmpq %rax, %rdi
je 0x10080
callq 0xa570
movq %r14, %rdi
callq 0xa570
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/walterzhaoJR[P]leveldb/third_party/googletest/googletest/include/gtest/gtest.h
|
testing::AssertionResult& testing::AssertionResult::operator<<<char [5]>(char const (&) [5])
|
AssertionResult& operator<<(const T& value) {
AppendMessage(Message() << value);
return *this;
}
|
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rsp, %r15
movq %r15, %rdi
callq 0x36908
movq (%r15), %r12
addq $0x10, %r12
movq %r14, %rdi
callq 0xa240
movq %r12, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0xa6b0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x10286
movq (%r15), %rdi
testq %rdi, %rdi
je 0x10277
movq (%rdi), %rax
callq *0x8(%rax)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
|
/walterzhaoJR[P]leveldb/third_party/googletest/googletest/include/gtest/gtest.h
|
bool testing::internal::MatchPrintAndExplain<leveldb::Status const, leveldb::Status const&>(leveldb::Status const&, testing::Matcher<leveldb::Status const&> const&, testing::MatchResultListener*)
|
bool MatchPrintAndExplain(Value& value, const Matcher<T>& matcher,
MatchResultListener* listener) {
if (!listener->IsInterested()) {
// If the listener is not interested, we do not need to construct the
// inner explanation.
return matcher.Matches(value);
}
StringMatchResultListener inner_listener;
const bool match = matcher.MatchAndExplain(value, &inner_listener);
UniversalPrint(value, listener->stream());
#if GTEST_HAS_RTTI
const std::string& type_name = GetTypeName<Value>();
if (IsReadableTypeName(type_name))
*listener->stream() << " (of type " << type_name << ")";
#endif
PrintIfNotEmpty(inner_listener.str(), listener->stream());
return match;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1b8, %rsp # imm = 0x1B8
movq %rsi, %r12
movq %rdi, %r15
cmpq $0x0, 0x8(%rdx)
je 0x1074d
movq %rdx, %r14
leaq 0x30(%rsp), %rbx
leaq 0x40(%rsp), %rax
movq %rax, -0x18(%rax)
leaq 0x6ed49(%rip), %r13 # 0x7f3d8
movq %r13, -0x20(%rax)
movq %rbx, %rdi
callq 0xa430
movq 0x8(%r12), %rdi
movq (%rdi), %rax
leaq 0x20(%rsp), %rdx
movq %r15, %rsi
callq *0x20(%rax)
movl %eax, %ebp
movq 0x8(%r14), %rdx
movl $0x8, %esi
movq %r15, %rdi
callq 0x4dd12
leaq 0x48(%rsp), %rsi
movq %rsp, %r15
movq %r15, %rdi
callq 0xaa40
movq 0x8(%r14), %r14
leaq 0x516e9(%rip), %rsi # 0x61dc5
movq %r15, %rdi
callq 0xa150
testq %r14, %r14
je 0x10712
testl %eax, %eax
je 0x10712
leaq 0x4f76a(%rip), %rsi # 0x5fe5e
movl $0x2, %edx
movq %r14, %rdi
callq 0xa6b0
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r14, %rdi
callq 0xa6b0
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10725
callq 0xa570
leaq 0xb0(%rsp), %r14
movq %r13, -0x90(%r14)
movq 0x70845(%rip), %rsi # 0x80f80
movq %rbx, %rdi
callq 0xa480
movq %r14, %rdi
callq 0xa1b0
jmp 0x10774
leaq 0x20(%rsp), %rdx
movq $0x0, 0x8(%rdx)
leaq 0x6ec57(%rip), %rax # 0x7f3b8
movq %rax, (%rdx)
movq 0x8(%r12), %rdi
movq (%rdi), %rax
movq %r15, %rsi
callq *0x20(%rax)
movl %eax, %ebp
movl %ebp, %eax
addq $0x1b8, %rsp # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/walterzhaoJR[P]leveldb/third_party/googletest/googlemock/include/gmock/gmock-matchers.h
|
testing::AssertionResult testing::internal::CmpHelperEQFailure<char [6], std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>(char const*, char const*, char const (&) [6], std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
|
AssertionResult CmpHelperEQFailure(const char* lhs_expression,
const char* rhs_expression,
const T1& lhs, const T2& rhs) {
return EqFailure(lhs_expression,
rhs_expression,
FormatForComparisonFailureMessage(lhs, rhs),
FormatForComparisonFailureMessage(rhs, lhs),
false);
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r8, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x8(%rsp), %rsi
movq %rcx, (%rsi)
leaq 0x28(%rsp), %r13
movq %r13, %rdi
callq 0x10b12
leaq 0x8(%rsp), %rbp
movq %rbp, %rdi
movq %r14, %rsi
callq 0x10bf4
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r13, %rcx
movq %rbp, %r8
xorl %r9d, %r9d
callq 0x37a09
movq (%rbp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x10d11
callq 0xa570
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10d24
callq 0xa570
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/walterzhaoJR[P]leveldb/third_party/googletest/googletest/include/gtest/gtest.h
|
leveldb::DBImpl::~DBImpl()
|
DBImpl::~DBImpl() {
// Wait for background work to finish.
mutex_.Lock();
shutting_down_.store(true, std::memory_order_release);
while (background_compaction_scheduled_) {
background_work_finished_signal_.Wait();
}
mutex_.Unlock();
if (db_lock_ != nullptr) {
env_->UnlockFile(db_lock_);
}
delete versions_;
if (mem_ != nullptr) mem_->Unref();
if (imm_ != nullptr) imm_->Unref();
delete tmp_batch_;
delete log_;
delete logfile_;
delete table_cache_;
if (owns_info_log_) {
delete options_.info_log;
}
if (owns_cache_) {
delete options_.block_cache;
}
}
|
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x6e103(%rip), %rax # 0x7f3f8
movq %rax, (%rdi)
leaq 0xc8(%rdi), %r14
movq %r14, %rdi
callq 0xa950
testl %eax, %eax
jne 0x114cc
movb $0x1, 0xf0(%rbx)
cmpb $0x1, 0x218(%rbx)
jne 0x1134d
leaq 0xf8(%rbx), %r15
movq %rsp, %r12
movq 0x128(%rbx), %rax
movq %rax, (%rsp)
movb $0x1, 0x8(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0xa160
cmpb $0x0, 0x218(%rbx)
jne 0x11329
movq %r14, %rdi
callq 0xa4a0
movq 0xc0(%rbx), %rdx
testq %rdx, %rdx
je 0x11383
movq 0x8(%rbx), %rsi
movq (%rsi), %rax
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq *0x80(%rax)
movq (%r14), %rdi
testq %rdi, %rdi
je 0x11383
callq 0xa810
movq 0x228(%rbx), %r14
testq %r14, %r14
je 0x11397
movq %r14, %rdi
callq 0x1eba8
movq %r14, %rdi
callq 0xa570
movq 0x130(%rbx), %rdi
testq %rdi, %rdi
je 0x113b0
callq 0x15db4
movq 0x138(%rbx), %rdi
testq %rdi, %rdi
je 0x113c1
callq 0x15db4
movq 0x1b8(%rbx), %r14
testq %r14, %r14
je 0x113d5
movq %r14, %rdi
callq 0x231aa
movq %r14, %rdi
callq 0xa570
movq 0x158(%rbx), %r14
testq %r14, %r14
je 0x113f1
movq %r14, %rdi
callq 0x19982
movq %r14, %rdi
callq 0xa570
movq 0x148(%rbx), %rdi
testq %rdi, %rdi
je 0x1140b
movq (%rdi), %rax
callq *0x8(%rax)
movq 0xb8(%rbx), %r14
testq %r14, %r14
je 0x1141f
movq %r14, %rdi
callq 0x1c4f8
movq %r14, %rdi
callq 0xa570
cmpb $0x1, 0x90(%rbx)
jne 0x1143f
movq 0x48(%rbx), %rdi
testq %rdi, %rdi
je 0x1143f
movq (%rdi), %rax
callq *0x8(%rax)
cmpb $0x1, 0x91(%rbx)
jne 0x11457
movq 0x60(%rbx), %rdi
testq %rdi, %rdi
je 0x11457
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x230(%rbx), %rdi
testq %rdi, %rdi
je 0x11468
callq 0xa810
leaq 0x1e8(%rbx), %rdi
movq 0x1f8(%rbx), %rsi
callq 0x161bc
leaq 0x168(%rbx), %rdi
callq 0x16886
leaq 0xf8(%rbx), %rdi
callq 0xabf0
movq 0x98(%rbx), %rdi
leaq 0xa8(%rbx), %rax
cmpq %rax, %rdi
je 0x114ab
callq 0xa570
leaq 0x20(%rbx), %rdi
callq 0x274d0
addq $0x10, %rbx
movq %rbx, %rdi
callq 0x26cfc
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl %eax, %edi
callq 0xa3f0
nop
|
/walterzhaoJR[P]leveldb/db/db_impl.cc
|
leveldb::DBImpl::CompactRange(leveldb::Slice const*, leveldb::Slice const*)
|
void DBImpl::CompactRange(const Slice* begin, const Slice* end) {
int max_level_with_files = 1;
{
MutexLock l(&mutex_);
Version* base = versions_->current();
for (int level = 1; level < config::kNumLevels; level++) {
if (base->OverlapInLevel(level, begin, end)) {
max_level_with_files = level;
}
}
}
TEST_CompactMemTable(); // TODO(sanjay): Skip if memtable does not overlap
for (int level = 0; level < max_level_with_files; level++) {
TEST_CompactRange(level, begin, end);
}
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
addq $0xc8, %rdi
movq %rdi, 0x8(%rsp)
callq 0xa950
testl %eax, %eax
jne 0x12dbb
movq 0x228(%r15), %rax
movq 0x168(%rax), %r13
movl $0x1, %ebp
movl $0x1, %r12d
movq %r13, %rdi
movl %ebp, %esi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x1e414
testb %al, %al
cmovnel %ebp, %r12d
incl %ebp
cmpl $0x7, %ebp
jne 0x12d49
movq 0x8(%rsp), %rdi
callq 0xa4a0
leaq 0x10(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x12dc2
movq (%r13), %rdi
testq %rdi, %rdi
je 0x12d8e
callq 0xa810
testl %r12d, %r12d
jle 0x12dac
xorl %ebp, %ebp
movq %r15, %rdi
movl %ebp, %esi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x12e98
incl %ebp
cmpl %ebp, %r12d
jne 0x12d95
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0xa3f0
|
/walterzhaoJR[P]leveldb/db/db_impl.cc
|
leveldb::DBImpl::TEST_CompactMemTable()
|
Status DBImpl::TEST_CompactMemTable() {
// nullptr batch means just wait for earlier writes to be done
Status s = Write(WriteOptions(), nullptr);
if (s.ok()) {
// Wait until the compaction completes
MutexLock l(&mutex_);
while (imm_ != nullptr && bg_error_.ok()) {
background_work_finished_signal_.Wait();
}
if (imm_ != nullptr) {
s = bg_error_;
}
}
return s;
}
|
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movq %rsp, %rdx
movb $0x0, (%rdx)
movq (%rsi), %rax
xorl %ecx, %ecx
callq *0x20(%rax)
cmpq $0x0, (%rbx)
jne 0x12e80
leaq 0xc8(%r15), %r14
movq %r14, %rdi
callq 0xa950
testl %eax, %eax
jne 0x12e91
cmpq $0x0, 0x138(%r15)
je 0x12e78
leaq 0xf8(%r15), %r12
movq %rsp, %r13
movq 0x230(%r15), %rdi
testq %rdi, %rdi
jne 0x12e4b
movq 0x128(%r15), %rax
movq %rax, (%rsp)
movb $0x1, 0x8(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0xa160
cmpq $0x0, 0x138(%r15)
jne 0x12e18
jmp 0x12e78
movq (%rbx), %rax
cmpq %rdi, %rax
je 0x12e78
testq %rax, %rax
je 0x12e6c
movq %rax, %rdi
callq 0xa810
movq 0x230(%r15), %rdi
testq %rdi, %rdi
je 0x12e73
callq 0x27780
jmp 0x12e75
xorl %eax, %eax
movq %rax, (%rbx)
movq %r14, %rdi
callq 0xa4a0
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movl %eax, %edi
callq 0xa3f0
|
/walterzhaoJR[P]leveldb/db/db_impl.cc
|
leveldb::DBImpl::BackgroundCall()
|
void DBImpl::BackgroundCall() {
MutexLock l(&mutex_);
assert(background_compaction_scheduled_);
if (shutting_down_.load(std::memory_order_acquire)) {
// No more background work when shutting down.
} else if (!bg_error_.ok()) {
// No more background work after a background error.
} else {
BackgroundCompaction();
}
background_compaction_scheduled_ = false;
// Previous compaction may have produced too many files in a level,
// so reschedule another compaction if needed.
MaybeScheduleCompaction();
background_work_finished_signal_.SignalAll();
}
|
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0xc8(%rdi), %rbx
movq %rbx, %rdi
callq 0xa950
testl %eax, %eax
jne 0x131f7
cmpb $0x0, 0x218(%r14)
je 0x131fe
movb 0xf0(%r14), %al
testb $0x1, %al
jne 0x131c9
cmpq $0x0, 0x230(%r14)
jne 0x131c9
movq %r14, %rdi
callq 0x1321e
movb $0x0, 0x218(%r14)
movq %r14, %rdi
callq 0x13108
addq $0xf8, %r14
movq %r14, %rdi
callq 0xab00
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xa4a0
movl %eax, %edi
callq 0xa3f0
leaq 0x46955(%rip), %rdi # 0x59b5a
leaq 0x46680(%rip), %rsi # 0x5988c
leaq 0x46968(%rip), %rcx # 0x59b7b
movl $0x2a8, %edx # imm = 0x2A8
callq 0xa3e0
nop
|
/walterzhaoJR[P]leveldb/db/db_impl.cc
|
leveldb::DBImpl::DoCompactionWork(leveldb::DBImpl::CompactionState*)
|
Status DBImpl::DoCompactionWork(CompactionState* compact) {
const uint64_t start_micros = env_->NowMicros();
int64_t imm_micros = 0; // Micros spent doing imm_ compactions
Log(options_.info_log, "Compacting %d@%d + %d@%d files",
compact->compaction->num_input_files(0), compact->compaction->level(),
compact->compaction->num_input_files(1),
compact->compaction->level() + 1);
assert(versions_->NumLevelFiles(compact->compaction->level()) > 0);
assert(compact->builder == nullptr);
assert(compact->outfile == nullptr);
if (snapshots_.empty()) {
compact->smallest_snapshot = versions_->LastSequence();
} else {
compact->smallest_snapshot = snapshots_.oldest()->sequence_number();
}
Iterator* input = versions_->MakeInputIterator(compact->compaction);
// Release mutex while we're actually doing the compaction work
mutex_.Unlock();
input->SeekToFirst();
Status status;
ParsedInternalKey ikey;
std::string current_user_key;
bool has_current_user_key = false;
SequenceNumber last_sequence_for_key = kMaxSequenceNumber;
while (input->Valid() && !shutting_down_.load(std::memory_order_acquire)) {
// Prioritize immutable compaction work
if (has_imm_.load(std::memory_order_relaxed)) {
const uint64_t imm_start = env_->NowMicros();
mutex_.Lock();
if (imm_ != nullptr) {
CompactMemTable();
// Wake up MakeRoomForWrite() if necessary.
background_work_finished_signal_.SignalAll();
}
mutex_.Unlock();
imm_micros += (env_->NowMicros() - imm_start);
}
Slice key = input->key();
if (compact->compaction->ShouldStopBefore(key) &&
compact->builder != nullptr) {
status = FinishCompactionOutputFile(compact, input);
if (!status.ok()) {
break;
}
}
// Handle key/value, add to state, etc.
bool drop = false;
if (!ParseInternalKey(key, &ikey)) {
// Do not hide error keys
current_user_key.clear();
has_current_user_key = false;
last_sequence_for_key = kMaxSequenceNumber;
} else {
if (!has_current_user_key ||
user_comparator()->Compare(ikey.user_key, Slice(current_user_key)) !=
0) {
// First occurrence of this user key
current_user_key.assign(ikey.user_key.data(), ikey.user_key.size());
has_current_user_key = true;
last_sequence_for_key = kMaxSequenceNumber;
}
if (last_sequence_for_key <= compact->smallest_snapshot) {
// Hidden by an newer entry for same user key
drop = true; // (A)
} else if (ikey.type == kTypeDeletion &&
ikey.sequence <= compact->smallest_snapshot &&
compact->compaction->IsBaseLevelForKey(ikey.user_key)) {
// For this user key:
// (1) there is no data in higher levels
// (2) data in lower levels will have larger sequence numbers
// (3) data in layers that are being compacted here and have
// smaller sequence numbers will be dropped in the next
// few iterations of this loop (by rule (A) above).
// Therefore this deletion marker is obsolete and can be dropped.
drop = true;
}
last_sequence_for_key = ikey.sequence;
}
#if 0
Log(options_.info_log,
" Compact: %s, seq %d, type: %d %d, drop: %d, is_base: %d, "
"%d smallest_snapshot: %d",
ikey.user_key.ToString().c_str(),
(int)ikey.sequence, ikey.type, kTypeValue, drop,
compact->compaction->IsBaseLevelForKey(ikey.user_key),
(int)last_sequence_for_key, (int)compact->smallest_snapshot);
#endif
if (!drop) {
// Open output file if necessary
if (compact->builder == nullptr) {
status = OpenCompactionOutputFile(compact);
if (!status.ok()) {
break;
}
}
if (compact->builder->NumEntries() == 0) {
compact->current_output()->smallest.DecodeFrom(key);
}
compact->current_output()->largest.DecodeFrom(key);
compact->builder->Add(key, input->value());
// Close output file if it is big enough
if (compact->builder->FileSize() >=
compact->compaction->MaxOutputFileSize()) {
status = FinishCompactionOutputFile(compact, input);
if (!status.ok()) {
break;
}
}
}
input->Next();
}
if (status.ok() && shutting_down_.load(std::memory_order_acquire)) {
status = Status::IOError("Deleting DB during compaction");
}
if (status.ok() && compact->builder != nullptr) {
status = FinishCompactionOutputFile(compact, input);
}
if (status.ok()) {
status = input->status();
}
delete input;
input = nullptr;
CompactionStats stats;
stats.micros = env_->NowMicros() - start_micros - imm_micros;
for (int which = 0; which < 2; which++) {
for (int i = 0; i < compact->compaction->num_input_files(which); i++) {
stats.bytes_read += compact->compaction->input(which, i)->file_size;
}
}
for (size_t i = 0; i < compact->outputs.size(); i++) {
stats.bytes_written += compact->outputs[i].file_size;
}
mutex_.Lock();
stats_[compact->compaction->level() + 1].Add(stats);
if (status.ok()) {
status = InstallCompactionResults(compact);
}
if (!status.ok()) {
RecordBackgroundError(status);
}
VersionSet::LevelSummaryStorage tmp;
Log(options_.info_log, "compacted to: %s", versions_->LevelSummary(&tmp));
return status;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x8(%rsp)
movq 0x8(%rsi), %rdi
movq (%rdi), %rax
callq *0xa8(%rax)
movq %rax, %rbx
movq (%r15), %rax
movq 0xc8(%rax), %rdx
subq 0xc0(%rax), %rdx
movq 0x48(%r14), %rdi
shrq $0x3, %rdx
movl (%rax), %ecx
movq 0xe0(%rax), %r8
subq 0xd8(%rax), %r8
shrq $0x3, %r8
leal 0x1(%rcx), %r9d
leaq 0x466c3(%rip), %rsi # 0x59e39
xorl %eax, %eax
callq 0x271f1
movq 0x228(%r14), %rdi
movq (%r15), %rax
movl (%rax), %esi
callq 0x1fdea
testl %eax, %eax
jle 0x13de4
cmpq $0x0, 0x30(%r15)
jne 0x13e03
movq %rbx, 0x48(%rsp)
cmpq $0x0, 0x28(%r15)
jne 0x13e22
leaq 0x1c0(%r14), %rax
movq 0x1d0(%r14), %rcx
movq 0x228(%r14), %rdi
leaq 0x58(%rdi), %rdx
leaq 0x18(%rcx), %rsi
cmpq %rax, %rcx
cmoveq %rdx, %rsi
movq (%rsi), %rax
movq %rax, 0x8(%r15)
movq (%r15), %rsi
callq 0x204e6
movq %rax, %rbp
leaq 0xc8(%r14), %rdi
movq %rdi, 0x20(%rsp)
callq 0xa4a0
movq (%rbp), %rax
movq %rbp, %rdi
callq *0x18(%rax)
xorl %ebx, %ebx
movq 0x8(%rsp), %rax
movq %rbx, (%rax)
leaq 0x4e5b2(%rip), %r12 # 0x61dc5
movq %r12, 0x28(%rsp)
movq %rbx, 0x30(%rsp)
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rbx, -0x8(%rax)
movb $0x0, (%rax)
movq (%rbp), %rax
movq %rbp, %rdi
callq *0x10(%rax)
testb %al, %al
je 0x13b91
movabsq $0xffffffffffffff, %r12 # imm = 0xFFFFFFFFFFFFFF
leaq 0xf8(%r14), %rax
movq %rax, 0x50(%rsp)
xorl %ebx, %ebx
leaq 0x10(%rsp), %r13
movl $0x0, 0x4(%rsp)
movb 0xf0(%r14), %al
testb $0x1, %al
jne 0x13b7f
movb 0x140(%r14), %al
testb $0x1, %al
je 0x138de
movq 0x8(%r14), %rdi
movq (%rdi), %rax
callq *0xa8(%rax)
movq %rax, %r13
movq 0x20(%rsp), %rdi
callq 0xa950
testl %eax, %eax
jne 0x13ddd
cmpq $0x0, 0x138(%r14)
je 0x138bc
movq %r14, %rdi
callq 0x12ad0
movq 0x50(%rsp), %rdi
callq 0xab00
movq 0x20(%rsp), %rdi
callq 0xa4a0
movq 0x8(%r14), %rdi
movq (%rdi), %rax
callq *0xa8(%rax)
subq %r13, %rbx
addq %rax, %rbx
leaq 0x10(%rsp), %r13
movq (%rbp), %rax
movq %rbp, %rdi
callq *0x40(%rax)
movq %rax, 0x78(%rsp)
movq %rdx, 0x80(%rsp)
movq (%r15), %rdi
leaq 0x78(%rsp), %rsi
callq 0x2196e
testb %al, %al
je 0x1394b
cmpq $0x0, 0x30(%r15)
je 0x1394b
movq %r13, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %rbp, %rcx
callq 0x140b8
movq 0x8(%rsp), %rax
movq (%rax), %rdi
movq 0x10(%rsp), %r13
movq %r13, (%rax)
movq %rdi, 0x10(%rsp)
testq %rdi, %rdi
je 0x1393d
callq 0xa810
testq %r13, %r13
leaq 0x10(%rsp), %r13
jne 0x13c08
movq 0x80(%rsp), %r8
cmpq $0x8, %r8
jb 0x13a06
movq 0x78(%rsp), %rcx
movq -0x8(%rcx,%r8), %rax
movzbl %al, %edx
shrq $0x8, %rax
movq %rax, 0x38(%rsp)
movl %edx, 0x40(%rsp)
addq $-0x8, %r8
movq %rcx, 0x28(%rsp)
movq %r8, 0x30(%rsp)
cmpl $0x2, %edx
jae 0x13a06
testb $0x1, 0x4(%rsp)
je 0x139bb
movq 0x18(%r14), %rdi
movups 0x58(%rsp), %xmm0
movups %xmm0, 0x10(%rsp)
movq (%rdi), %rax
leaq 0x28(%rsp), %rsi
movq %r13, %rdx
callq *0x10(%rax)
testl %eax, %eax
je 0x139d6
movq 0x28(%rsp), %rcx
movq 0x30(%rsp), %r8
movq 0x60(%rsp), %rdx
leaq 0x58(%rsp), %rdi
xorl %esi, %esi
callq 0xaa10
movabsq $0xffffffffffffff, %r12 # imm = 0xFFFFFFFFFFFFFF
movq 0x8(%r15), %rax
cmpq %rax, %r12
jbe 0x13b34
cmpl $0x0, 0x40(%rsp)
setne %cl
movq 0x38(%rsp), %r12
cmpq %rax, %r12
seta %al
orb %cl, %al
je 0x13b5d
movb $0x1, %al
movl %eax, 0x4(%rsp)
jmp 0x13a29
movq $0x0, 0x60(%rsp)
movq 0x58(%rsp), %rax
movb $0x0, (%rax)
movl $0x0, 0x4(%rsp)
movabsq $0xffffffffffffff, %r12 # imm = 0xFFFFFFFFFFFFFF
movq 0x30(%r15), %rdi
testq %rdi, %rdi
jne 0x13a6c
movq %r13, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x13f28
movq 0x8(%rsp), %rax
movq (%rax), %rdi
movq 0x10(%rsp), %r13
movq %r13, (%rax)
movq %rdi, 0x10(%rsp)
testq %rdi, %rdi
je 0x13a5f
callq 0xa810
testq %r13, %r13
jne 0x13c08
movq 0x30(%r15), %rdi
callq 0x24afe
testq %rax, %rax
jne 0x13a96
movq 0x18(%r15), %rdi
movq 0x78(%rsp), %rcx
movq 0x80(%rsp), %r8
movq -0x38(%rdi), %rdx
addq $-0x40, %rdi
xorl %esi, %esi
callq 0xaa10
movq 0x18(%r15), %rdi
movq 0x78(%rsp), %rcx
movq 0x80(%rsp), %r8
movq -0x18(%rdi), %rdx
addq $-0x20, %rdi
xorl %esi, %esi
callq 0xaa10
movq 0x30(%r15), %r13
movq (%rbp), %rax
movq %rbp, %rdi
callq *0x48(%rax)
movq %rax, 0x10(%rsp)
movq %rdx, 0x18(%rsp)
movq %r13, %rdi
leaq 0x78(%rsp), %rsi
leaq 0x10(%rsp), %r13
movq %r13, %rdx
callq 0x2429a
movq 0x30(%r15), %rdi
callq 0x24b0a
movq (%r15), %rcx
cmpq 0x8(%rcx), %rax
jb 0x13b3f
movq %r13, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %rbp, %rcx
callq 0x140b8
movq 0x8(%rsp), %rax
movq (%rax), %rdi
movq 0x10(%rsp), %r13
movq %r13, (%rax)
movq %rdi, 0x10(%rsp)
testq %rdi, %rdi
je 0x13b25
callq 0xa810
testq %r13, %r13
leaq 0x10(%rsp), %r13
je 0x13b3f
jmp 0x13c08
movb $0x1, %al
movl %eax, 0x4(%rsp)
movq 0x38(%rsp), %r12
movq (%rbp), %rax
movq %rbp, %rdi
callq *0x30(%rax)
movq (%rbp), %rax
movq %rbp, %rdi
callq *0x10(%rax)
testb %al, %al
jne 0x13864
jmp 0x13b7f
movq (%r15), %rdi
leaq 0x28(%rsp), %rsi
callq 0x21846
movb $0x1, %cl
movl %ecx, 0x4(%rsp)
movq 0x38(%rsp), %r12
testb %al, %al
je 0x13a29
jmp 0x13b3f
movq 0x8(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x13c08
leaq 0x4e234(%rip), %r12 # 0x61dc5
movb 0xf0(%r14), %al
testb $0x1, %al
je 0x13bf7
leaq 0x4632c(%rip), %rax # 0x59ecf
leaq 0x78(%rsp), %rdx
movq %rax, (%rdx)
movq $0x1d, 0x8(%rdx)
leaq 0x10(%rsp), %rcx
movq %r12, (%rcx)
movq $0x0, 0x8(%rcx)
leaq 0xe0(%rsp), %r12
movq %r12, %rdi
movl $0x5, %esi
callq 0x277ac
movq 0x8(%rsp), %rax
movq (%rax), %rdi
movq (%r12), %r13
movq %r13, (%rax)
movq %rdi, (%r12)
testq %rdi, %rdi
je 0x13bff
callq 0xa810
jmp 0x13bff
movq 0x8(%rsp), %rax
movq (%rax), %r13
testq %r13, %r13
je 0x13d7e
movl $0x0, 0x4(%rsp)
movq (%rbp), %rax
movq %rbp, %rdi
callq *0x8(%rax)
movq 0x8(%r14), %rdi
movq (%rdi), %rax
callq *0xa8(%rax)
movq %rax, %r12
movl $0xc0, %eax
addq (%r15), %rax
addq 0x48(%rsp), %rbx
movb $0x1, %cl
xorl %edx, %edx
xorl %ebp, %ebp
leaq (%rdx,%rdx,2), %rsi
movq (%rax,%rsi,8), %rdx
movq 0x8(%rax,%rsi,8), %rsi
subq %rdx, %rsi
shrq $0x3, %rsi
testl %esi, %esi
jle 0x13c6d
andl $0x7fffffff, %esi # imm = 0x7FFFFFFF
xorl %edi, %edi
movq (%rdx,%rdi,8), %r8
addq 0x10(%r8), %rbp
incq %rdi
cmpq %rdi, %rsi
jne 0x13c5d
movl $0x1, %edx
testb $0x1, %cl
movl $0x0, %ecx
jne 0x13c3d
movq 0x10(%r15), %rax
movq 0x18(%r15), %rdx
subq %rax, %rdx
je 0x13cb8
sarq $0x4, %rdx
movabsq $-0x3333333333333333, %rcx # imm = 0xCCCCCCCCCCCCCCCD
imulq %rdx, %rcx
cmpq $0x1, %rcx
adcq $0x0, %rcx
addq $0x8, %rax
xorl %r13d, %r13d
addq (%rax), %r13
addq $0x50, %rax
decq %rcx
jne 0x13caa
jmp 0x13cbb
xorl %r13d, %r13d
movq 0x20(%rsp), %rdi
callq 0xa950
testl %eax, %eax
jne 0x13ddd
subq %rbx, %r12
movq (%r15), %rax
movslq (%rax), %rax
leaq (%rax,%rax,2), %rax
addq %r12, 0x250(%r14,%rax,8)
addq %rbp, 0x258(%r14,%rax,8)
addq %r13, 0x260(%r14,%rax,8)
cmpb $0x0, 0x4(%rsp)
je 0x13d1d
leaq 0x78(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1432e
movq (%r12), %rax
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
testq %rax, %rax
je 0x13d2a
movq %r14, %rdi
movq 0x8(%rsp), %rsi
callq 0x12ccc
movq 0x48(%r14), %r15
movq 0x228(%r14), %rdi
leaq 0x78(%rsp), %rsi
callq 0x1fe50
leaq 0x461a7(%rip), %rsi # 0x59eed
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x271f1
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x13d67
callq 0xa570
movq 0x8(%rsp), %rax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x0, 0x30(%r15)
je 0x13db0
leaq 0x78(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %rbp, %rcx
callq 0x140b8
movq (%r12), %rax
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
testq %rax, %rax
jne 0x13c08
movq (%rbp), %rax
leaq 0x78(%rsp), %r12
movq %r12, %rdi
movq %rbp, %rsi
callq *0x50(%rax)
movq (%r12), %rax
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
testq %rax, %rax
sete %al
movl %eax, 0x4(%rsp)
jmp 0x13c10
movl %eax, %edi
callq 0xa3f0
leaq 0x4606d(%rip), %rdi # 0x59e58
leaq 0x45a9a(%rip), %rsi # 0x5988c
leaq 0x4609a(%rip), %rcx # 0x59e93
movl $0x380, %edx # imm = 0x380
callq 0xa3e0
leaq 0x45f1a(%rip), %rdi # 0x59d24
leaq 0x45a7b(%rip), %rsi # 0x5988c
leaq 0x4607b(%rip), %rcx # 0x59e93
movl $0x381, %edx # imm = 0x381
callq 0xa3e0
leaq 0x45e4d(%rip), %rdi # 0x59c76
leaq 0x45a5c(%rip), %rsi # 0x5988c
leaq 0x4605c(%rip), %rcx # 0x59e93
movl $0x382, %edx # imm = 0x382
callq 0xa3e0
nop
|
/walterzhaoJR[P]leveldb/db/db_impl.cc
|
leveldb::DBImpl::OpenCompactionOutputFile(leveldb::DBImpl::CompactionState*)
|
Status DBImpl::OpenCompactionOutputFile(CompactionState* compact) {
assert(compact != nullptr);
assert(compact->builder == nullptr);
uint64_t file_number;
{
mutex_.Lock();
file_number = versions_->NewFileNumber();
pending_outputs_.insert(file_number);
CompactionState::Output out;
out.number = file_number;
out.smallest.Clear();
out.largest.Clear();
compact->outputs.push_back(out);
mutex_.Unlock();
}
// Make the output file
std::string fname = TableFileName(dbname_, file_number);
Status s = env_->NewWritableFile(fname, &compact->outfile);
if (s.ok()) {
compact->builder = new TableBuilder(options_, compact->outfile);
}
return s;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
testq %rdx, %rdx
je 0x14073
movq %rdx, %r14
cmpq $0x0, 0x30(%rdx)
jne 0x14092
movq %rsi, %r15
movq %rdi, %rbx
leaq 0xc8(%rsi), %r12
movq %r12, %rdi
callq 0xa950
testl %eax, %eax
jne 0x140b1
movq 0x228(%r15), %rax
movq 0x48(%rax), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x48(%rax)
movq %rsp, %r13
movq %rcx, (%r13)
leaq 0x1e8(%r15), %rdi
movq %r13, %rsi
callq 0x170c2
leaq 0x28(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x48(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%r13), %rax
movq %rax, -0x40(%rbp)
xorl %eax, %eax
movq %rax, -0x28(%rbp)
movb %al, -0x20(%rbp)
movq %rax, -0x8(%rbp)
movb %al, (%rbp)
leaq 0x10(%r14), %rdi
leaq 0x8(%rsp), %r13
movq %r13, %rsi
callq 0x15fb8
movq %r12, %rdi
callq 0xa4a0
movq 0x30(%r13), %rdi
cmpq %rbp, %rdi
je 0x13fe4
callq 0xa570
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x13ff8
callq 0xa570
leaq 0x98(%r15), %rsi
movq (%rsp), %rdx
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x18c9d
movq 0x8(%r15), %rsi
leaq 0x28(%r14), %rcx
movq (%rsi), %rax
movq %rbx, %rdi
movq %r12, %rdx
callq *0x20(%rax)
cmpq $0x0, (%rbx)
jne 0x1404e
movl $0x8, %edi
callq 0xa5c0
movq %rax, %r12
addq $0x30, %r15
movq 0x28(%r14), %rdx
movq %rax, %rdi
movq %r15, %rsi
callq 0x240fc
movq %r12, 0x30(%r14)
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x14061
callq 0xa570
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x45c53(%rip), %rdi # 0x59ccd
leaq 0x4580b(%rip), %rsi # 0x5988c
leaq 0x45c58(%rip), %rcx # 0x59ce0
movl $0x31c, %edx # imm = 0x31C
callq 0xa3e0
leaq 0x45c8b(%rip), %rdi # 0x59d24
leaq 0x457ec(%rip), %rsi # 0x5988c
leaq 0x45c39(%rip), %rcx # 0x59ce0
movl $0x31d, %edx # imm = 0x31D
callq 0xa3e0
movl %eax, %edi
callq 0xa3f0
|
/walterzhaoJR[P]leveldb/db/db_impl.cc
|
leveldb::DBImpl::InstallCompactionResults(leveldb::DBImpl::CompactionState*)
|
Status DBImpl::InstallCompactionResults(CompactionState* compact) {
mutex_.AssertHeld();
Log(options_.info_log, "Compacted %d@%d + %d@%d files => %lld bytes",
compact->compaction->num_input_files(0), compact->compaction->level(),
compact->compaction->num_input_files(1), compact->compaction->level() + 1,
static_cast<long long>(compact->total_bytes));
// Add compaction outputs
compact->compaction->AddInputDeletions(compact->compaction->edit());
const int level = compact->compaction->level();
for (size_t i = 0; i < compact->outputs.size(); i++) {
const CompactionState::Output& out = compact->outputs[i];
compact->compaction->edit()->AddFile(level + 1, out.number, out.file_size,
out.smallest, out.largest);
}
return versions_->LogAndApply(compact->compaction->edit(), &mutex_);
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x10(%rsp)
movq 0x48(%rsi), %rdi
movq (%rdx), %rax
movq 0xc8(%rax), %rdx
subq 0xc0(%rax), %rdx
movq 0x38(%r15), %rsi
shrq $0x3, %rdx
movl (%rax), %ecx
movq 0xe0(%rax), %r8
subq 0xd8(%rax), %r8
shrq $0x3, %r8
leal 0x1(%rcx), %r9d
movq %rsi, (%rsp)
leaq 0x45a86(%rip), %rsi # 0x59e0d
xorl %eax, %eax
callq 0x271f1
movq (%r15), %rdi
leaq 0x18(%rdi), %rsi
callq 0x21792
movq 0x10(%r15), %r9
cmpq %r9, 0x18(%r15)
je 0x143fe
movq (%r15), %rax
movl (%rax), %ebp
incl %ebp
movl $0x30, %r12d
xorl %r13d, %r13d
movabsq $-0x3333333333333333, %rbx # imm = 0xCCCCCCCCCCCCCCCD
movq (%r15), %rdi
addq $0x18, %rdi
leaq (%r9,%r12), %r8
addq $-0x20, %r8
addq %r12, %r9
movq -0x10(%r8), %rdx
movq -0x8(%r8), %rcx
movl %ebp, %esi
callq 0x15e88
incq %r13
movq 0x10(%r15), %r9
movq 0x18(%r15), %rax
subq %r9, %rax
sarq $0x4, %rax
imulq %rbx, %rax
addq $0x50, %r12
cmpq %rax, %r13
jb 0x143be
movq 0x228(%r14), %rsi
addq $0xc8, %r14
movq (%r15), %rdx
addq $0x18, %rdx
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
callq 0x1ec76
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
|
/walterzhaoJR[P]leveldb/db/db_impl.cc
|
leveldb::(anonymous namespace)::CleanupIteratorState(void*, void*)
|
static void CleanupIteratorState(void* arg1, void* arg2) {
IterState* state = reinterpret_cast<IterState*>(arg1);
state->mu->Lock();
state->mem->Unref();
if (state->imm != nullptr) state->imm->Unref();
state->version->Unref();
state->mu->Unlock();
delete state;
}
|
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0xa950
testl %eax, %eax
jne 0x14604
movq 0x10(%rbx), %rdi
callq 0x15db4
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x145ea
callq 0x15db4
movq 0x8(%rbx), %rdi
callq 0x1e3a4
movq (%rbx), %rdi
callq 0xa4a0
movq %rbx, %rdi
popq %rbx
jmp 0xa570
movl %eax, %edi
callq 0xa3f0
nop
|
/walterzhaoJR[P]leveldb/db/db_impl.cc
|
leveldb::DBImpl::Get(leveldb::ReadOptions const&, leveldb::Slice const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*)
|
Status DBImpl::Get(const ReadOptions& options, const Slice& key,
std::string* value) {
Status s;
MutexLock l(&mutex_);
SequenceNumber snapshot;
if (options.snapshot != nullptr) {
snapshot =
static_cast<const SnapshotImpl*>(options.snapshot)->sequence_number();
} else {
snapshot = versions_->LastSequence();
}
MemTable* mem = mem_;
MemTable* imm = imm_;
Version* current = versions_->current();
mem->Ref();
if (imm != nullptr) imm->Ref();
current->Ref();
bool have_stat_update = false;
Version::GetStats stats;
// Unlock while reading from files and memtables
{
mutex_.Unlock();
// First look in the memtable, then in the immutable memtable (if any).
LookupKey lkey(key, snapshot);
if (mem->Get(lkey, value, &s)) {
// Done
} else if (imm != nullptr && imm->Get(lkey, value, &s)) {
// Done
} else {
s = current->Get(options, lkey, value, &stats);
have_stat_update = true;
}
mutex_.Lock();
}
if (have_stat_update && current->UpdateStats(stats)) {
MaybeScheduleCompaction();
}
mem->Unref();
if (imm != nullptr) imm->Unref();
current->Unref();
return s;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp # imm = 0x128
movq %r8, 0x8(%rsp)
movq %rcx, 0x28(%rsp)
movq %rdx, %r15
movq %rsi, %rbp
movq %rdi, %r12
movq $0x0, (%rdi)
leaq 0xc8(%rsi), %r14
movq %r14, %rdi
callq 0xa950
testl %eax, %eax
jne 0x1485d
movq %r15, 0x20(%rsp)
movq 0x8(%r15), %rax
leaq 0x18(%rax), %rcx
movq 0x228(%rbp), %rdx
leaq 0x58(%rdx), %rsi
testq %rax, %rax
cmoveq %rsi, %rcx
movq (%rcx), %rbx
movq 0x130(%rbp), %rax
movq 0x138(%rbp), %r15
movq 0x168(%rdx), %rdi
movq %rax, %r13
incl 0x10(%rax)
testq %r15, %r15
je 0x14700
incl 0x10(%r15)
movq %rdi, 0x10(%rsp)
callq 0x1e3a0
movq %r14, 0x18(%rsp)
movq %r14, %rdi
callq 0xa4a0
leaq 0x48(%rsp), %r14
movq %r14, %rdi
movq 0x28(%rsp), %rsi
movq %rbx, %rdx
callq 0x18b18
movq %r13, %rdi
movq %r14, %rsi
movq 0x8(%rsp), %rdx
movq %r12, %rcx
callq 0x19f30
testb %al, %al
jne 0x14761
testq %r15, %r15
je 0x1479a
leaq 0x48(%rsp), %rsi
movq %r15, %rdi
movq 0x8(%rsp), %rdx
movq %r12, %rcx
callq 0x19f30
testb %al, %al
je 0x1479a
movq 0x18(%rsp), %rdi
callq 0xa950
testl %eax, %eax
jne 0x1485d
leaq 0x60(%rsp), %rax
movq -0x18(%rax), %rdi
cmpq %rax, %rdi
sete %al
testq %rdi, %rdi
sete %cl
orb %al, %cl
jne 0x1481f
callq 0xa810
jmp 0x1481f
leaq 0x30(%rsp), %rbx
leaq 0x48(%rsp), %rcx
leaq 0x38(%rsp), %r9
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq 0x8(%rsp), %r8
callq 0x1e0d0
movq (%r12), %rdi
movq (%rbx), %rax
movq %rax, (%r12)
movq %rdi, (%rbx)
testq %rdi, %rdi
je 0x147d8
callq 0xa810
movq 0x18(%rsp), %rdi
callq 0xa950
testl %eax, %eax
jne 0x1485d
leaq 0x60(%rsp), %rax
movq -0x18(%rax), %rdi
cmpq %rax, %rdi
sete %al
testq %rdi, %rdi
sete %cl
orb %al, %cl
jne 0x14804
callq 0xa810
leaq 0x38(%rsp), %rsi
movq 0x10(%rsp), %rdi
callq 0x1e2c4
testb %al, %al
je 0x1481f
movq %rbp, %rdi
callq 0x13108
movq %r13, %rdi
callq 0x15db4
testq %r15, %r15
je 0x14834
movq %r15, %rdi
callq 0x15db4
movq 0x10(%rsp), %rdi
callq 0x1e3a4
movq 0x18(%rsp), %rdi
callq 0xa4a0
movq %r12, %rax
addq $0x128, %rsp # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0xa3f0
|
/walterzhaoJR[P]leveldb/db/db_impl.cc
|
leveldb::DBImpl::RecordReadSample(leveldb::Slice)
|
void DBImpl::RecordReadSample(Slice key) {
MutexLock l(&mutex_);
if (versions_->current()->RecordReadSample(key)) {
MaybeScheduleCompaction();
}
}
|
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
leaq 0xc8(%rdi), %rbx
movq %rbx, %rdi
callq 0xa950
testl %eax, %eax
jne 0x14916
movq 0x228(%r14), %rax
movq 0x168(%rax), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x1e2fa
testb %al, %al
je 0x14903
movq %r14, %rdi
callq 0x13108
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xa4a0
movl %eax, %edi
callq 0xa3f0
nop
|
/walterzhaoJR[P]leveldb/db/db_impl.cc
|
leveldb::DBImpl::ReleaseSnapshot(leveldb::Snapshot const*)
|
void DBImpl::ReleaseSnapshot(const Snapshot* snapshot) {
MutexLock l(&mutex_);
snapshots_.Delete(static_cast<const SnapshotImpl*>(snapshot));
}
|
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0xc8(%rdi), %rbx
movq %rbx, %rdi
callq 0xa950
testl %eax, %eax
jne 0x149ad
addq $0x1c0, %r15 # imm = 0x1C0
movq %r15, %rdi
movq %r14, %rsi
callq 0x1604e
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xa4a0
movl %eax, %edi
callq 0xa3f0
|
/walterzhaoJR[P]leveldb/db/db_impl.cc
|
leveldb::DBImpl::BuildBatchGroup(leveldb::DBImpl::Writer**)
|
WriteBatch* DBImpl::BuildBatchGroup(Writer** last_writer) {
mutex_.AssertHeld();
assert(!writers_.empty());
Writer* first = writers_.front();
WriteBatch* result = first->batch;
assert(result != nullptr);
size_t size = WriteBatchInternal::ByteSize(first->batch);
// Allow the group to grow up to a maximum size, but if the
// original write is small, limit the growth so we do not slow
// down the small write too much.
size_t max_size = 1 << 20;
if (size <= (128 << 10)) {
max_size = size + (128 << 10);
}
*last_writer = first;
std::deque<Writer*>::iterator iter = writers_.begin();
++iter; // Advance past "first"
for (; iter != writers_.end(); ++iter) {
Writer* w = *iter;
if (w->sync && !first->sync) {
// Do not include a sync write into a batch handled by a non-sync write.
break;
}
if (w->batch != nullptr) {
size += WriteBatchInternal::ByteSize(w->batch);
if (size > max_size) {
// Do not make batch too big
break;
}
// Append to *result
if (result == first->batch) {
// Switch to temporary batch instead of disturbing caller's batch
result = tmp_batch_;
assert(WriteBatchInternal::Count(result) == 0);
WriteBatchInternal::Append(result, first->batch);
}
WriteBatchInternal::Append(result, w->batch);
}
*last_writer = w;
}
return result;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, 0x18(%rsp)
movq 0x178(%rdi), %rax
movq %rdi, 0x8(%rsp)
cmpq %rax, 0x198(%rdi)
je 0x152b9
movq (%rax), %rcx
movq 0x8(%rcx), %rbx
testq %rbx, %rbx
je 0x152d8
movq 0x8(%rbx), %r13
leaq 0x20000(%r13), %rax
cmpq $0x20001, %r13 # imm = 0x20001
movl $0x100000, %edx # imm = 0x100000
cmovbq %rax, %rdx
movq %rdx, 0x20(%rsp)
movq 0x18(%rsp), %rax
movq %rcx, (%rax)
movq 0x8(%rsp), %rax
movq 0x178(%rax), %r14
movq 0x188(%rax), %r15
movq 0x190(%rax), %rbp
addq $0x8, %r14
cmpq %r15, %r14
jne 0x151d4
movq 0x8(%rbp), %r14
addq $0x8, %rbp
leaq 0x200(%r14), %r15
movq 0x8(%rsp), %rax
cmpq 0x198(%rax), %r14
je 0x15288
movq %rcx, 0x10(%rsp)
movq (%r14), %r12
cmpb $0x1, 0x10(%r12)
jne 0x15200
cmpb $0x1, 0x10(%rcx)
jne 0x15288
movq 0x8(%r12), %rsi
testq %rsi, %rsi
je 0x15251
addq 0x8(%rsi), %r13
cmpq 0x20(%rsp), %r13
ja 0x15288
cmpq 0x8(%rcx), %rbx
jne 0x15249
movq 0x8(%rsp), %rax
movq 0x1b8(%rax), %rbx
movq %rbx, %rdi
callq 0x233b6
testl %eax, %eax
jne 0x1529a
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x23440
movq 0x8(%r12), %rsi
movq %rbx, %rdi
callq 0x23440
movq 0x18(%rsp), %rax
movq %r12, (%rax)
addq $0x8, %r14
cmpq %r15, %r14
jne 0x15271
movq 0x8(%rbp), %r14
addq $0x8, %rbp
leaq 0x200(%r14), %r15
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rax
cmpq 0x198(%rax), %r14
jne 0x151eb
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x44cb9(%rip), %rdi # 0x59f5a
leaq 0x445e4(%rip), %rsi # 0x5988c
leaq 0x44c61(%rip), %rcx # 0x59f10
movl $0x529, %edx # imm = 0x529
callq 0xa3e0
leaq 0x44c3e(%rip), %rdi # 0x59efe
leaq 0x445c5(%rip), %rsi # 0x5988c
leaq 0x44c42(%rip), %rcx # 0x59f10
movl $0x505, %edx # imm = 0x505
callq 0xa3e0
leaq 0x44c69(%rip), %rdi # 0x59f48
leaq 0x445a6(%rip), %rsi # 0x5988c
leaq 0x44c23(%rip), %rcx # 0x59f10
movl $0x508, %edx # imm = 0x508
callq 0xa3e0
nop
|
/walterzhaoJR[P]leveldb/db/db_impl.cc
|
leveldb::DBImpl::GetApproximateSizes(leveldb::Range const*, int, unsigned long*)
|
void DBImpl::GetApproximateSizes(const Range* range, int n, uint64_t* sizes) {
// TODO(opt): better implementation
MutexLock l(&mutex_);
Version* v = versions_->current();
v->Ref();
for (int i = 0; i < n; i++) {
// Convert user_key into a corresponding internal key.
InternalKey k1(range[i].start, kMaxSequenceNumber, kValueTypeForSeek);
InternalKey k2(range[i].limit, kMaxSequenceNumber, kValueTypeForSeek);
uint64_t start = versions_->ApproximateOffsetOf(v, k1);
uint64_t limit = versions_->ApproximateOffsetOf(v, k2);
sizes[i] = (limit >= start ? limit - start : 0);
}
v->Unref();
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rcx, 0x40(%rsp)
movl %edx, %ebx
movq %rsi, (%rsp)
movq %rdi, %r12
addq $0xc8, %rdi
movq %rdi, 0x30(%rsp)
callq 0xa950
testl %eax, %eax
jne 0x157d3
movq 0x228(%r12), %rax
movq 0x168(%rax), %rdi
movq %rdi, 0x8(%rsp)
callq 0x1e3a0
testl %ebx, %ebx
jle 0x157ad
leaq 0x58(%rsp), %r15
movl %ebx, %eax
addq $0x10, (%rsp)
shlq $0x3, %rax
movq %rax, 0x38(%rsp)
xorl %r14d, %r14d
movq %r15, 0x48(%rsp)
xorl %r15d, %r15d
movq %r15, 0x50(%rsp)
movb %r15b, 0x58(%rsp)
movq %r12, %r13
movq (%rsp), %r12
movups -0x10(%r12,%r14,4), %xmm0
movaps %xmm0, 0x10(%rsp)
movabsq $0xffffffffffffff, %rbp # imm = 0xFFFFFFFFFFFFFF
movq %rbp, 0x20(%rsp)
movl $0x1, %eax
movl %eax, 0x28(%rsp)
leaq 0x48(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x18440
leaq 0x78(%rsp), %rbx
movq %rbx, 0x68(%rsp)
movq %r15, 0x70(%rsp)
movb %r15b, 0x78(%rsp)
movups (%r12,%r14,4), %xmm0
movq %r13, %r12
movaps %xmm0, 0x10(%rsp)
movq %rbp, 0x20(%rsp)
movl $0x1, %eax
movl %eax, 0x28(%rsp)
leaq 0x68(%rsp), %rbx
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
callq 0x18440
movq 0x228(%r13), %rdi
movq 0x8(%rsp), %r13
movq %r13, %rsi
leaq 0x48(%rsp), %rdx
callq 0x1fef0
movq %rax, %rbp
movq 0x228(%r12), %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x1fef0
subq %rbp, %rax
cmovbq %r15, %rax
movq 0x40(%rsp), %rcx
movq %rax, (%rcx,%r14)
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x1578a
callq 0xa570
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %r15
cmpq %r15, %rdi
je 0x1579e
callq 0xa570
addq $0x8, %r14
cmpq %r14, 0x38(%rsp)
jne 0x156ab
movq 0x8(%rsp), %rdi
callq 0x1e3a4
movq 0x30(%rsp), %rdi
callq 0xa4a0
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0xa3f0
|
/walterzhaoJR[P]leveldb/db/db_impl.cc
|
leveldb::DestroyDB(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, leveldb::Options const&)
|
Status DestroyDB(const std::string& dbname, const Options& options) {
Env* env = options.env;
std::vector<std::string> filenames;
Status result = env->GetChildren(dbname, &filenames);
if (!result.ok()) {
// Ignore error in case directory does not exist
return Status::OK();
}
FileLock* lock;
const std::string lockname = LockFileName(dbname);
result = env->LockFile(lockname, &lock);
if (result.ok()) {
uint64_t number;
FileType type;
for (size_t i = 0; i < filenames.size(); i++) {
if (ParseFileName(filenames[i], &number, &type) &&
type != kDBLockFile) { // Lock file will be deleted at end
Status del = env->RemoveFile(dbname + "/" + filenames[i]);
if (result.ok() && !del.ok()) {
result = del;
}
}
}
env->UnlockFile(lock); // Ignore error since state is already gone
env->RemoveFile(lockname);
env->RemoveDir(dbname); // Ignore error in case dir contains other files
}
return result;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rdx), %r15
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rcx
movaps %xmm0, (%rcx)
movq $0x0, 0x10(%rcx)
movq (%r15), %rax
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq *0x38(%rax)
movq (%r12), %rdi
testq %rdi, %rdi
je 0x15aff
movq $0x0, (%rbx)
callq 0xa810
leaq 0x20(%rsp), %rdi
callq 0x10390
movq %rbx, %rax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa8(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x18dc0
movq (%r15), %rax
leaq 0x40(%rsp), %r13
leaq 0x60(%rsp), %rcx
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *0x78(%rax)
movq 0x8(%rsp), %rdi
movq (%r13), %rax
movq %rax, 0x8(%rsp)
movq %rdi, (%r13)
testq %rdi, %rdi
je 0x15b4c
callq 0xa810
movq 0x8(%rsp), %rax
testq %rax, %rax
jne 0x15d27
movq %rbx, 0x38(%rsp)
movq 0x20(%rsp), %rdi
cmpq %rdi, 0x28(%rsp)
je 0x15ca4
leaq 0x50(%rsp), %r12
xorl %r13d, %r13d
leaq 0x68(%rsp), %rbp
xorl %ebx, %ebx
addq %r13, %rdi
leaq 0xa0(%rsp), %rsi
leaq 0x14(%rsp), %rdx
callq 0x18e8c
testb %al, %al
je 0x15c83
cmpl $0x1, 0x14(%rsp)
je 0x15c83
leaq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
movq %rbp, %rdi
callq 0xfb0e
movq %rbp, %rdi
leaq 0x4c489(%rip), %rsi # 0x62050
callq 0xac80
movq 0x20(%rsp), %rax
movq (%rax,%r13), %rsi
movq 0x8(%rax,%r13), %rdx
movq %rbp, %rdi
callq 0xa190
movq %r12, 0x40(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x15c02
movq %rdx, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
jmp 0x15c0a
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, 0x48(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%r15), %rax
leaq 0x18(%rsp), %rdi
movq %r15, %rsi
leaq 0x40(%rsp), %rdx
callq *0x40(%rax)
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x15c44
callq 0xa570
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x15c58
callq 0xa570
cmpq $0x0, 0x8(%rsp)
jne 0x15c74
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x15c83
callq 0x27780
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x15c83
callq 0xa810
incq %rbx
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rax
subq %rdi, %rax
sarq $0x5, %rax
addq $0x20, %r13
cmpq %rax, %rbx
jb 0x15b79
movq 0x60(%rsp), %rdx
movq (%r15), %rax
leaq 0x98(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq *0x80(%rax)
movq (%r12), %rdi
testq %rdi, %rdi
je 0x15cce
callq 0xa810
movq (%r15), %rax
leaq 0x90(%rsp), %r12
leaq 0xa8(%rsp), %rdx
movq %r12, %rdi
movq %r15, %rsi
callq *0x40(%rax)
movq (%r12), %rdi
testq %rdi, %rdi
je 0x15cf8
callq 0xa810
movq (%r15), %rax
leaq 0x88(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq *0x58(%rax)
movq (%r12), %rdi
testq %rdi, %rdi
movq 0x38(%rsp), %rbx
je 0x15d22
callq 0xa810
movq 0x8(%rsp), %rax
movq %rax, (%rbx)
movq $0x0, 0x8(%rsp)
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x15ae0
callq 0xa570
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
jne 0x15adb
jmp 0x15ae0
|
/walterzhaoJR[P]leveldb/db/db_impl.cc
|
leveldb::VersionEdit::~VersionEdit()
|
~VersionEdit() = default;
|
pushq %rbx
movq %rdi, %rbx
addq $0x90, %rdi
callq 0x161f2
leaq 0x60(%rbx), %rdi
movq 0x70(%rbx), %rsi
callq 0x162a8
leaq 0x48(%rbx), %rdi
callq 0x16212
movq (%rbx), %rdi
addq $0x10, %rbx
cmpq %rbx, %rdi
je 0x15e86
popq %rbx
jmp 0xa570
popq %rbx
retq
|
/walterzhaoJR[P]leveldb/./db/version_edit.h
|
leveldb::SnapshotList::New(unsigned long)
|
SnapshotImpl* New(SequenceNumber sequence_number) {
assert(empty() || newest()->sequence_number_ <= sequence_number);
SnapshotImpl* snapshot = new SnapshotImpl(sequence_number);
#if !defined(NDEBUG)
snapshot->list_ = this;
#endif // !defined(NDEBUG)
snapshot->next_ = &head_;
snapshot->prev_ = head_.prev_;
snapshot->prev_->next_ = snapshot;
snapshot->next_->prev_ = snapshot;
return snapshot;
}
|
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rdi), %r15
cmpq %rdi, 0x10(%rdi)
je 0x15ffd
cmpq %r14, 0x18(%r15)
ja 0x1602f
movl $0x28, %edi
callq 0xa5c0
leaq 0x69512(%rip), %rcx # 0x7f520
movq %rcx, (%rax)
movq %r14, 0x18(%rax)
movq %rbx, 0x20(%rax)
movq %rbx, 0x10(%rax)
movq %r15, 0x8(%rax)
movq %rax, 0x10(%r15)
movq %rax, 0x8(%rbx)
popq %rbx
popq %r14
popq %r15
retq
leaq 0x44439(%rip), %rdi # 0x5a46f
leaq 0x443d4(%rip), %rsi # 0x5a411
leaq 0x44464(%rip), %rcx # 0x5a4a8
movl $0x3a, %edx
callq 0xa3e0
|
/walterzhaoJR[P]leveldb/./db/snapshot.h
|
leveldb::NewDBIterator(leveldb::DBImpl*, leveldb::Comparator const*, leveldb::Iterator*, unsigned long, unsigned int)
|
Iterator* NewDBIterator(DBImpl* db, const Comparator* user_key_comparator,
Iterator* internal_iter, SequenceNumber sequence,
uint32_t seed) {
return new DBIter(db, user_key_comparator, internal_iter, sequence, seed);
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebp
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
movl $0xa8, %edi
callq 0xa5c0
movq %rax, %rbx
movq %rax, %rdi
callq 0x23558
leaq 0x67d5a(%rip), %rax # 0x7f540
movq %rax, (%rbx)
movq %r13, 0x28(%rbx)
movq %r12, 0x30(%rbx)
movq %r15, 0x38(%rbx)
movq %r14, 0x40(%rbx)
xorl %eax, %eax
movq %rax, 0x48(%rbx)
leaq 0x60(%rbx), %rcx
movq %rcx, 0x50(%rbx)
movq %rax, 0x58(%rbx)
movb %al, 0x60(%rbx)
leaq 0x80(%rbx), %rcx
movq %rcx, 0x70(%rbx)
movq %rax, 0x78(%rbx)
movb %al, 0x80(%rbx)
movl $0x0, 0x90(%rbx)
movb %al, 0x94(%rbx)
movl $0x7fffffff, %eax # imm = 0x7FFFFFFF
andl %eax, %ebp
cmpl %eax, %ebp
je 0x17842
testl %ebp, %ebp
jne 0x17847
movl $0x1, %ebp
movl %ebp, %eax
imulq $0x41a7, %rax, %rax # imm = 0x41A7
movq %rax, %rcx
shrq $0x1f, %rcx
movl %ecx, %edx
shll $0x1f, %edx
orl %ecx, %edx
leal (%rax,%rdx), %ecx
addl $0x80000001, %ecx # imm = 0x80000001
addl %eax, %edx
cmovnsl %edx, %ecx
movl %ecx, 0x98(%rbx)
andl $0x1fffff, %ecx # imm = 0x1FFFFF
movq %rcx, 0xa0(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
|
/walterzhaoJR[P]leveldb/db/db_iter.cc
|
leveldb::(anonymous namespace)::DBIter::SeekToFirst()
|
void DBIter::SeekToFirst() {
direction_ = kForward;
ClearSavedValue();
iter_->SeekToFirst();
if (iter_->Valid()) {
FindNextUserEntry(false, &saved_key_ /* temporary storage */);
} else {
valid_ = false;
}
}
|
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movl $0x0, 0x90(%rdi)
movq 0x70(%rdi), %rax
leaq 0x80(%rdi), %rcx
cmpq %rcx, %rax
je 0x1796e
cmpq $0x100001, 0x80(%rbx) # imm = 0x100001
jb 0x1796e
leaq 0x70(%rbx), %rsi
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
movq %rsp, %r14
movq %r14, %rdi
callq 0xa450
movq (%r14), %rdi
cmpq %r15, %rdi
je 0x17979
callq 0xa570
jmp 0x17979
movq $0x0, 0x78(%rbx)
movb $0x0, (%rax)
movq 0x38(%rbx), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq 0x38(%rbx), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
testb %al, %al
je 0x179a1
leaq 0x50(%rbx), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x17ee2
jmp 0x179a8
movb $0x0, 0x94(%rbx)
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
|
/walterzhaoJR[P]leveldb/db/db_iter.cc
|
leveldb::(anonymous namespace)::DBIter::Seek(leveldb::Slice const&)
|
void DBIter::Seek(const Slice& target) {
direction_ = kForward;
ClearSavedValue();
saved_key_.clear();
AppendInternalKey(&saved_key_,
ParsedInternalKey(target, sequence_, kValueTypeForSeek));
iter_->Seek(saved_key_);
if (iter_->Valid()) {
FindNextUserEntry(false, &saved_key_ /* temporary storage */);
} else {
valid_ = false;
}
}
|
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl $0x0, 0x90(%rdi)
movq 0x70(%rdi), %rax
leaq 0x80(%rdi), %rcx
cmpq %rcx, %rax
je 0x17aae
cmpq $0x100001, 0x80(%rbx) # imm = 0x100001
jb 0x17aae
leaq 0x70(%rbx), %rsi
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
movq %rsp, %r15
movq %r15, %rdi
callq 0xa450
movq (%r15), %rdi
cmpq %r12, %rdi
je 0x17ab9
callq 0xa570
jmp 0x17ab9
movq $0x0, 0x78(%rbx)
movb $0x0, (%rax)
leaq 0x50(%rbx), %r15
movq $0x0, 0x58(%rbx)
movq 0x50(%rbx), %rax
movb $0x0, (%rax)
movups (%r14), %xmm0
movq %rsp, %r14
movaps %xmm0, (%r14)
movq 0x40(%rbx), %rax
movq %rax, 0x10(%r14)
movl $0x1, 0x18(%r14)
movq %r15, %rdi
movq %r14, %rsi
callq 0x18440
movq 0x38(%rbx), %rdi
movq 0x50(%rbx), %rax
movq %rax, (%r14)
movq 0x58(%rbx), %rax
movq %rax, 0x8(%r14)
movq (%rdi), %rax
movq %rsp, %rsi
callq *0x28(%rax)
movq 0x38(%rbx), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
testb %al, %al
je 0x17b2b
movq %rbx, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x17ee2
jmp 0x17b32
movb $0x0, 0x94(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
|
/walterzhaoJR[P]leveldb/db/db_iter.cc
|
leveldb::(anonymous namespace)::DBIter::Prev()
|
void DBIter::Prev() {
assert(valid_);
if (direction_ == kForward) { // Switch directions?
// iter_ is pointing at the current entry. Scan backwards until
// the key changes so we can use the normal reverse scanning code.
assert(iter_->Valid()); // Otherwise valid_ would have been false
SaveKey(ExtractUserKey(iter_->key()), &saved_key_);
while (true) {
iter_->Prev();
if (!iter_->Valid()) {
valid_ = false;
saved_key_.clear();
ClearSavedValue();
return;
}
if (user_comparator_->Compare(ExtractUserKey(iter_->key()), saved_key_) <
0) {
break;
}
}
direction_ = kReverse;
}
FindPrevUserEntry();
}
|
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
cmpb $0x0, 0x94(%rdi)
je 0x17dbf
movq %rdi, %rbx
cmpl $0x0, 0x90(%rdi)
jne 0x17d11
movq 0x38(%rbx), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
testb %al, %al
je 0x17dde
movq 0x38(%rbx), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
cmpq $0x7, %rdx
jbe 0x17da0
movq %rdx, %r8
addq $-0x8, %r8
leaq 0x50(%rbx), %rdi
movq 0x58(%rbx), %rdx
xorl %esi, %esi
movq %rax, %rcx
callq 0xaa10
leaq 0x18(%rsp), %r14
leaq 0x8(%rsp), %r15
movq 0x38(%rbx), %rdi
movq (%rdi), %rax
callq *0x38(%rax)
movq 0x38(%rbx), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
testb %al, %al
je 0x17d25
movq 0x30(%rbx), %r12
movq 0x38(%rbx), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
cmpq $0x7, %rdx
jbe 0x17da0
addq $-0x8, %rdx
movq %rax, 0x18(%rsp)
movq %rdx, 0x20(%rsp)
movq 0x50(%rbx), %rax
movq %rax, 0x8(%rsp)
movq 0x58(%rbx), %rax
movq %rax, 0x10(%rsp)
movq (%r12), %rax
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq *0x10(%rax)
testl %eax, %eax
jns 0x17ca3
movl $0x1, 0x90(%rbx)
movq %rbx, %rdi
callq 0x1816c
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
xorl %eax, %eax
movb %al, 0x94(%rbx)
movq $0x0, 0x58(%rbx)
movq 0x50(%rbx), %rcx
movb %al, (%rcx)
movq 0x70(%rbx), %rax
leaq 0x80(%rbx), %rcx
cmpq %rcx, %rax
je 0x17d90
cmpq $0x100001, 0x80(%rbx) # imm = 0x100001
jb 0x17d90
addq $0x70, %rbx
leaq 0x28(%rsp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
leaq 0x18(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0xa450
movq (%r14), %rdi
cmpq %r15, %rdi
je 0x17d19
callq 0xa570
jmp 0x17d19
movq $0x0, 0x78(%rbx)
movb $0x0, (%rax)
jmp 0x17d19
leaq 0x425ac(%rip), %rdi # 0x5a353
leaq 0x425be(%rip), %rsi # 0x5a36c
leaq 0x42615(%rip), %rcx # 0x5a3ca
movl $0x60, %edx
callq 0xa3e0
leaq 0x4ac2c(%rip), %rdi # 0x629f2
leaq 0x427a4(%rip), %rsi # 0x5a571
leaq 0x42919(%rip), %rcx # 0x5a6ed
movl $0xd2, %edx
callq 0xa3e0
leaq 0x4277d(%rip), %rdi # 0x5a562
leaq 0x42785(%rip), %rsi # 0x5a571
leaq 0x428fa(%rip), %rcx # 0x5a6ed
movl $0xd7, %edx
callq 0xa3e0
nop
|
/walterzhaoJR[P]leveldb/db/db_iter.cc
|
leveldb::(anonymous namespace)::DBIter::value() const
|
Slice value() const override {
assert(valid_);
return (direction_ == kForward) ? iter_->value() : saved_value_;
}
|
pushq %rax
cmpb $0x0, 0x94(%rdi)
je 0x17e99
cmpl $0x0, 0x90(%rdi)
je 0x17e8d
movq 0x70(%rdi), %rax
movq 0x78(%rdi), %rdx
jmp 0x17e97
movq 0x38(%rdi), %rdi
movq (%rdi), %rax
callq *0x48(%rax)
popq %rcx
retq
leaq 0x4ab52(%rip), %rdi # 0x629f2
leaq 0x426ca(%rip), %rsi # 0x5a571
leaq 0x428bd(%rip), %rcx # 0x5a76b
movl $0x45, %edx
callq 0xa3e0
|
/walterzhaoJR[P]leveldb/db/db_iter.cc
|
leveldb::ParsedInternalKey::DebugString[abi:cxx11]() const
|
std::string ParsedInternalKey::DebugString() const {
std::ostringstream ss;
ss << '\'' << EscapeString(user_key.ToString()) << "' @ " << sequence << " : "
<< static_cast<int>(type);
return ss.str();
}
|
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d0, %rsp # imm = 0x1D0
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x58(%rsp), %r15
movq %r15, %rdi
callq 0xa880
leaq 0x28(%rsp), %rsi
movb $0x27, (%rsi)
movl $0x1, %edx
movq %r15, %rdi
callq 0xa6b0
movq %rax, %r12
movq (%r14), %rsi
leaq 0x18(%rsp), %r13
movq 0x8(%r14), %rdx
addq %rsi, %rdx
movq %r13, -0x10(%r13)
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x105c0
movups (%r15), %xmm0
leaq 0x48(%rsp), %rsi
movups %xmm0, (%rsi)
leaq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0x27645
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r12, %rdi
callq 0xa6b0
movq %rax, %r12
leaq 0x42256(%rip), %rsi # 0x5a7af
movl $0x4, %edx
movq %rax, %rdi
callq 0xa6b0
movq 0x10(%r14), %rsi
movq %r12, %rdi
callq 0xa400
movq %rax, %r12
leaq 0x42238(%rip), %rsi # 0x5a7b4
movl $0x3, %edx
movq %rax, %rdi
callq 0xa6b0
movl 0x18(%r14), %esi
movq %r12, %rdi
callq 0xab30
movq (%r15), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x185a7
callq 0xa570
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x185b6
callq 0xa570
leaq 0x60(%rsp), %rsi
movq %rbx, %rdi
callq 0xaa40
movq 0x689d6(%rip), %rsi # 0x80fa0
leaq 0x58(%rsp), %rdi
callq 0xa310
leaq 0xc8(%rsp), %rdi
callq 0xa1b0
movq %rbx, %rax
addq $0x1d0, %rsp # imm = 0x1D0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
|
/walterzhaoJR[P]leveldb/db/dbformat.cc
|
leveldb::InternalFilterPolicy::KeyMayMatch(leveldb::Slice const&, leveldb::Slice const&) const
|
bool InternalFilterPolicy::KeyMayMatch(const Slice& key, const Slice& f) const {
return user_policy_->KeyMayMatch(ExtractUserKey(key), f);
}
|
subq $0x18, %rsp
movq 0x8(%rsi), %rax
cmpq $0x7, %rax
jbe 0x18af8
movq 0x8(%rdi), %rdi
movq (%rsi), %rcx
addq $-0x8, %rax
leaq 0x8(%rsp), %rsi
movq %rcx, (%rsi)
movq %rax, 0x8(%rsi)
movq (%rdi), %rax
callq *0x20(%rax)
addq $0x18, %rsp
retq
leaq 0x41854(%rip), %rdi # 0x5a353
leaq 0x41866(%rip), %rsi # 0x5a36c
leaq 0x418bd(%rip), %rcx # 0x5a3ca
movl $0x60, %edx
callq 0xa3e0
nop
|
/walterzhaoJR[P]leveldb/db/dbformat.cc
|
leveldb::LockFileName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
|
std::string LockFileName(const std::string& dbname) { return dbname + "/LOCK"; }
|
pushq %rbx
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
movq %rax, %rsi
callq 0xfb0e
leaq 0x41d67(%rip), %rsi # 0x5ab4b
movq %rbx, %rdi
callq 0xac80
movq %rbx, %rax
popq %rbx
retq
|
/walterzhaoJR[P]leveldb/db/filename.cc
|
leveldb::log::Reader::SkipToInitialBlock()
|
bool Reader::SkipToInitialBlock() {
const size_t offset_in_block = initial_offset_ % kBlockSize;
uint64_t block_start_location = initial_offset_ - offset_in_block;
// Don't search a block if we'd be in the trailer
if (offset_in_block > kBlockSize - 6) {
block_start_location += kBlockSize;
}
end_of_buffer_offset_ = block_start_location;
// Skip to start of first block that can contain the initial record
if (block_start_location > 0) {
Status skip_status = file_->Skip(block_start_location);
if (!skip_status.ok()) {
ReportDrop(block_start_location, skip_status);
return false;
}
}
return true;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x48(%rdi), %rax
movl %eax, %ecx
andl $0x7fff, %ecx # imm = 0x7FFF
andq $-0x8000, %rax # imm = 0x8000
leaq 0x8000(%rax), %rbx
cmpl $0x7ffb, %ecx # imm = 0x7FFB
cmovbq %rax, %rbx
movq %rbx, 0x40(%rdi)
movb $0x1, %bpl
testq %rbx, %rbx
je 0x19399
movq %rdi, %r14
movq (%rdi), %rsi
movq (%rsi), %rax
movq %rsp, %r15
movq %r15, %rdi
movq %rbx, %rdx
callq *0x18(%rax)
movq (%r15), %rdi
testq %rdi, %rdi
je 0x19399
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x19392
movq 0x40(%r14), %rcx
movq 0x28(%r14), %rdx
addq %rbx, %rdx
subq %rdx, %rcx
cmpq 0x48(%r14), %rcx
jb 0x19392
movq (%rax), %rcx
movq %rsp, %r14
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0x10(%rcx)
movq (%r14), %rdi
testq %rdi, %rdi
je 0x19397
callq 0xa810
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
|
/walterzhaoJR[P]leveldb/db/log_reader.cc
|
leveldb::log::Reader::ReadPhysicalRecord(leveldb::Slice*)
|
unsigned int Reader::ReadPhysicalRecord(Slice* result) {
while (true) {
if (buffer_.size() < kHeaderSize) {
if (!eof_) {
// Last read was a full read, so this is a trailer to skip
buffer_.clear();
Status status = file_->Read(kBlockSize, &buffer_, backing_store_);
end_of_buffer_offset_ += buffer_.size();
if (!status.ok()) {
buffer_.clear();
ReportDrop(kBlockSize, status);
eof_ = true;
return kEof;
} else if (buffer_.size() < kBlockSize) {
eof_ = true;
}
continue;
} else {
// Note that if buffer_ is non-empty, we have a truncated header at the
// end of the file, which can be caused by the writer crashing in the
// middle of writing the header. Instead of considering this an error,
// just report EOF.
buffer_.clear();
return kEof;
}
}
// Parse the header
const char* header = buffer_.data();
const uint32_t a = static_cast<uint32_t>(header[4]) & 0xff;
const uint32_t b = static_cast<uint32_t>(header[5]) & 0xff;
const unsigned int type = header[6];
const uint32_t length = a | (b << 8);
if (kHeaderSize + length > buffer_.size()) {
size_t drop_size = buffer_.size();
buffer_.clear();
if (!eof_) {
ReportCorruption(drop_size, "bad record length");
return kBadRecord;
}
// If the end of the file has been reached without reading |length| bytes
// of payload, assume the writer died in the middle of writing the record.
// Don't report a corruption.
return kEof;
}
if (type == kZeroType && length == 0) {
// Skip zero length record without reporting any drops since
// such records are produced by the mmap based writing code in
// env_posix.cc that preallocates file regions.
buffer_.clear();
return kBadRecord;
}
// Check crc
if (checksum_) {
uint32_t expected_crc = crc32c::Unmask(DecodeFixed32(header));
uint32_t actual_crc = crc32c::Value(header + 6, 1 + length);
if (actual_crc != expected_crc) {
// Drop the rest of the buffer since "length" itself may have
// been corrupted and if we trust it, we could find some
// fragment of a real log record that just happens to look
// like a valid log record.
size_t drop_size = buffer_.size();
buffer_.clear();
ReportCorruption(drop_size, "checksum mismatch");
return kBadRecord;
}
}
buffer_.remove_prefix(kHeaderSize + length);
// Skip physical record that started before initial_offset_
if (end_of_buffer_offset_ - buffer_.size() - kHeaderSize - length <
initial_offset_) {
result->clear();
return kBadRecord;
}
*result = Slice(header + kHeaderSize, length);
return type;
}
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x20(%rdi), %r15
movq 0x28(%rdi), %rsi
cmpq $0x6, %rsi
ja 0x196b8
leaq 0x48778(%rip), %r13 # 0x61dc5
leaq 0x8(%rsp), %r12
movl $0x5, %ebp
movq %r13, 0x20(%rbx)
movq $0x0, 0x28(%rbx)
cmpb $0x0, 0x30(%rbx)
jne 0x19805
movq (%rbx), %rsi
movq 0x18(%rbx), %r8
movq (%rsi), %rax
movl $0x8000, %edx # imm = 0x8000
movq %r12, %rdi
movq %r15, %rcx
callq *0x10(%rax)
movq 0x28(%rbx), %rax
movq 0x40(%rbx), %rcx
addq %rax, %rcx
movq %rcx, 0x40(%rbx)
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
jne 0x19727
cmpq $0x7fff, %rax # imm = 0x7FFF
ja 0x196ae
movb $0x1, 0x30(%rbx)
movq 0x28(%rbx), %rsi
cmpq $0x7, %rsi
jb 0x19657
movq (%r15), %r15
movzwl 0x4(%r15), %r12d
leal 0x7(%r12), %r13d
cmpq %r13, %rsi
jae 0x19700
leaq 0x486f4(%rip), %rax # 0x61dc5
movq %rax, 0x20(%rbx)
movq $0x0, 0x28(%rbx)
movl $0x5, %ebp
cmpb $0x0, 0x30(%rbx)
jne 0x19805
leaq 0x416ae(%rip), %rdx # 0x5ada1
movq %rbx, %rdi
callq 0x19854
jmp 0x197ca
movsbl 0x6(%r15), %ebp
testb %bpl, %bpl
jne 0x19756
testl %r12d, %r12d
jne 0x19756
leaq 0x486af(%rip), %rax # 0x61dc5
movq %rax, 0x20(%rbx)
movq $0x0, 0x28(%rbx)
jmp 0x197ca
movq %r13, 0x20(%rbx)
movq $0x0, 0x28(%rbx)
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x1974d
addq $-0x8000, %rcx # imm = 0x8000
cmpq 0x48(%rbx), %rcx
jae 0x197de
movb $0x1, 0x30(%rbx)
jmp 0x19800
cmpb $0x1, 0x10(%rbx)
jne 0x19790
movq %r14, 0x10(%rsp)
movl $0x5d7d1528, %r14d # imm = 0x5D7D1528
addl (%r15), %r14d
leaq 0x6(%r15), %rsi
roll $0xf, %r14d
leal 0x1(%r12), %edx
xorl %edi, %edi
callq 0x26e44
movq 0x28(%rbx), %rsi
cmpl %r14d, %eax
jne 0x19816
movq 0x10(%rsp), %r14
subq %r13, %rsi
jb 0x19835
addq %r13, 0x20(%rbx)
movq %rsi, 0x28(%rbx)
movq 0x40(%rbx), %rcx
movl %r12d, %eax
addq %rax, %rsi
subq %rsi, %rcx
addq $-0x7, %rcx
cmpq 0x48(%rbx), %rcx
jae 0x197d1
leaq 0x48606(%rip), %rax # 0x61dc5
movq %rax, (%r14)
movq $0x0, 0x8(%r14)
movl $0x6, %ebp
jmp 0x19805
addq $0x7, %r15
movq %r15, (%r14)
movq %rax, 0x8(%r14)
jmp 0x19805
movq (%rax), %rcx
leaq 0x8(%rsp), %r14
movl $0x8000, %esi # imm = 0x8000
movq %rax, %rdi
movq %r14, %rdx
callq *0x10(%rcx)
movq (%r14), %rdi
movb $0x1, 0x30(%rbx)
testq %rdi, %rdi
je 0x19805
callq 0xa810
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x485a8(%rip), %rax # 0x61dc5
movq %rax, 0x20(%rbx)
movq $0x0, 0x28(%rbx)
leaq 0x45c62(%rip), %rdx # 0x5f492
jmp 0x196f3
leaq 0x413f7(%rip), %rdi # 0x5ac33
leaq 0x413fc(%rip), %rsi # 0x5ac3f
leaq 0x4145b(%rip), %rcx # 0x5aca5
movl $0x45, %edx
callq 0xa3e0
|
/walterzhaoJR[P]leveldb/db/log_reader.cc
|
leveldb::log::Writer::AddRecord(leveldb::Slice const&)
|
Status Writer::AddRecord(const Slice& slice) {
const char* ptr = slice.data();
size_t left = slice.size();
// Fragment the record if necessary and emit it. Note that if slice
// is empty, we still want to iterate once to emit a single
// zero-length record
Status s;
bool begin = true;
do {
const int leftover = kBlockSize - block_offset_;
assert(leftover >= 0);
if (leftover < kHeaderSize) {
// Switch to a new block
if (leftover > 0) {
// Fill the trailer (literal below relies on kHeaderSize being 7)
static_assert(kHeaderSize == 7, "");
dest_->Append(Slice("\x00\x00\x00\x00\x00\x00", leftover));
}
block_offset_ = 0;
}
// Invariant: we never leave < kHeaderSize bytes in a block.
assert(kBlockSize - block_offset_ - kHeaderSize >= 0);
const size_t avail = kBlockSize - block_offset_ - kHeaderSize;
const size_t fragment_length = (left < avail) ? left : avail;
RecordType type;
const bool end = (left == fragment_length);
if (begin && end) {
type = kFullType;
} else if (begin) {
type = kFirstType;
} else if (end) {
type = kLastType;
} else {
type = kMiddleType;
}
s = EmitPhysicalRecord(type, ptr, fragment_length);
ptr += fragment_length;
left -= fragment_length;
begin = false;
} while (s.ok() && left > 0);
return s;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, 0x8(%rsp)
movq (%rdx), %r15
movq 0x8(%rdx), %rbx
movb $0x1, %r12b
leaq 0x10(%rsp), %r13
movl 0x8(%r14), %eax
cmpl $0x8001, %eax # imm = 0x8001
jge 0x19a9d
cmpl $0x7ffa, %eax # imm = 0x7FFA
jl 0x19a0a
cmpl $0x8000, %eax # imm = 0x8000
je 0x19a00
movl $0x8000, %ecx # imm = 0x8000
subl %eax, %ecx
movq (%r14), %rsi
movl %ecx, %eax
leaq 0x41541(%rip), %rcx # 0x5af1a
movq %rcx, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movq (%rsi), %rax
leaq 0x20(%rsp), %rdi
movq %r13, %rdx
callq *0x10(%rax)
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x19a00
callq 0xa810
movl $0x0, 0x8(%r14)
xorl %eax, %eax
movl $0x7ff9, %ecx # imm = 0x7FF9
subl %eax, %ecx
js 0x19a72
movl %ecx, %ebp
xorl %edx, %edx
cmpq %rbp, %rbx
cmovbq %rbx, %rbp
seta %dl
movl $0x4, %eax
subl %edx, %eax
incl %edx
testb $0x1, %r12b
cmovel %eax, %edx
movq %r13, %rdi
movq %r14, %rsi
movq %r15, %rcx
movq %rbp, %r8
callq 0x19ac8
movq 0x10(%rsp), %rcx
testq %rcx, %rcx
jne 0x19a5b
addq %rbp, %r15
xorl %r12d, %r12d
subq %rbp, %rbx
jne 0x199a9
movq 0x8(%rsp), %rax
movq %rcx, (%rax)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rax
movq $0x0, (%rax)
leaq 0x413d1(%rip), %rdi # 0x5ae56
leaq 0x41335(%rip), %rsi # 0x5adc1
leaq 0x4138d(%rip), %rcx # 0x5ae20
movl $0x39, %edx
callq 0xa3e0
movq 0x8(%rsp), %rax
movq $0x0, (%rax)
leaq 0x41303(%rip), %rdi # 0x5adb3
leaq 0x4130a(%rip), %rsi # 0x5adc1
leaq 0x41362(%rip), %rcx # 0x5ae20
movl $0x2d, %edx
callq 0xa3e0
|
/walterzhaoJR[P]leveldb/db/log_writer.cc
|
leveldb::MemTable::MemTable(leveldb::InternalKeyComparator const&)
|
MemTable::MemTable(const InternalKeyComparator& comparator)
: comparator_(comparator), refs_(0), table_(comparator_, &arena_) {}
|
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x6596b(%rip), %r12 # 0x7f598
addq $0x10, %r12
movq %r12, (%rdi)
movq 0x8(%rsi), %rax
movq %rax, 0x8(%rdi)
movl $0x0, 0x10(%rdi)
leaq 0x18(%rdi), %r14
movq %r14, %rdi
callq 0x25c08
leaq 0x8(%rsp), %r15
movq %r12, (%r15)
movq 0x8(%rbx), %rax
addq $0x48, %rbx
movq %rax, 0x8(%r15)
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1a08e
movq %r15, %rdi
callq 0x26cfc
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
|
/walterzhaoJR[P]leveldb/db/memtable.cc
|
leveldb::SkipList<char const*, leveldb::MemTable::KeyComparator>::SkipList(leveldb::MemTable::KeyComparator, leveldb::Arena*)
|
SkipList<Key, Comparator>::SkipList(Comparator cmp, Arena* arena)
: compare_(cmp),
arena_(arena),
head_(NewNode(0 /* any key will do */, kMaxHeight)),
max_height_(1),
rnd_(0xdeadbeef) {
for (int i = 0; i < kMaxHeight; i++) {
head_->SetNext(i, nullptr);
}
}
|
pushq %rbx
movq %rdi, %rbx
leaq 0x654ff(%rip), %rax # 0x7f598
addq $0x10, %rax
movq %rax, (%rdi)
movq 0x8(%rsi), %rax
movq %rax, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movl $0x68, %esi
movq %rdx, %rdi
callq 0x25d14
movq $0x0, (%rax)
movq %rax, 0x18(%rbx)
movabsq $0x5eadbeef00000001, %rax # imm = 0x5EADBEEF00000001
movq %rax, 0x20(%rbx)
movl $0x1, %eax
movq 0x18(%rbx), %rcx
movq $0x0, (%rcx,%rax,8)
incq %rax
cmpq $0xd, %rax
jne 0x1a0d7
popq %rbx
retq
|
/walterzhaoJR[P]leveldb/./db/skiplist.h
|
leveldb::TableCache::Get(leveldb::ReadOptions const&, unsigned long, unsigned long, leveldb::Slice const&, void*, void (*)(void*, leveldb::Slice const&, leveldb::Slice const&))
|
Status TableCache::Get(const ReadOptions& options, uint64_t file_number,
uint64_t file_size, const Slice& k, void* arg,
void (*handle_result)(void*, const Slice&,
const Slice&)) {
Cache::Handle* handle = nullptr;
Status s = FindTable(file_number, file_size, &handle);
if (s.ok()) {
Table* t = reinterpret_cast<TableAndFile*>(cache_->Value(handle))->table;
s = t->InternalGet(options, k, arg, handle_result);
cache_->Release(handle);
}
return s;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r15
movq %r8, %rax
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %r8
movq $0x0, (%r8)
movq %rcx, %rdx
movq %rax, %rcx
callq 0x1c520
cmpq $0x0, (%rbx)
jne 0x1c86d
movq 0x30(%r14), %rdi
movq 0x8(%rsp), %r13
movq (%rdi), %rax
movq %r13, %rsi
callq *0x28(%rax)
movq 0x8(%rax), %rsi
leaq 0x10(%rsp), %rbp
movq %rbp, %rdi
movq %r12, %rdx
movq %r15, %rcx
movq 0x50(%rsp), %r8
movq 0x58(%rsp), %r9
callq 0x25424
movq (%rbp), %rax
movq %rax, (%rbx)
movq 0x30(%r14), %rdi
movq (%rdi), %rax
movq %r13, %rsi
callq *0x20(%rax)
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
|
/walterzhaoJR[P]leveldb/db/table_cache.cc
|
leveldb::VersionEdit::Clear()
|
void VersionEdit::Clear() {
comparator_.clear();
log_number_ = 0;
prev_log_number_ = 0;
last_sequence_ = 0;
next_file_number_ = 0;
has_comparator_ = false;
has_log_number_ = false;
has_prev_log_number_ = false;
has_next_file_number_ = false;
has_last_sequence_ = false;
deleted_files_.clear();
new_files_.clear();
}
|
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movq %r14, 0x8(%rdi)
movq (%rdi), %rax
movb $0x0, (%rax)
addq $0x60, %rdi
movq %r14, 0x3d(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x20(%rbx)
movq 0x70(%rbx), %rsi
callq 0x162a8
leaq 0x68(%rbx), %rax
movq %r14, 0x70(%rbx)
movq %rax, 0x78(%rbx)
movq %rax, 0x80(%rbx)
movq %r14, 0x88(%rbx)
movq 0x90(%rbx), %r14
movq 0x98(%rbx), %rsi
cmpq %r14, %rsi
je 0x1c918
movq %r14, %rdi
callq 0x1625c
movq %r14, 0x98(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
|
/walterzhaoJR[P]leveldb/db/version_edit.cc
|
leveldb::VersionEdit::EncodeTo(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*) const
|
void VersionEdit::EncodeTo(std::string* dst) const {
if (has_comparator_) {
PutVarint32(dst, kComparator);
PutLengthPrefixedSlice(dst, comparator_);
}
if (has_log_number_) {
PutVarint32(dst, kLogNumber);
PutVarint64(dst, log_number_);
}
if (has_prev_log_number_) {
PutVarint32(dst, kPrevLogNumber);
PutVarint64(dst, prev_log_number_);
}
if (has_next_file_number_) {
PutVarint32(dst, kNextFileNumber);
PutVarint64(dst, next_file_number_);
}
if (has_last_sequence_) {
PutVarint32(dst, kLastSequence);
PutVarint64(dst, last_sequence_);
}
for (size_t i = 0; i < compact_pointers_.size(); i++) {
PutVarint32(dst, kCompactPointer);
PutVarint32(dst, compact_pointers_[i].first); // level
PutLengthPrefixedSlice(dst, compact_pointers_[i].second.Encode());
}
for (const auto& deleted_file_kvp : deleted_files_) {
PutVarint32(dst, kDeletedFile);
PutVarint32(dst, deleted_file_kvp.first); // level
PutVarint64(dst, deleted_file_kvp.second); // file number
}
for (size_t i = 0; i < new_files_.size(); i++) {
const FileMetaData& f = new_files_[i].second;
PutVarint32(dst, kNewFile);
PutVarint32(dst, new_files_[i].first); // level
PutVarint64(dst, f.number);
PutVarint64(dst, f.file_size);
PutLengthPrefixedSlice(dst, f.smallest.Encode());
PutLengthPrefixedSlice(dst, f.largest.Encode());
}
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
cmpb $0x1, 0x40(%rdi)
jne 0x1c962
movq %rbx, %rdi
movl $0x1, %esi
callq 0x26997
movq (%r14), %rax
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq 0x8(%r14), %rax
movq %rax, 0x8(%rsi)
movq %rbx, %rdi
callq 0x26a4a
cmpb $0x1, 0x41(%r14)
jne 0x1c982
movq %rbx, %rdi
movl $0x2, %esi
callq 0x26997
movq 0x20(%r14), %rsi
movq %rbx, %rdi
callq 0x269f8
cmpb $0x1, 0x42(%r14)
jne 0x1c9a2
movq %rbx, %rdi
movl $0x9, %esi
callq 0x26997
movq 0x28(%r14), %rsi
movq %rbx, %rdi
callq 0x269f8
cmpb $0x1, 0x43(%r14)
jne 0x1c9c2
movq %rbx, %rdi
movl $0x3, %esi
callq 0x26997
movq 0x30(%r14), %rsi
movq %rbx, %rdi
callq 0x269f8
cmpb $0x1, 0x44(%r14)
jne 0x1c9e2
movq %rbx, %rdi
movl $0x4, %esi
callq 0x26997
movq 0x38(%r14), %rsi
movq %rbx, %rdi
callq 0x269f8
movq 0x50(%r14), %rax
cmpq 0x48(%r14), %rax
je 0x1ca65
xorl %r12d, %r12d
leaq 0x8(%rsp), %r15
movabsq $-0x3333333333333333, %r13 # imm = 0xCCCCCCCCCCCCCCCD
xorl %ebp, %ebp
movq %rbx, %rdi
movl $0x5, %esi
callq 0x26997
movq 0x48(%r14), %rax
movl (%rax,%r12), %esi
movq %rbx, %rdi
callq 0x26997
movq 0x48(%r14), %rcx
movq 0x10(%rcx,%r12), %rax
testq %rax, %rax
je 0x1cb8e
movq 0x8(%rcx,%r12), %rcx
movq %rcx, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x26a4a
incq %rbp
movq 0x50(%r14), %rax
subq 0x48(%r14), %rax
sarq $0x3, %rax
imulq %r13, %rax
addq $0x28, %r12
cmpq %rax, %rbp
jb 0x1ca00
movq 0x78(%r14), %r15
leaq 0x68(%r14), %r12
cmpq %r12, %r15
je 0x1caa7
movq %rbx, %rdi
movl $0x6, %esi
callq 0x26997
movl 0x20(%r15), %esi
movq %rbx, %rdi
callq 0x26997
movq 0x28(%r15), %rsi
movq %rbx, %rdi
callq 0x269f8
movq %r15, %rdi
callq 0xa6d0
movq %rax, %r15
cmpq %r12, %rax
jne 0x1ca72
movq 0x90(%r14), %rbp
cmpq %rbp, 0x98(%r14)
je 0x1cb7f
xorl %r12d, %r12d
leaq 0x8(%rsp), %r15
xorl %r13d, %r13d
movq %rbx, %rdi
movl $0x7, %esi
callq 0x26997
movq 0x90(%r14), %rax
movl (%rax,%r12), %esi
movq %rbx, %rdi
callq 0x26997
movq 0x10(%rbp,%r12), %rsi
movq %rbx, %rdi
callq 0x269f8
movq 0x18(%rbp,%r12), %rsi
movq %rbx, %rdi
callq 0x269f8
movq 0x28(%rbp,%r12), %rax
testq %rax, %rax
je 0x1cb8e
movq 0x20(%rbp,%r12), %rcx
movq %rcx, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x26a4a
movq 0x48(%rbp,%r12), %rax
testq %rax, %rax
je 0x1cb8e
movq 0x40(%rbp,%r12), %rcx
movq %rcx, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x26a4a
incq %r13
movq 0x90(%r14), %rbp
movq 0x98(%r14), %rax
subq %rbp, %rax
sarq $0x5, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
addq $0x60, %r12
cmpq %rax, %r13
jb 0x1cac6
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3ed7d(%rip), %rdi # 0x5b912
leaq 0x3d7d0(%rip), %rsi # 0x5a36c
leaq 0x3ed7d(%rip), %rcx # 0x5b920
movl $0x96, %edx
callq 0xa3e0
nop
|
/walterzhaoJR[P]leveldb/db/version_edit.cc
|
leveldb::VersionEdit::DecodeFrom(leveldb::Slice const&)
|
Status VersionEdit::DecodeFrom(const Slice& src) {
Clear();
Slice input = src;
const char* msg = nullptr;
uint32_t tag;
// Temporary storage for parsing
int level;
uint64_t number;
FileMetaData f;
Slice str;
InternalKey key;
while (msg == nullptr && GetVarint32(&input, &tag)) {
switch (tag) {
case kComparator:
if (GetLengthPrefixedSlice(&input, &str)) {
comparator_ = str.ToString();
has_comparator_ = true;
} else {
msg = "comparator name";
}
break;
case kLogNumber:
if (GetVarint64(&input, &log_number_)) {
has_log_number_ = true;
} else {
msg = "log number";
}
break;
case kPrevLogNumber:
if (GetVarint64(&input, &prev_log_number_)) {
has_prev_log_number_ = true;
} else {
msg = "previous log number";
}
break;
case kNextFileNumber:
if (GetVarint64(&input, &next_file_number_)) {
has_next_file_number_ = true;
} else {
msg = "next file number";
}
break;
case kLastSequence:
if (GetVarint64(&input, &last_sequence_)) {
has_last_sequence_ = true;
} else {
msg = "last sequence number";
}
break;
case kCompactPointer:
if (GetLevel(&input, &level) && GetInternalKey(&input, &key)) {
compact_pointers_.push_back(std::make_pair(level, key));
} else {
msg = "compaction pointer";
}
break;
case kDeletedFile:
if (GetLevel(&input, &level) && GetVarint64(&input, &number)) {
deleted_files_.insert(std::make_pair(level, number));
} else {
msg = "deleted file";
}
break;
case kNewFile:
if (GetLevel(&input, &level) && GetVarint64(&input, &f.number) &&
GetVarint64(&input, &f.file_size) &&
GetInternalKey(&input, &f.smallest) &&
GetInternalKey(&input, &f.largest)) {
new_files_.push_back(std::make_pair(level, f));
} else {
msg = "new-file entry";
}
break;
default:
msg = "unknown tag";
break;
}
}
if (msg == nullptr && !input.empty()) {
msg = "invalid tag";
}
Status result;
if (msg != nullptr) {
result = Status::Corruption("VersionEdit", msg);
}
return result;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp # imm = 0x168
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x8(%rsp)
movq %rsi, %rdi
callq 0x1c8ac
movups (%r15), %xmm0
leaq 0x100(%rsp), %rdi
movaps %xmm0, (%rdi)
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
leaq 0x60(%rsp), %rcx
movq %rax, -0x28(%rcx)
xorl %eax, %eax
movq %rax, -0x18(%rcx)
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x80(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x451a8(%rip), %rcx # 0x61dc5
movq %rcx, 0x90(%rsp)
movq %rax, 0x98(%rsp)
leaq 0x20(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x34(%rsp), %rsi
callq 0x26afc
testb %al, %al
je 0x1d03d
leaq 0x90(%r14), %rax
movq %rax, 0x110(%rsp)
leaq 0x60(%r14), %rax
movq %rax, 0x120(%rsp)
leaq 0x48(%r14), %rax
movq %rax, 0x118(%rsp)
leaq 0x38(%r14), %rax
movq %rax, 0x140(%rsp)
leaq 0x30(%r14), %rax
movq %rax, 0x138(%rsp)
leaq 0x28(%r14), %rax
movq %rax, 0x130(%rsp)
leaq 0x20(%r14), %rax
movq %rax, 0x128(%rsp)
leaq 0x3ebad(%rip), %r15 # 0x5b859
leaq 0x3eb09(%rip), %rbx # 0x5b7bc
leaq 0x100(%rsp), %r12
leaq 0xa0(%rsp), %rbp
leaq 0x34(%rsp), %r13
movl 0x34(%rsp), %eax
decl %eax
cmpl $0x8, %eax
ja 0x1d0b5
movslq (%rbx,%rax,4), %rax
addq %rbx, %rax
jmpq *%rax
movq %r12, %rdi
leaq 0x90(%rsp), %rsi
callq 0x26c70
testb %al, %al
je 0x1d093
movq %rbx, %r12
movq 0x90(%rsp), %rsi
leaq 0xb0(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq 0x98(%rsp), %rdx
addq %rsi, %rdx
movq %rbp, %rdi
callq 0x105c0
movq %r14, %r15
movq %r14, %rdi
movq %rbp, %rbx
movq %rbp, %rsi
callq 0xa780
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x1cd51
callq 0xa570
movb $0x1, 0x40(%r15)
movq %rbx, %rbp
movq %r12, %rbx
leaq 0x100(%rsp), %r12
movq %r15, %r14
jmp 0x1d004
movq %r12, %rdi
movq %rbp, %rsi
callq 0x26afc
testb %al, %al
je 0x1d078
movl 0xa0(%rsp), %r15d
cmpl $0x6, %r15d
ja 0x1d078
movq %r12, %rdi
leaq 0x148(%rsp), %rsi
callq 0x26bb0
testb %al, %al
je 0x1d078
movq 0x148(%rsp), %rax
movl %r15d, 0xa0(%rsp)
movq %rax, 0xa8(%rsp)
movq 0x120(%rsp), %rdi
movq %rbp, %rsi
callq 0x166d8
jmp 0x1d004
movq %r12, %rdi
movq 0x138(%rsp), %rsi
callq 0x26bb0
testb %al, %al
je 0x1d0a5
movb $0x1, 0x43(%r14)
jmp 0x1d02a
movq %r12, %rdi
movq 0x128(%rsp), %rsi
callq 0x26bb0
testb %al, %al
je 0x1d08a
movb $0x1, 0x41(%r14)
jmp 0x1d02a
movq %r12, %rdi
movq 0x140(%rsp), %rsi
callq 0x26bb0
testb %al, %al
je 0x1d09c
movb $0x1, 0x44(%r14)
jmp 0x1d02a
movq %r12, %rdi
movq %rbp, %rsi
callq 0x26afc
testb %al, %al
je 0x1d06f
movl 0xa0(%rsp), %r15d
cmpl $0x6, %r15d
ja 0x1d06f
movq %r12, %rdi
leaq 0x40(%rsp), %rsi
callq 0x26bb0
testb %al, %al
je 0x1d06f
movq %r12, %rdi
leaq 0x48(%rsp), %rsi
callq 0x26bb0
testb %al, %al
je 0x1d06f
movq %r12, %rdi
leaq 0x50(%rsp), %rsi
callq 0x1d162
testb %al, %al
je 0x1d06f
movq %r12, %rdi
leaq 0x70(%rsp), %rsi
callq 0x1d162
testb %al, %al
je 0x1d06f
movl %r15d, 0xa0(%rsp)
movq 0x48(%rsp), %rax
leaq 0xa8(%rsp), %rcx
movq %rax, 0x10(%rcx)
movups 0x38(%rsp), %xmm0
movups %xmm0, (%rcx)
leaq 0xd0(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
addq %rsi, %rdx
leaq 0xc0(%rsp), %rdi
callq 0xfb0e
leaq 0xf0(%rsp), %r15
movq %r15, 0xe0(%rsp)
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdx
addq %rsi, %rdx
leaq 0xe0(%rsp), %rdi
callq 0xfb0e
movq 0x110(%rsp), %rdi
movq %rbp, %rsi
callq 0x16444
movq 0xe0(%rsp), %rdi
cmpq %r15, %rdi
je 0x1cf4c
callq 0xa570
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
leaq 0x3e8f3(%rip), %r15 # 0x5b859
je 0x1d02a
callq 0xa570
jmp 0x1d02a
movq %r12, %rdi
movq %rbp, %rsi
callq 0x26afc
testb %al, %al
je 0x1d081
movl 0xa0(%rsp), %r15d
cmpl $0x6, %r15d
ja 0x1d081
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
callq 0x1d162
testb %al, %al
je 0x1d081
movl %r15d, 0xa0(%rsp)
leaq 0xb8(%rsp), %r15
movq %r15, 0xa8(%rsp)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
leaq 0xa8(%rsp), %rdi
callq 0xfb0e
movq 0x118(%rsp), %rdi
movq %rbp, %rsi
callq 0x1d4e2
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
je 0x1d004
callq 0xa570
leaq 0x3e84e(%rip), %r15 # 0x5b859
jmp 0x1d02a
movq %r12, %rdi
movq 0x130(%rsp), %rsi
callq 0x26bb0
testb %al, %al
je 0x1d0ae
movb $0x1, 0x42(%r14)
movq %r12, %rdi
movq %r13, %rsi
callq 0x26afc
testb %al, %al
jne 0x1ccc8
cmpq $0x0, 0x108(%rsp)
je 0x1d051
leaq 0x3e816(%rip), %r15 # 0x5b865
jmp 0x1d0b5
movq 0x8(%rsp), %rbx
movq $0x0, (%rbx)
leaq 0x80(%rsp), %r13
leaq 0x20(%rsp), %rbp
jmp 0x1d11b
leaq 0x3e7d4(%rip), %r15 # 0x5b84a
jmp 0x1d0b5
leaq 0x3e7be(%rip), %r15 # 0x5b83d
jmp 0x1d0b5
leaq 0x3e7a2(%rip), %r15 # 0x5b82a
jmp 0x1d0b5
leaq 0x3e768(%rip), %r15 # 0x5b7f9
jmp 0x1d0b5
leaq 0x3e746(%rip), %r15 # 0x5b7e0
jmp 0x1d0b5
leaq 0x3e772(%rip), %r15 # 0x5b815
jmp 0x1d0b5
leaq 0x3e758(%rip), %r15 # 0x5b804
jmp 0x1d0b5
leaq 0x3e73b(%rip), %r15 # 0x5b7f0
movq 0x8(%rsp), %rbx
leaq 0x80(%rsp), %r13
leaq 0x20(%rsp), %rbp
leaq 0x3e7a3(%rip), %rax # 0x5b871
leaq 0xa0(%rsp), %r14
movq %rax, (%r14)
movq $0xb, 0x8(%r14)
leaq 0x158(%rsp), %r12
movq %r15, (%r12)
movq %r15, %rdi
callq 0xa240
movq %rax, 0x8(%r12)
leaq 0x150(%rsp), %r15
movq %r15, %rdi
movl $0x2, %esi
movq %r14, %rdx
movq %r12, %rcx
callq 0x277ac
movq (%r15), %rax
movq %rax, (%rbx)
movq 0x10(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1d12a
callq 0xa570
movq 0x70(%rsp), %rdi
cmpq %r13, %rdi
je 0x1d139
callq 0xa570
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x1d14d
callq 0xa570
movq %rbx, %rax
addq $0x168, %rsp # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/walterzhaoJR[P]leveldb/db/version_edit.cc
|
leveldb::SomeFileOverlapsRange(leveldb::InternalKeyComparator const&, bool, std::vector<leveldb::FileMetaData*, std::allocator<leveldb::FileMetaData*>> const&, leveldb::Slice const*, leveldb::Slice const*)
|
bool SomeFileOverlapsRange(const InternalKeyComparator& icmp,
bool disjoint_sorted_files,
const std::vector<FileMetaData*>& files,
const Slice* smallest_user_key,
const Slice* largest_user_key) {
const Comparator* ucmp = icmp.user_comparator();
if (!disjoint_sorted_files) {
// Need to check against all files
for (size_t i = 0; i < files.size(); i++) {
const FileMetaData* f = files[i];
if (AfterFile(ucmp, smallest_user_key, f) ||
BeforeFile(ucmp, largest_user_key, f)) {
// No overlap
} else {
return true; // Overlap
}
}
return false;
}
// Binary search over file list
uint32_t index = 0;
if (smallest_user_key != nullptr) {
// Find the earliest possible internal key for smallest_user_key
InternalKey small_key(*smallest_user_key, kMaxSequenceNumber,
kValueTypeForSeek);
index = FindFile(icmp, files, small_key.Encode());
}
if (index >= files.size()) {
// beginning of range is after all files, so no overlap.
return false;
}
return !BeforeFile(ucmp, largest_user_key, files[index]);
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r8, %rbx
movq %rcx, %r12
movq %rdx, %r15
movq 0x8(%rdi), %r14
testl %esi, %esi
je 0x1da03
testq %r12, %r12
je 0x1da6b
movq %rdi, %r13
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movups (%r12), %xmm0
movq %rsp, %rsi
movaps %xmm0, (%rsi)
movabsq $0xffffffffffffff, %rax # imm = 0xFFFFFFFFFFFFFF
movq %rax, 0x10(%rsi)
movl $0x1, 0x18(%rsi)
leaq 0x28(%rsp), %r12
movq %r12, %rdi
callq 0x18440
movq 0x8(%r12), %rax
testq %rax, %rax
je 0x1daa8
movq 0x28(%rsp), %rcx
movq %rsp, %rdx
movq %rcx, (%rdx)
movq %rax, 0x8(%rdx)
movq %r13, %rdi
movq %r15, %rsi
callq 0x1d8af
movl %eax, %ebp
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x1d9ff
callq 0xa570
movl %ebp, %eax
jmp 0x1da6d
movq (%r15), %rax
cmpq %rax, 0x8(%r15)
je 0x1da93
xorl %r13d, %r13d
movq (%rax,%r13,8), %rbp
testq %r12, %r12
je 0x1da41
leaq 0x38(%rbp), %rdi
callq 0x21bf8
movq %rax, (%rsp)
movq %rdx, 0x8(%rsp)
movq (%r14), %rax
movq %r14, %rdi
movq %r12, %rsi
movq %rsp, %rdx
callq *0x10(%rax)
testl %eax, %eax
jg 0x1da53
movq %r14, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x1dac7
testb %al, %al
je 0x1daa4
incq %r13
movq (%r15), %rax
movq 0x8(%r15), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r13
jb 0x1da13
jmp 0x1da93
xorl %eax, %eax
movq (%r15), %rcx
movq 0x8(%r15), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %rdx, %rax
jae 0x1da93
movq (%rcx,%rax,8), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1dac7
xorb $0x1, %al
jmp 0x1da95
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %al
jmp 0x1da95
leaq 0x3de63(%rip), %rdi # 0x5b912
leaq 0x3c8b6(%rip), %rsi # 0x5a36c
leaq 0x3de63(%rip), %rcx # 0x5b920
movl $0x96, %edx
callq 0xa3e0
|
/walterzhaoJR[P]leveldb/db/version_set.cc
|
leveldb::Version::NewConcatenatingIterator(leveldb::ReadOptions const&, int) const
|
Iterator* Version::NewConcatenatingIterator(const ReadOptions& options,
int level) const {
return NewTwoLevelIterator(
new LevelFileNumIterator(vset_->icmp_, &files_[level]), &GetFileIterator,
vset_->table_cache_, options);
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
movl $0x58, %edi
callq 0xa5c0
movq %rax, %r15
movq (%r14), %r12
movslq %ebp, %rax
leaq (%rax,%rax,2), %rax
leaq (%r14,%rax,8), %r13
addq $0x20, %r13
movq %r15, %rdi
callq 0x23558
leaq 0x61b89(%rip), %rax # 0x7f6d8
movq %rax, (%r15)
leaq 0x61a3f(%rip), %rax # 0x7f598
addq $0x10, %rax
movq %rax, 0x28(%r15)
movq 0x40(%r12), %rax
movq %rax, 0x30(%r15)
movq %r13, 0x38(%r15)
movq 0x8(%r13), %rax
subq (%r13), %rax
shrq $0x3, %rax
movl %eax, 0x40(%r15)
movq (%r14), %rax
movq 0x30(%rax), %rdx
leaq 0x19(%rip), %rsi # 0x1dba5
movq %r15, %rdi
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x256e8
|
/walterzhaoJR[P]leveldb/db/version_set.cc
|
leveldb::GetFileIterator(void*, leveldb::ReadOptions const&, leveldb::Slice const&)
|
static Iterator* GetFileIterator(void* arg, const ReadOptions& options,
const Slice& file_value) {
TableCache* cache = reinterpret_cast<TableCache*>(arg);
if (file_value.size() != 16) {
return NewErrorIterator(
Status::Corruption("FileReader invoked with unexpected value"));
} else {
return cache->NewIterator(options, DecodeFixed64(file_value.data()),
DecodeFixed64(file_value.data() + 8));
}
}
|
cmpq $0x10, 0x8(%rdx)
jne 0x1dbbe
movq (%rdx), %rax
movq (%rax), %rdx
movq 0x8(%rax), %rcx
xorl %r8d, %r8d
jmp 0x1c730
pushq %r14
pushq %rbx
subq $0x28, %rsp
leaq 0x3e4d4(%rip), %rax # 0x5c0a0
leaq 0x18(%rsp), %rdx
movq %rax, (%rdx)
movq $0x28, 0x8(%rdx)
leaq 0x441e2(%rip), %rax # 0x61dc5
leaq 0x8(%rsp), %rcx
movq %rax, (%rcx)
movq $0x0, 0x8(%rcx)
movq %rsp, %r14
movq %r14, %rdi
movl $0x2, %esi
callq 0x277ac
movq %r14, %rdi
callq 0x23663
movq %rax, %rbx
movq (%r14), %rdi
testq %rdi, %rdi
je 0x1dc1b
callq 0xa810
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
|
/walterzhaoJR[P]leveldb/db/version_set.cc
|
leveldb::Version::UpdateStats(leveldb::Version::GetStats const&)
|
bool Version::UpdateStats(const GetStats& stats) {
FileMetaData* f = stats.seek_file;
if (f != nullptr) {
f->allowed_seeks--;
if (f->allowed_seeks <= 0 && file_to_compact_ == nullptr) {
file_to_compact_ = f;
file_to_compact_level_ = stats.seek_file_level;
return true;
}
}
return false;
}
|
movq (%rsi), %rax
testq %rax, %rax
je 0x1e2e4
movl 0x4(%rax), %ecx
leal -0x1(%rcx), %edx
movl %edx, 0x4(%rax)
cmpl $0x1, %ecx
jg 0x1e2e4
cmpq $0x0, 0xc8(%rdi)
je 0x1e2e7
xorl %eax, %eax
retq
movq %rax, 0xc8(%rdi)
movl 0x8(%rsi), %eax
movl %eax, 0xd0(%rdi)
movb $0x1, %al
retq
|
/walterzhaoJR[P]leveldb/db/version_set.cc
|
leveldb::Version::DebugString[abi:cxx11]() const
|
std::string Version::DebugString() const {
std::string r;
for (int level = 0; level < config::kNumLevels; level++) {
// E.g.,
// --- level 1 ---
// 17:123['a' .. 'd']
// 20:43['e' .. 'g']
r.append("--- level ");
AppendNumberTo(&r, level);
r.append(" ---\n");
const std::vector<FileMetaData*>& files = files_[level];
for (size_t i = 0; i < files.size(); i++) {
r.push_back(' ');
AppendNumberTo(&r, files[i]->number);
r.push_back(':');
AppendNumberTo(&r, files[i]->file_size);
r.append("[");
r.append(files[i]->smallest.DebugString());
r.append(" .. ");
r.append(files[i]->largest.DebugString());
r.append("]\n");
}
}
return r;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
addq $0x20, %rsi
movq %rsi, 0x8(%rsp)
leaq 0x28(%rsp), %r15
xorl %r13d, %r13d
leaq 0x18(%rsp), %r12
leaq 0x3d2ba(%rip), %r14 # 0x5baf9
movq %rbx, %rdi
leaq 0x3d29f(%rip), %rsi # 0x5bae8
callq 0xac80
movq %rbx, %rdi
movq %r13, %rsi
callq 0x27544
movq %rbx, %rdi
leaq 0x3d290(%rip), %rsi # 0x5baf3
callq 0xac80
movq %r13, 0x10(%rsp)
leaq (,%r13,2), %rax
addq %r13, %rax
movq 0x8(%rsp), %rdx
movq 0x8(%rdx,%rax,8), %rcx
cmpq (%rdx,%rax,8), %rcx
je 0x1e985
movq 0x8(%rsp), %rcx
leaq (%rcx,%rax,8), %rbp
xorl %r13d, %r13d
movq %rbx, %rdi
movl $0x20, %esi
callq 0xa510
movq (%rbp), %rax
movq (%rax,%r13,8), %rax
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x27544
movq %rbx, %rdi
movl $0x3a, %esi
callq 0xa510
movq (%rbp), %rax
movq (%rax,%r13,8), %rax
movq 0x10(%rax), %rsi
movq %rbx, %rdi
callq 0x27544
movq %rbx, %rdi
leaq 0x44d64(%rip), %rsi # 0x63648
callq 0xac80
movq (%rbp), %rax
movq (%rax,%r13,8), %rsi
addq $0x18, %rsi
movq %r12, %rdi
callq 0x185f6
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq %rbx, %rdi
callq 0xa190
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x1e91e
callq 0xa570
movq %rbx, %rdi
leaq 0x3cfe1(%rip), %rsi # 0x5b909
callq 0xac80
movq (%rbp), %rax
movq (%rax,%r13,8), %rsi
addq $0x38, %rsi
movq %r12, %rdi
callq 0x185f6
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq %rbx, %rdi
callq 0xa190
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x1e962
callq 0xa570
movq %rbx, %rdi
movq %r14, %rsi
callq 0xac80
incq %r13
movq 0x8(%rbp), %rax
subq (%rbp), %rax
sarq $0x3, %rax
cmpq %rax, %r13
jb 0x1e898
movq 0x10(%rsp), %r13
incq %r13
cmpq $0x7, %r13
jne 0x1e83f
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
|
/walterzhaoJR[P]leveldb/db/version_set.cc
|
leveldb::VersionSet::Finalize(leveldb::Version*)
|
void VersionSet::Finalize(Version* v) {
// Precomputed best level for next compaction
int best_level = -1;
double best_score = -1;
for (int level = 0; level < config::kNumLevels - 1; level++) {
double score;
if (level == 0) {
// We treat level-0 specially by bounding the number of files
// instead of number of bytes for two reasons:
//
// (1) With larger write-buffer sizes, it is nice not to do too
// many level-0 compactions.
//
// (2) The files in level-0 are merged on every read and
// therefore we wish to avoid too many files when the individual
// file size is small (perhaps because of a small write-buffer
// setting, or very high compression ratios, or lots of
// overwrites/deletions).
score = v->files_[level].size() /
static_cast<double>(config::kL0_CompactionTrigger);
} else {
// Compute the ratio of current size to size limit.
const uint64_t level_bytes = TotalFileSize(v->files_[level]);
score =
static_cast<double>(level_bytes) / MaxBytesForLevel(options_, level);
}
if (score > best_score) {
best_level = level;
best_score = score;
}
}
v->compaction_level_ = best_level;
v->compaction_score_ = best_score;
}
|
pushq %rbx
leaq 0x20(%rsi), %rax
movsd 0x3c88d(%rip), %xmm5 # 0x5b960
movl $0xffffffff, %ecx # imm = 0xFFFFFFFF
movl $0x1, %edx
xorl %edi, %edi
movq 0x39f29(%rip), %xmm0 # 0x59010
movapd 0x39f31(%rip), %xmm1 # 0x59020
movsd 0x3c881(%rip), %xmm2 # 0x5b978
movsd 0x3c869(%rip), %xmm3 # 0x5b968
movsd 0x3c869(%rip), %xmm4 # 0x5b970
testq %rdi, %rdi
je 0x1f15b
leaq (%rdi,%rdi,2), %r9
movq (%rax,%r9,8), %r8
movq 0x8(%rax,%r9,8), %r9
subq %r8, %r9
je 0x1f186
sarq $0x3, %r9
cmpq $0x1, %r9
adcq $0x0, %r9
xorl %r11d, %r11d
xorl %r10d, %r10d
movq (%r8,%r11,8), %rbx
addq 0x10(%rbx), %r10
incq %r11
cmpq %r11, %r9
jne 0x1f130
movq %r10, %xmm7
punpckldq %xmm0, %xmm7 # xmm7 = xmm7[0],xmm0[0],xmm7[1],xmm0[1]
subpd %xmm1, %xmm7
movapd %xmm7, %xmm6
unpckhpd %xmm7, %xmm6 # xmm6 = xmm6[1],xmm7[1]
addsd %xmm7, %xmm6
jmp 0x1f18a
movq 0x28(%rsi), %r8
subq 0x20(%rsi), %r8
sarq $0x3, %r8
movq %r8, %xmm7
punpckldq %xmm0, %xmm7 # xmm7 = xmm7[0],xmm0[0],xmm7[1],xmm0[1]
subpd %xmm1, %xmm7
movapd %xmm7, %xmm6
unpckhpd %xmm7, %xmm6 # xmm6 = xmm6[1],xmm7[1]
addsd %xmm7, %xmm6
mulsd %xmm2, %xmm6
jmp 0x1f1ac
xorpd %xmm6, %xmm6
movapd %xmm3, %xmm7
cmpq $0x1, %rdi
je 0x1f1a8
movl %edx, %r8d
movapd %xmm3, %xmm7
mulsd %xmm4, %xmm7
decl %r8d
cmpl $0x2, %r8d
ja 0x1f19b
divsd %xmm7, %xmm6
ucomisd %xmm5, %xmm6
maxsd %xmm5, %xmm6
cmoval %edi, %ecx
incq %rdi
incl %edx
movapd %xmm6, %xmm5
cmpq $0x6, %rdi
jne 0x1f107
movl %ecx, 0xe0(%rsi)
movsd %xmm6, 0xd8(%rsi)
popq %rbx
retq
|
/walterzhaoJR[P]leveldb/db/version_set.cc
|
leveldb::VersionSet::ReuseManifest(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
|
bool VersionSet::ReuseManifest(const std::string& dscname,
const std::string& dscbase) {
if (!options_->reuse_logs) {
return false;
}
FileType manifest_type;
uint64_t manifest_number;
uint64_t manifest_size;
if (!ParseFileName(dscbase, &manifest_number, &manifest_type) ||
manifest_type != kDescriptorFile ||
!env_->GetFileSize(dscname, &manifest_size).ok() ||
// Make new compacted MANIFEST if old one is too big
manifest_size >= TargetFileSize(options_)) {
return false;
}
assert(descriptor_file_ == nullptr);
assert(descriptor_log_ == nullptr);
Status r = env_->NewAppendableFile(dscname, &descriptor_file_);
if (!r.ok()) {
Log(options_->info_log, "Reuse MANIFEST: %s\n", r.ToString().c_str());
assert(descriptor_file_ == nullptr);
return false;
}
Log(options_->info_log, "Reusing MANIFEST %s\n", dscname.c_str());
descriptor_log_ = new log::Writer(descriptor_file_, manifest_size);
manifest_file_number_ = manifest_number;
return true;
}
|
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq 0x28(%rdi), %rax
cmpb $0x1, 0x54(%rax)
jne 0x1fd49
movq %rsi, %r15
movq %rdi, %r14
leaq 0x18(%rsp), %rsi
leaq 0x4(%rsp), %rax
movq %rdx, %rdi
movq %rax, %rdx
callq 0x18e8c
xorl %ebx, %ebx
testb %al, %al
je 0x1fd4b
cmpl $0x3, 0x4(%rsp)
jne 0x1fd4b
movq (%r14), %rsi
movq (%rsi), %rax
leaq 0x20(%rsp), %rbx
leaq 0x10(%rsp), %rcx
movq %rbx, %rdi
movq %r15, %rdx
callq *0x68(%rax)
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x1fc96
callq 0xa810
jmp 0x1fd49
movq 0x10(%rsp), %rax
movq 0x28(%r14), %rcx
cmpq 0x48(%rcx), %rax
jae 0x1fd49
cmpq $0x0, 0x70(%r14)
jne 0x1fdab
cmpq $0x0, 0x78(%r14)
jne 0x1fdca
leaq 0x70(%r14), %r12
movq (%r14), %rsi
movq (%rsi), %rax
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rdx
movq %r12, %rcx
callq *0x28(%rax)
cmpq $0x0, (%rbx)
sete %bl
movq 0x28(%r14), %rax
movq 0x18(%rax), %r13
je 0x1fd5b
leaq 0x20(%rsp), %r14
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x27874
movq (%r14), %rdx
leaq 0x3c0a4(%rip), %rsi # 0x5bdab
movq %r13, %rdi
xorl %eax, %eax
callq 0x271f1
movq (%r14), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x1fd23
callq 0xa570
cmpq $0x0, (%r12)
je 0x1fd9a
leaq 0x3bef4(%rip), %rdi # 0x5bc25
leaq 0x3bc48(%rip), %rsi # 0x5b980
leaq 0x3bfff(%rip), %rcx # 0x5bd3e
movl $0x3f2, %edx # imm = 0x3F2
callq 0xa3e0
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq (%r15), %rdx
leaq 0x3c05a(%rip), %rsi # 0x5bdbf
movq %r13, %rdi
xorl %eax, %eax
callq 0x271f1
movl $0x20, %edi
callq 0xa5c0
movq %rax, %r15
movq 0x70(%r14), %rsi
movq 0x10(%rsp), %rdx
movq %rax, %rdi
callq 0x19936
movq %r15, 0x78(%r14)
movq 0x18(%rsp), %rax
movq %rax, 0x50(%r14)
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1fd4b
callq 0xa810
jmp 0x1fd4b
leaq 0x3be73(%rip), %rdi # 0x5bc25
leaq 0x3bbc7(%rip), %rsi # 0x5b980
leaq 0x3bf7e(%rip), %rcx # 0x5bd3e
movl $0x3ed, %edx # imm = 0x3ED
callq 0xa3e0
leaq 0x3bfbf(%rip), %rdi # 0x5bd90
leaq 0x3bba8(%rip), %rsi # 0x5b980
leaq 0x3bf5f(%rip), %rcx # 0x5bd3e
movl $0x3ee, %edx # imm = 0x3EE
callq 0xa3e0
nop
|
/walterzhaoJR[P]leveldb/db/version_set.cc
|
leveldb::VersionSet::NumLevelFiles(int) const
|
int VersionSet::NumLevelFiles(int level) const {
assert(level >= 0);
assert(level < config::kNumLevels);
return current_->files_[level].size();
}
|
pushq %rax
testl %esi, %esi
js 0x1fe11
cmpl $0x7, %esi
jae 0x1fe30
movq 0x168(%rdi), %rcx
movl %esi, %eax
leaq (%rax,%rax,2), %rdx
movq 0x28(%rcx,%rdx,8), %rax
subq 0x20(%rcx,%rdx,8), %rax
shrq $0x3, %rax
popq %rcx
retq
leaq 0x39ccd(%rip), %rdi # 0x59ae5
leaq 0x3bb61(%rip), %rsi # 0x5b980
leaq 0x3bfae(%rip), %rcx # 0x5bdd4
movl $0x447, %edx # imm = 0x447
callq 0xa3e0
leaq 0x3bc96(%rip), %rdi # 0x5bacd
leaq 0x3bb42(%rip), %rsi # 0x5b980
leaq 0x3bf8f(%rip), %rcx # 0x5bdd4
movl $0x448, %edx # imm = 0x448
callq 0xa3e0
nop
|
/walterzhaoJR[P]leveldb/db/version_set.cc
|
leveldb::VersionSet::CompactRange(int, leveldb::InternalKey const*, leveldb::InternalKey const*)
|
Compaction* VersionSet::CompactRange(int level, const InternalKey* begin,
const InternalKey* end) {
std::vector<FileMetaData*> inputs;
current_->GetOverlappingInputs(level, begin, end, &inputs);
if (inputs.empty()) {
return nullptr;
}
// Avoid compacting too much in one shot in case the range is large.
// But we cannot do this for level-0 since level-0 files can overlap
// and we must not pick one file and drop another older file if the
// two files overlap.
if (level > 0) {
const uint64_t limit = MaxFileSizeForLevel(options_, level);
uint64_t total = 0;
for (size_t i = 0; i < inputs.size(); i++) {
uint64_t s = inputs[i]->file_size;
total += s;
if (total >= limit) {
inputs.resize(i + 1);
break;
}
}
}
Compaction* c = new Compaction(options_, level);
c->input_version_ = current_;
c->input_version_->Ref();
c->inputs_[0] = inputs;
SetupOtherInputs(c);
return c;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movq %rsp, %r14
movaps %xmm0, (%r14)
movq $0x0, 0x10(%r14)
movq 0x168(%rdi), %rdi
movq %r14, %r8
callq 0x1e5ea
movq (%r14), %rdi
movq 0x8(%r14), %rsi
cmpq %rsi, %rdi
je 0x214c4
testl %ebp, %ebp
jle 0x214d4
movq 0x28(%rbx), %rax
movq 0x48(%rax), %rax
subq %rdi, %rsi
sarq $0x3, %rsi
xorl %ecx, %ecx
cmpq $0x1, %rsi
movl $0x0, %edx
sbbq %rsi, %rdx
movl $0x1, %esi
movq -0x8(%rdi,%rsi,8), %r8
addq 0x10(%r8), %rcx
cmpq %rax, %rcx
jae 0x214cc
leaq (%rdx,%rsi), %r8
incq %r8
incq %rsi
cmpq $0x1, %r8
jne 0x214a4
jmp 0x214d4
xorl %r14d, %r14d
jmp 0x215d3
movq %rsp, %rdi
callq 0x2242c
movl $0x158, %edi # imm = 0x158
callq 0xa5c0
movq %rax, %r14
movq 0x28(%rbx), %rax
movl %ebp, (%r14)
movq 0x48(%rax), %rax
movq %rax, 0x8(%r14)
xorl %r15d, %r15d
movq %r15, 0x10(%r14)
leaq 0x18(%r14), %rdi
leaq 0x28(%r14), %rax
movq %rax, 0x18(%r14)
movq %r15, 0x20(%r14)
movb %r15b, 0x28(%r14)
movq %r15, 0x70(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x60(%r14)
leaq 0x80(%r14), %rax
movl $0x0, 0x80(%r14)
movq %r15, 0x88(%r14)
movq %rax, 0x90(%r14)
movq %rax, 0x98(%r14)
movups %xmm0, 0xb0(%r14)
movups %xmm0, 0xa0(%r14)
callq 0x1c8ac
leaq 0xc0(%r14), %rdi
movb %r15b, 0x110(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x100(%r14)
movups %xmm0, 0xf0(%r14)
movups %xmm0, 0xe0(%r14)
movups %xmm0, 0xd0(%r14)
movups %xmm0, 0xc0(%r14)
movups %xmm0, 0x118(%r14)
movups %xmm0, 0x128(%r14)
movups %xmm0, 0x138(%r14)
movups %xmm0, 0x148(%r14)
movq 0x168(%rbx), %rax
movq %rax, 0x10(%r14)
incl 0x18(%rax)
movq %rsp, %r15
movq %r15, %rsi
callq 0x22350
movq %rbx, %rdi
movq %r14, %rsi
callq 0x20bb0
movq (%r15), %rdi
testq %rdi, %rdi
je 0x215dd
callq 0xa570
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
|
/walterzhaoJR[P]leveldb/db/version_set.cc
|
leveldb::Compaction::Compaction(leveldb::Options const*, int)
|
Compaction::Compaction(const Options* options, int level)
: level_(level),
max_output_file_size_(MaxFileSizeForLevel(options, level)),
input_version_(nullptr),
grandparent_index_(0),
seen_key_(false),
overlapped_bytes_(0) {
for (int i = 0; i < config::kNumLevels; i++) {
level_ptrs_[i] = 0;
}
}
|
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl %edx, (%rdi)
movq 0x48(%rsi), %rax
movq %rax, 0x8(%rdi)
xorl %r14d, %r14d
movq %r14, 0x10(%rdi)
addq $0x18, %rdi
leaq 0x28(%rbx), %rax
movq %rax, 0x18(%rbx)
movq %r14, 0x20(%rbx)
movb %r14b, 0x28(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x60(%rbx)
movq %r14, 0x70(%rbx)
leaq 0x80(%rbx), %rax
movl $0x0, 0x80(%rbx)
movq %r14, 0x88(%rbx)
movq %rax, 0x90(%rbx)
movq %rax, 0x98(%rbx)
movups %xmm0, 0xa0(%rbx)
movups %xmm0, 0xb0(%rbx)
callq 0x1c8ac
movb %r14b, 0x110(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x100(%rbx)
movups %xmm0, 0xf0(%rbx)
movups %xmm0, 0xe0(%rbx)
movups %xmm0, 0xd0(%rbx)
movups %xmm0, 0xc0(%rbx)
movups %xmm0, 0x118(%rbx)
movups %xmm0, 0x128(%rbx)
movups %xmm0, 0x138(%rbx)
movups %xmm0, 0x148(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
|
/walterzhaoJR[P]leveldb/db/version_set.cc
|
leveldb::Compaction::IsTrivialMove() const
|
bool Compaction::IsTrivialMove() const {
const VersionSet* vset = input_version_->vset_;
// Avoid a move if there is lots of overlapping grandparent data.
// Otherwise, the move could create a parent file that will require
// a very expensive merge later on.
return (num_input_files(0) == 1 && num_input_files(1) == 0 &&
TotalFileSize(grandparents_) <=
MaxGrandParentOverlapBytes(vset->options_));
}
|
movabsq $0x7fffffff8, %rax # imm = 0x7FFFFFFF8
movq 0xc8(%rdi), %rcx
subq 0xc0(%rdi), %rcx
andq %rax, %rcx
cmpq $0x8, %rcx
jne 0x2173a
movq 0xe0(%rdi), %rcx
subq 0xd8(%rdi), %rcx
testq %rax, %rcx
je 0x2173d
xorl %eax, %eax
retq
movq 0x10(%rdi), %rax
movq (%rax), %rax
movq 0xf0(%rdi), %rcx
movq 0xf8(%rdi), %rdx
subq %rcx, %rdx
je 0x21779
sarq $0x3, %rdx
cmpq $0x1, %rdx
adcq $0x0, %rdx
xorl %edi, %edi
xorl %esi, %esi
movq (%rcx,%rdi,8), %r8
addq 0x10(%r8), %rsi
incq %rdi
cmpq %rdi, %rdx
jne 0x21767
jmp 0x2177b
xorl %esi, %esi
movq 0x28(%rax), %rax
movq 0x48(%rax), %rax
addq %rax, %rax
leaq (%rax,%rax,4), %rax
cmpq %rax, %rsi
setle %al
retq
nop
|
/walterzhaoJR[P]leveldb/db/version_set.cc
|
leveldb::Compaction::IsBaseLevelForKey(leveldb::Slice const&)
|
bool Compaction::IsBaseLevelForKey(const Slice& user_key) {
// Maybe use binary search to find right entry instead of linear search?
const Comparator* user_cmp = input_version_->vset_->icmp_.user_comparator();
for (int lvl = level_ + 2; lvl < config::kNumLevels; lvl++) {
const std::vector<FileMetaData*>& files = input_version_->files_[lvl];
while (level_ptrs_[lvl] < files.size()) {
FileMetaData* f = files[level_ptrs_[lvl]];
if (user_cmp->Compare(user_key, f->largest.user_key()) <= 0) {
// We've advanced far enough
if (user_cmp->Compare(user_key, f->smallest.user_key()) >= 0) {
// Key falls in this file's range, so definitely not base level
return false;
}
break;
}
level_ptrs_[lvl]++;
}
}
return true;
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movslq (%rdi), %rbp
movb $0x1, %al
movl %eax, 0x4(%rsp)
cmpq $0x4, %rbp
jg 0x21959
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rdi), %rax
movq (%rax), %rax
movq 0x40(%rax), %r15
addq $0x2, %rbp
movl $0x0, 0x4(%rsp)
movq 0x10(%r14), %rdx
leaq (,%rbp,2), %rsi
addq %rbp, %rsi
movq 0x120(%r14,%rbp,8), %rax
movq 0x20(%rdx,%rsi,8), %rcx
movq 0x28(%rdx,%rsi,8), %rdi
subq %rcx, %rdi
sarq $0x3, %rdi
cmpq %rdi, %rax
jae 0x2193e
leaq (%rdx,%rsi,8), %r12
addq $0x20, %r12
movq (%rcx,%rax,8), %r13
leaq 0x38(%r13), %rdi
callq 0x21bf8
movq %rax, 0x8(%rsp)
movq %rdx, 0x10(%rsp)
movq (%r15), %rax
movq %r15, %rdi
movq %rbx, %rsi
leaq 0x8(%rsp), %rdx
callq *0x10(%rax)
testl %eax, %eax
jle 0x21913
movq 0x120(%r14,%rbp,8), %rax
incq %rax
movq %rax, 0x120(%r14,%rbp,8)
movq (%r12), %rcx
movq 0x8(%r12), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %rdx, %rax
jb 0x218bd
jmp 0x2193e
addq $0x18, %r13
movq %r13, %rdi
callq 0x21bf8
movq %rax, 0x8(%rsp)
movq %rdx, 0x10(%rsp)
movq (%r15), %rax
movq %r15, %rdi
movq %rbx, %rsi
leaq 0x8(%rsp), %rdx
callq *0x10(%rax)
testl %eax, %eax
jns 0x21959
cmpq $0x6, %rbp
leaq 0x1(%rbp), %rax
setge %cl
movl %ecx, 0x4(%rsp)
movq %rax, %rbp
cmpl $0x7, %eax
jne 0x21884
movl 0x4(%rsp), %eax
andb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
|
/walterzhaoJR[P]leveldb/db/version_set.cc
|
leveldb::Compaction::ShouldStopBefore(leveldb::Slice const&)
|
bool Compaction::ShouldStopBefore(const Slice& internal_key) {
const VersionSet* vset = input_version_->vset_;
// Scan to find earliest grandparent file that contains key.
const InternalKeyComparator* icmp = &vset->icmp_;
while (grandparent_index_ < grandparents_.size() &&
icmp->Compare(internal_key,
grandparents_[grandparent_index_]->largest.Encode()) >
0) {
if (seen_key_) {
overlapped_bytes_ += grandparents_[grandparent_index_]->file_size;
}
grandparent_index_++;
}
seen_key_ = true;
if (overlapped_bytes_ > MaxGrandParentOverlapBytes(vset->options_)) {
// Too much overlap for current output; start new output
overlapped_bytes_ = 0;
return true;
} else {
return false;
}
}
|
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq 0x10(%rdi), %rcx
movq 0xf0(%rdi), %rax
movq (%rcx), %r13
movq 0x108(%rdi), %rcx
movq 0xf8(%rdi), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %rdx, %rcx
jae 0x21a24
movq %rsi, %r14
leaq 0x38(%r13), %r15
movq %rsp, %r12
movq (%rax,%rcx,8), %rcx
movq 0x40(%rcx), %rax
testq %rax, %rax
je 0x21a65
movq 0x38(%rcx), %rcx
movq %rcx, (%rsp)
movq %rax, 0x8(%rsp)
movq (%r15), %rax
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq *0x10(%rax)
testl %eax, %eax
jle 0x21a24
movq 0xf0(%rbx), %rax
movq 0x108(%rbx), %rcx
cmpb $0x1, 0x110(%rbx)
jne 0x21a07
movq (%rax,%rcx,8), %rdx
movq 0x10(%rdx), %rdx
addq %rdx, 0x118(%rbx)
incq %rcx
movq %rcx, 0x108(%rbx)
movq 0xf8(%rbx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %rdx, %rcx
jb 0x219b0
movb $0x1, 0x110(%rbx)
movq 0x118(%rbx), %rax
movq 0x28(%r13), %rcx
movq 0x48(%rcx), %rcx
addq %rcx, %rcx
leaq (%rcx,%rcx,4), %rcx
cmpq %rcx, %rax
jle 0x21a51
movq $0x0, 0x118(%rbx)
cmpq %rcx, %rax
setg %al
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x39ea6(%rip), %rdi # 0x5b912
leaq 0x388f9(%rip), %rsi # 0x5a36c
leaq 0x39ea6(%rip), %rcx # 0x5b920
movl $0x96, %edx
callq 0xa3e0
|
/walterzhaoJR[P]leveldb/db/version_set.cc
|
leveldb::SaveValue(void*, leveldb::Slice const&, leveldb::Slice const&)
|
static void SaveValue(void* arg, const Slice& ikey, const Slice& v) {
Saver* s = reinterpret_cast<Saver*>(arg);
ParsedInternalKey parsed_key;
if (!ParseInternalKey(ikey, &parsed_key)) {
s->state = kCorrupt;
} else {
if (s->ucmp->Compare(parsed_key.user_key, s->user_key) == 0) {
s->state = (parsed_key.type == kTypeValue) ? kFound : kDeleted;
if (s->state == kFound) {
s->value->assign(v.data(), v.size());
}
}
}
}
|
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
movq 0x8(%rsi), %rax
cmpq $0x8, %rax
jb 0x21b27
movq %rdx, %rbx
movq (%rsi), %rcx
movq -0x8(%rcx,%rax), %rdx
movzbl %dl, %esi
shrq $0x8, %rdx
movq %rdx, 0x18(%rsp)
movl %esi, 0x20(%rsp)
addq $-0x8, %rax
movq %rcx, 0x8(%rsp)
movq %rax, 0x10(%rsp)
cmpl $0x2, %esi
jae 0x21b27
movq 0x8(%r14), %rdi
leaq 0x10(%r14), %rdx
movq (%rdi), %rax
leaq 0x8(%rsp), %rsi
callq *0x10(%rax)
testl %eax, %eax
jne 0x21b2e
movl 0x20(%rsp), %eax
xorl %ecx, %ecx
cmpl $0x1, %eax
setne %cl
incl %ecx
movl %ecx, (%r14)
cmpl $0x1, %eax
jne 0x21b2e
movq 0x20(%r14), %rdi
movq (%rbx), %rcx
movq 0x8(%rbx), %r8
movq 0x8(%rdi), %rdx
xorl %esi, %esi
callq 0xaa10
jmp 0x21b2e
movl $0x3, (%r14)
addq $0x28, %rsp
popq %rbx
popq %r14
retq
|
/walterzhaoJR[P]leveldb/db/version_set.cc
|
leveldb::VersionSet::Recover(bool*)::LogReporter::~LogReporter()
|
Status VersionSet::Recover(bool* save_manifest) {
struct LogReporter : public log::Reader::Reporter {
Status* status;
void Corruption(size_t bytes, const Status& s) override {
if (this->status->ok()) *this->status = s;
}
};
// Read "CURRENT" file, which contains a pointer to the current manifest file
std::string current;
Status s = ReadFileToString(env_, CurrentFileName(dbname_), ¤t);
if (!s.ok()) {
return s;
}
if (current.empty() || current[current.size() - 1] != '\n') {
return Status::Corruption("CURRENT file does not end with newline");
}
current.resize(current.size() - 1);
std::string dscname = dbname_ + "/" + current;
SequentialFile* file;
s = env_->NewSequentialFile(dscname, &file);
if (!s.ok()) {
if (s.IsNotFound()) {
return Status::Corruption("CURRENT points to a non-existent file",
s.ToString());
}
return s;
}
bool have_log_number = false;
bool have_prev_log_number = false;
bool have_next_file = false;
bool have_last_sequence = false;
uint64_t next_file = 0;
uint64_t last_sequence = 0;
uint64_t log_number = 0;
uint64_t prev_log_number = 0;
Builder builder(this, current_);
{
LogReporter reporter;
reporter.status = &s;
log::Reader reader(file, &reporter, true /*checksum*/,
0 /*initial_offset*/);
Slice record;
std::string scratch;
while (reader.ReadRecord(&record, &scratch) && s.ok()) {
VersionEdit edit;
s = edit.DecodeFrom(record);
if (s.ok()) {
if (edit.has_comparator_ &&
edit.comparator_ != icmp_.user_comparator()->Name()) {
s = Status::InvalidArgument(
edit.comparator_ + " does not match existing comparator ",
icmp_.user_comparator()->Name());
}
}
if (s.ok()) {
builder.Apply(&edit);
}
if (edit.has_log_number_) {
log_number = edit.log_number_;
have_log_number = true;
}
if (edit.has_prev_log_number_) {
prev_log_number = edit.prev_log_number_;
have_prev_log_number = true;
}
if (edit.has_next_file_number_) {
next_file = edit.next_file_number_;
have_next_file = true;
}
if (edit.has_last_sequence_) {
last_sequence = edit.last_sequence_;
have_last_sequence = true;
}
}
}
delete file;
file = nullptr;
if (s.ok()) {
if (!have_next_file) {
s = Status::Corruption("no meta-nextfile entry in descriptor");
} else if (!have_log_number) {
s = Status::Corruption("no meta-lognumber entry in descriptor");
} else if (!have_last_sequence) {
s = Status::Corruption("no last-sequence-number entry in descriptor");
}
if (!have_prev_log_number) {
prev_log_number = 0;
}
MarkFileNumberUsed(prev_log_number);
MarkFileNumberUsed(log_number);
}
if (s.ok()) {
Version* v = new Version(this);
builder.SaveTo(v);
// Install recovered version
Finalize(v);
AppendVersion(v);
manifest_file_number_ = next_file;
next_file_number_ = next_file + 1;
last_sequence_ = last_sequence;
log_number_ = log_number;
prev_log_number_ = prev_log_number;
// See if we can reuse the existing MANIFEST file.
if (ReuseManifest(dscname, current)) {
// No need to save new manifest
} else {
*save_manifest = true;
}
}
return s;
}
|
pushq %rbx
movq %rdi, %rbx
callq 0x192a0
movq %rbx, %rdi
popq %rbx
jmp 0xa570
|
/walterzhaoJR[P]leveldb/db/version_set.cc
|
leveldb::VersionSet::Builder::Builder(leveldb::VersionSet*, leveldb::Version*)
|
Builder(VersionSet* vset, Version* base) : vset_(vset), base_(base) {
base_->Ref();
BySmallestKey cmp;
cmp.internal_comparator = &vset_->icmp_;
for (int level = 0; level < config::kNumLevels; level++) {
levels_[level].added_files = new FileSet(cmp);
}
}
|
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, (%rdi)
movq %rdx, 0x8(%rdi)
leaq 0x18(%rdi), %rax
xorl %ecx, %ecx
xorl %esi, %esi
leaq (%rax,%rsi), %rdi
movl $0x0, (%rax,%rsi)
movq %rcx, 0x8(%rax,%rsi)
movq %rdi, 0x10(%rax,%rsi)
movq %rdi, 0x18(%rax,%rsi)
movq %rcx, 0x20(%rax,%rsi)
addq $0x38, %rsi
cmpq $0x188, %rsi # imm = 0x188
jne 0x21c47
incl 0x18(%rdx)
addq $0x38, %rbx
movl $0x40, %r15d
xorl %r12d, %r12d
movl $0x30, %edi
callq 0xa5c0
movq %rbx, (%rax)
leaq 0x8(%rax), %rcx
movl $0x0, 0x8(%rax)
movq %r12, 0x10(%rax)
movq %rcx, 0x18(%rax)
movq %rcx, 0x20(%rax)
movq %r12, 0x28(%rax)
movq %rax, (%r14,%r15)
addq $0x38, %r15
cmpq $0x1c8, %r15 # imm = 0x1C8
jne 0x21c83
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
|
/walterzhaoJR[P]leveldb/db/version_set.cc
|
leveldb::VersionSet::Builder::Apply(leveldb::VersionEdit*)
|
void Apply(VersionEdit* edit) {
// Update compaction pointers
for (size_t i = 0; i < edit->compact_pointers_.size(); i++) {
const int level = edit->compact_pointers_[i].first;
vset_->compact_pointer_[level] =
edit->compact_pointers_[i].second.Encode().ToString();
}
// Delete files
for (const auto& deleted_file_set_kvp : edit->deleted_files_) {
const int level = deleted_file_set_kvp.first;
const uint64_t number = deleted_file_set_kvp.second;
levels_[level].deleted_files.insert(number);
}
// Add new files
for (size_t i = 0; i < edit->new_files_.size(); i++) {
const int level = edit->new_files_[i].first;
FileMetaData* f = new FileMetaData(edit->new_files_[i].second);
f->refs = 1;
// We arrange to automatically compact this file after
// a certain number of seeks. Let's assume:
// (1) One seek costs 10ms
// (2) Writing or reading 1MB costs 10ms (100MB/s)
// (3) A compaction of 1MB does 25MB of IO:
// 1MB read from this level
// 10-12MB read from next level (boundaries may be misaligned)
// 10-12MB written to next level
// This implies that 25 seeks cost the same as the compaction
// of 1MB of data. I.e., one seek costs approximately the
// same as the compaction of 40KB of data. We are a little
// conservative and allow approximately one seek for every 16KB
// of data before triggering a compaction.
f->allowed_seeks = static_cast<int>((f->file_size / 16384U));
if (f->allowed_seeks < 100) f->allowed_seeks = 100;
levels_[level].deleted_files.erase(f->number);
levels_[level].added_files->insert(f);
}
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
movq %rdi, 0x8(%rsp)
movq 0x48(%rsi), %rax
cmpq %rax, 0x50(%rsi)
je 0x21d7c
movl $0x10, %r12d
leaq 0x28(%rsp), %r13
xorl %ebp, %ebp
leaq 0x18(%rsp), %r15
movq (%rax,%r12), %rdx
testq %rdx, %rdx
je 0x21ef5
movslq -0x10(%rax,%r12), %r14
movq -0x8(%rax,%r12), %rsi
movq %r13, 0x18(%rsp)
addq %rsi, %rdx
movq %r15, %rdi
callq 0x105c0
movq 0x8(%rsp), %rax
movq (%rax), %rax
shlq $0x5, %r14
leaq (%rax,%r14), %rdi
addq $0x170, %rdi # imm = 0x170
movq %r15, %rsi
callq 0xa780
movq 0x18(%rsp), %rdi
cmpq %r13, %rdi
je 0x21d53
callq 0xa570
incq %rbp
movq 0x48(%rbx), %rax
movq 0x50(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x3333333333333333, %rdx # imm = 0xCCCCCCCCCCCCCCCD
imulq %rdx, %rcx
addq $0x28, %r12
cmpq %rcx, %rbp
jb 0x21cfe
movq 0x78(%rbx), %r15
leaq 0x68(%rbx), %r14
cmpq %r14, %r15
je 0x21dc3
movq 0x8(%rsp), %rax
leaq 0x10(%rax), %r13
leaq 0x18(%rsp), %r12
movslq 0x20(%r15), %rax
movq 0x28(%r15), %rcx
movq %rcx, 0x18(%rsp)
imulq $0x38, %rax, %rdi
addq %r13, %rdi
movq %r12, %rsi
callq 0x170c2
movq %r15, %rdi
callq 0xa6d0
movq %rax, %r15
cmpq %r14, %rax
jne 0x21d97
movq 0x90(%rbx), %r13
cmpq %r13, 0x98(%rbx)
movq %rbx, %rcx
movq 0x8(%rsp), %rbx
je 0x21ee6
addq $0x10, %rbx
movl $0x48, %ebp
xorl %r15d, %r15d
movq %rcx, 0x10(%rsp)
movslq -0x48(%r13,%rbp), %r14
movl $0x58, %edi
callq 0xa5c0
movq %rax, %r12
movups -0x40(%r13,%rbp), %xmm0
movups %xmm0, (%rax)
movq -0x30(%r13,%rbp), %rax
movq %rax, 0x10(%r12)
leaq 0x18(%r12), %rdi
leaq 0x28(%r12), %rax
movq %rax, 0x18(%r12)
movq -0x28(%r13,%rbp), %rsi
movq -0x20(%r13,%rbp), %rdx
addq %rsi, %rdx
callq 0xfb0e
leaq 0x38(%r12), %rdi
leaq 0x48(%r12), %rax
movq %rax, 0x38(%r12)
movq -0x8(%r13,%rbp), %rsi
movq (%r13,%rbp), %rdx
addq %rsi, %rdx
callq 0xfb0e
movq %r12, 0x18(%rsp)
movl $0x1, (%r12)
movq 0x10(%r12), %rax
shrq $0xe, %rax
cmpl $0x65, %eax
movl $0x64, %ecx
cmovll %ecx, %eax
movl %eax, 0x4(%r12)
imulq $0x38, %r14, %r14
leaq (%rbx,%r14), %r13
addq $0x8, %r12
movq %r13, %rdi
movq %r12, %rsi
callq 0x16b32
movq %r13, %rdi
movq %rax, %rsi
callq 0x16bb4
movq 0x30(%rbx,%r14), %rdi
leaq 0x18(%rsp), %rsi
callq 0x22658
movq 0x10(%rsp), %rcx
incq %r15
movq 0x90(%rcx), %r13
movq 0x98(%rcx), %rax
subq %r13, %rax
sarq $0x5, %rax
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdx, %rax
addq $0x60, %rbp
cmpq %rax, %r15
jb 0x21df0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x39a16(%rip), %rdi # 0x5b912
leaq 0x38469(%rip), %rsi # 0x5a36c
leaq 0x39a16(%rip), %rcx # 0x5b920
movl $0x96, %edx
callq 0xa3e0
|
/walterzhaoJR[P]leveldb/db/version_set.cc
|
leveldb::VersionSet::Builder::SaveTo(leveldb::Version*)
|
void SaveTo(Version* v) {
BySmallestKey cmp;
cmp.internal_comparator = &vset_->icmp_;
for (int level = 0; level < config::kNumLevels; level++) {
// Merge the set of added files with the set of pre-existing files.
// Drop any deleted files. Store the result in *v.
const std::vector<FileMetaData*>& base_files = base_->files_[level];
std::vector<FileMetaData*>::const_iterator base_iter = base_files.begin();
std::vector<FileMetaData*>::const_iterator base_end = base_files.end();
const FileSet* added_files = levels_[level].added_files;
v->files_[level].reserve(base_files.size() + added_files->size());
for (const auto& added_file : *added_files) {
// Add all smaller files listed in base_
for (std::vector<FileMetaData*>::const_iterator bpos =
std::upper_bound(base_iter, base_end, added_file, cmp);
base_iter != bpos; ++base_iter) {
MaybeAddFile(v, level, *base_iter);
}
MaybeAddFile(v, level, added_file);
}
// Add remaining base files
for (; base_iter != base_end; ++base_iter) {
MaybeAddFile(v, level, *base_iter);
}
#ifndef NDEBUG
// Make sure there is no overlap in levels > 0
if (level > 0) {
for (uint32_t i = 1; i < v->files_[level].size(); i++) {
const InternalKey& prev_end = v->files_[level][i - 1]->largest;
const InternalKey& this_begin = v->files_[level][i]->smallest;
if (vset_->icmp_.Compare(prev_end, this_begin) >= 0) {
std::fprintf(stderr, "overlapping ranges in same level %s vs. %s\n",
prev_end.DebugString().c_str(),
this_begin.DebugString().c_str());
std::abort();
}
}
}
#endif
}
}
|
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rax
addq $0x38, %rax
movq %rax, 0x20(%rsp)
leaq 0x10(%rdi), %rax
movq %rax, 0x18(%rsp)
leaq 0x20(%rsi), %rax
movq %rax, 0x10(%rsp)
xorl %r12d, %r12d
movq 0x8(%r14), %rax
leaq (,%r12,8), %rcx
leaq (%rcx,%rcx,2), %rdi
movq 0x20(%rax,%rdi), %rbp
movq 0x28(%rax,%rdi), %r15
imulq $0x38, %r12, %rax
movq 0x18(%rsp), %rcx
movq 0x30(%rcx,%rax), %r13
addq 0x10(%rsp), %rdi
movq %r15, %rsi
subq %rbp, %rsi
sarq $0x3, %rsi
addq 0x28(%r13), %rsi
movq %rdi, 0x8(%rsp)
callq 0x21b66
movq %r13, %rax
movq 0x18(%r13), %r13
addq $0x8, %rax
movq %rax, 0x30(%rsp)
cmpq %rax, %r13
je 0x22020
movq %r15, 0x28(%rsp)
leaq 0x20(%r13), %rdx
movq %rbp, %rdi
movq %r15, %rsi
movq 0x20(%rsp), %rcx
callq 0x22921
movq %rax, %r15
cmpq %rax, %rbp
je 0x21fdf
movq (%rbp), %rcx
movq %r14, %rdi
movq %rbx, %rsi
movl %r12d, %edx
callq 0x2281a
addq $0x8, %rbp
cmpq %r15, %rbp
jne 0x21fc4
movq 0x20(%r13), %rcx
movq %r14, %rdi
movq %rbx, %rsi
movl %r12d, %edx
callq 0x2281a
movq %r13, %rdi
callq 0xa6d0
movq %rax, %r13
cmpq 0x30(%rsp), %rax
movq 0x28(%rsp), %r15
jne 0x21fa8
jmp 0x22020
movq (%rbp), %rcx
movq %r14, %rdi
movq %rbx, %rsi
movl %r12d, %edx
callq 0x2281a
addq $0x8, %rbp
cmpq %r15, %rbp
jne 0x2200a
testq %r12, %r12
je 0x220cc
movq 0x8(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
subq %rax, %rcx
cmpq $0x9, %rcx
jb 0x220cc
movl $0x1, %ecx
movl $0x2, %ebp
leal -0x2(%rbp), %edx
movq (%rax,%rdx,8), %r15
movq 0x40(%r15), %rdx
testq %rdx, %rdx
je 0x220e8
addq $0x38, %r15
movq (%rax,%rcx,8), %r13
movq (%r14), %rdi
movq (%r15), %rax
movq %rax, 0x48(%rsp)
movq %rdx, 0x50(%rsp)
movq 0x20(%r13), %rax
testq %rax, %rax
je 0x220e8
addq $0x18, %r13
addq $0x38, %rdi
movq (%r13), %rcx
movq %rcx, 0x38(%rsp)
movq %rax, 0x40(%rsp)
movq (%rdi), %rax
leaq 0x48(%rsp), %rsi
leaq 0x38(%rsp), %rdx
callq *0x10(%rax)
testl %eax, %eax
jns 0x22107
movl %ebp, %ecx
movq 0x8(%rsp), %rdx
movq (%rdx), %rax
movq 0x8(%rdx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
incl %ebp
cmpq %rcx, %rdx
ja 0x22051
incq %r12
cmpq $0x7, %r12
jne 0x21f49
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x39823(%rip), %rdi # 0x5b912
leaq 0x38276(%rip), %rsi # 0x5a36c
leaq 0x39823(%rip), %rcx # 0x5b920
movl $0x96, %edx
callq 0xa3e0
movq %r15, %rdi
movq %r13, %rsi
callq 0xb300
|
/walterzhaoJR[P]leveldb/db/version_set.cc
|
leveldb::VersionEdit::SetCompactPointer(int, leveldb::InternalKey const&)
|
void SetCompactPointer(int level, const InternalKey& key) {
compact_pointers_.push_back(std::make_pair(level, key));
}
|
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
addq $0x48, %rbx
leaq 0x10(%rsp), %rdi
movl %esi, -0x8(%rdi)
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rdx), %rsi
movq 0x8(%rdx), %rdx
addq %rsi, %rdx
callq 0xfb0e
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1d4e2
movq 0x8(%r14), %rdi
cmpq %r15, %rdi
je 0x222c6
callq 0xa570
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
|
/walterzhaoJR[P]leveldb/./db/version_edit.h
|
leveldb::Version::LevelFileNumIterator::Prev()
|
void Prev() override {
assert(Valid());
if (index_ == 0) {
index_ = flist_->size(); // Marks as invalid
} else {
index_--;
}
}
|
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
callq *0x10(%rax)
testb %al, %al
je 0x22565
movl 0x40(%rbx), %eax
testl %eax, %eax
je 0x22551
decl %eax
jmp 0x22560
movq 0x38(%rbx), %rcx
movq 0x8(%rcx), %rax
subq (%rcx), %rax
shrq $0x3, %rax
movl %eax, 0x40(%rbx)
popq %rbx
retq
leaq 0x37ffd(%rip), %rdi # 0x5a569
leaq 0x3940d(%rip), %rsi # 0x5b980
leaq 0x39a64(%rip), %rcx # 0x5bfde
movl $0xb6, %edx
callq 0xa3e0
|
/walterzhaoJR[P]leveldb/db/version_set.cc
|
leveldb::Version::LevelFileNumIterator::key() const
|
Slice key() const override {
assert(Valid());
return (*flist_)[index_]->largest.Encode();
}
|
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
callq *0x10(%rax)
testb %al, %al
je 0x225af
movq 0x38(%rbx), %rax
movl 0x40(%rbx), %ecx
movq (%rax), %rax
movq (%rax,%rcx,8), %rax
movq 0x40(%rax), %rdx
testq %rdx, %rdx
je 0x225ce
movq 0x38(%rax), %rax
popq %rbx
retq
leaq 0x37fb3(%rip), %rdi # 0x5a569
leaq 0x393c3(%rip), %rsi # 0x5b980
leaq 0x39a56(%rip), %rcx # 0x5c01a
movl $0xbe, %edx
callq 0xa3e0
leaq 0x3933d(%rip), %rdi # 0x5b912
leaq 0x37d90(%rip), %rsi # 0x5a36c
leaq 0x3933d(%rip), %rcx # 0x5b920
movl $0x96, %edx
callq 0xa3e0
nop
|
/walterzhaoJR[P]leveldb/db/version_set.cc
|
leveldb::WriteBatchInternal::InsertInto(leveldb::WriteBatch const*, leveldb::MemTable*)
|
Status WriteBatchInternal::InsertInto(const WriteBatch* b, MemTable* memtable) {
MemTableInserter inserter;
inserter.sequence_ = WriteBatchInternal::Sequence(b);
inserter.mem_ = memtable;
return b->Iterate(&inserter);
}
|
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
leaq 0x5c303(%rip), %rcx # 0x7f798
leaq 0x8(%rsp), %rax
movq %rcx, (%rax)
movq (%rsi), %rcx
movq (%rcx), %rcx
movq %rcx, 0x8(%rax)
movq %rdx, 0x10(%rax)
movq %rax, %rdx
callq 0x231c6
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
retq
|
/walterzhaoJR[P]leveldb/db/write_batch.cc
|
leveldb::WriteBatchInternal::SetContents(leveldb::WriteBatch*, leveldb::Slice const&)
|
size_t size() const { return size_; }
|
movq 0x8(%rsi), %r8
cmpq $0xb, %r8
jbe 0x234d6
movq (%rsi), %rcx
movq 0x8(%rdi), %rdx
xorl %esi, %esi
jmp 0xaa10
pushq %rax
leaq 0x38d84(%rip), %rdi # 0x5c262
leaq 0x38d98(%rip), %rsi # 0x5c27d
leaq 0x38df1(%rip), %rcx # 0x5c2dd
movl $0x8c, %edx
callq 0xa3e0
|
/walterzhaoJR[P]leveldb/include/leveldb/slice.h
|
Subsets and Splits
SQL Console for LLM4Binary/decompile-bench
Filters out entries with file names ending in .cpp, providing a basic subset of the dataset that excludes C++ files.