Skip to content

Instantly share code, notes, and snippets.

@davispuh
Created March 19, 2023 18:28
Show Gist options
  • Save davispuh/6a3d39990288759efcf5a9283eca82c0 to your computer and use it in GitHub Desktop.
Save davispuh/6a3d39990288759efcf5a9283eca82c0 to your computer and use it in GitHub Desktop.
;void FileMetaDataProvider::setFileItem()
;{
1e220: push r15
1e222: push r14
1e224: push r13
1e226: push r12
1e228: push rbp
1e229: push rbx
1e22a: mov rbx,rdi
1e22d: sub rsp,0xa8
1e234: mov rax,QWORD PTR fs:0x28
1e23d: mov QWORD PTR [rsp+0x98],rax
1e245: xor eax,eax
; if (m_fileItems.count() == 1) {
1e247: cmp QWORD PTR [rdi+0x28],0x1
1e24c: /----------------------- je 1e4e0 <Baloo::FileMetaDataProvider::setFileItem()+0x2c0>
; void ref() noexcept { if (d) d->ref(); }
; bool deref() noexcept { return !d || d->deref(); }
; bool isMutable() const noexcept { return d; }
; bool isShared() const noexcept { return !d || d->isShared(); }
; bool isSharedWith(const QArrayDataPointer &other) const noexcept { return d && d == other.d; }
; bool needsDetach() const noexcept { return !d || d->needsDetach(); }
1e252: | /-------------------> mov rax,QWORD PTR [rbx+0x18]
;
; inline qsizetype capacity() const { return qsizetype(d->constAllocatedCapacity()); }
; void reserve(qsizetype size);
; inline void squeeze();
;
; void detach() { d.detach(); }
1e256: | | lea r12,[rbx+0x18]
1e25a: | | test rax,rax
1e25d: | | /-- je 1e266 <Baloo::FileMetaDataProvider::setFileItem()+0x46>
; memory_order __b __attribute__ ((__unused__))
; = __m & __memory_order_mask;
; __glibcxx_assert(__b != memory_order_release);
; __glibcxx_assert(__b != memory_order_acq_rel);
;
; return __atomic_load_n(&_M_i, int(__m));
1e25f: | | | mov eax,DWORD PTR [rax]
1e261: | | | cmp eax,0x1
1e264: | | /--|-- jle 1e274 <Baloo::FileMetaDataProvider::setFileItem()+0x54>
; reallocateAndGrow(QArrayData::GrowsAtEnd, 0, old);
1e266: | | | \-> xor ecx,ecx
1e268: | | | xor edx,edx
1e26a: | | | xor esi,esi
1e26c: | | | mov rdi,r12
1e26f: | | | call 2af30 <QArrayDataPointer<KFileItem>::reallocateAndGrow(QArrayData::GrowthPosition, long long, QArrayDataPointer<KFileItem>*)>
; // Single local file -
; // * Not Indexed
; // * Indexed
; //
; insertSingleFileBasicData();
; const QUrl url = m_fileItems.first().targetUrl();
1e274: | | \----> lea rbp,[rsp+0x20]
1e279: | | mov rsi,QWORD PTR [rbx+0x20]
1e27d: | | mov rdi,rbp
1e280: | | call QWORD PTR [rip+0x33a3a] # 51cc0 <KFileItem::targetUrl() const@Base>
; if (!url.isLocalFile() || m_fileItems.first().isSlow()) {
1e286: | | mov rdi,rbp
1e289: | | call QWORD PTR [rip+0x339e1] # 51c70 <QUrl::isLocalFile() const@Qt_6>
1e28f: | | test al,al
1e291: | | /-------- je 1e2bf <Baloo::FileMetaDataProvider::setFileItem()+0x9f>
; bool needsDetach() const noexcept { return !d || d->needsDetach(); }
1e293: | | | mov rax,QWORD PTR [rbx+0x18]
1e297: | | | test rax,rax
1e29a: | | | /-- je 1e2a3 <Baloo::FileMetaDataProvider::setFileItem()+0x83>
1e29c: | | | | mov eax,DWORD PTR [rax]
1e29e: | | | | cmp eax,0x1
1e2a1: | | | /--|-- jle 1e2b1 <Baloo::FileMetaDataProvider::setFileItem()+0x91>
; reallocateAndGrow(QArrayData::GrowsAtEnd, 0, old);
1e2a3: | | | | \-> xor ecx,ecx
1e2a5: | | | | xor edx,edx
1e2a7: | | | | xor esi,esi
1e2a9: | | | | mov rdi,r12
1e2ac: | | | | call 2af30 <QArrayDataPointer<KFileItem>::reallocateAndGrow(QArrayData::GrowthPosition, long long, QArrayDataPointer<KFileItem>*)>
1e2b1: | | | \----> mov rdi,QWORD PTR [rbx+0x20]
1e2b5: | | | call QWORD PTR [rip+0x3330d] # 515c8 <KFileItem::isSlow() const@Base>
1e2bb: | | | test al,al
1e2bd: | | | /-- je 1e300 <Baloo::FileMetaDataProvider::setFileItem()+0xe0>
; // FIXME - are extended attributes supported for remote files?
; m_readOnly = true;
; Q_EMIT loadingFinished();
1e2bf: | | \-----|-> mov rdi,rbx
; m_readOnly = true;
1e2c2: | | | mov BYTE PTR [rbx+0x10],0x1
; Q_EMIT loadingFinished();
1e2c6: | | | addr32 call 13970 <Baloo::FileMetaDataProvider::loadingFinished()>
; }
;
; job = new FileFetchJob(QStringList{filePath}, true, indexingMode, this);
; connect(job, &FileFetchJob::finished, this, &FileMetaDataProvider::slotFileFetchFinished);
; job->start();
;}
1e2cc: | | | mov rdi,rbp
1e2cf: | | | call QWORD PTR [rip+0x32f83] # 51258 <QUrl::~QUrl()@Qt_6>
1e2d5: | | /-----------|-> mov rax,QWORD PTR [rsp+0x98]
1e2dd: | | | | sub rax,QWORD PTR fs:0x28
1e2e6: | | /--|-----------|-- jne 1e520 <Baloo::FileMetaDataProvider::setFileItem()+0x300>
1e2ec: | | | | | add rsp,0xa8
1e2f3: | | | | | pop rbx
1e2f4: | | | | | pop rbp
1e2f5: | | | | | pop r12
1e2f7: | | | | | pop r13
1e2f9: | | | | | pop r14
1e2fb: | | | | | pop r15
1e2fd: | | | | | ret
1e2fe: | | | | | xchg ax,ax
; const QString filePath = url.toLocalFile();
1e300: | | | | \-> lea r14,[rsp+0x40]
; if (!m_config.fileIndexingEnabled() || !m_config.shouldBeIndexed(filePath) || m_config.onlyBasicIndexing()) {
1e305: | | | | lea r12,[rbx+0x38]
; const QString filePath = url.toLocalFile();
1e309: | | | | mov rsi,rbp
1e30c: | | | | mov rdi,r14
1e30f: | | | | call QWORD PTR [rip+0x3347b] # 51790 <QUrl::toLocalFile() const@Qt_6>
; if (!m_config.fileIndexingEnabled() || !m_config.shouldBeIndexed(filePath) || m_config.onlyBasicIndexing()) {
1e315: | | | | mov rdi,r12
1e318: | | | | call QWORD PTR [rip+0x33542] # 51860 <Baloo::IndexerConfig::fileIndexingEnabled() const@Base>
1e31e: | | | | test al,al
1e320: | | | | /----- jne 1e4f0 <Baloo::FileMetaDataProvider::setFileItem()+0x2d0>
; m_realTimeIndexing = true;
1e326: | | | | /--|----> mov BYTE PTR [rbx+0x11],0x1
; indexingMode = FileFetchJob::UseRealtimeIndexing::Only;
1e32a: | | | | | | mov r15d,0x1
; job = new FileFetchJob(QStringList{filePath}, true, indexingMode, this);
1e330: | | | | /--|--|----> mov edi,0x78
1e335: | | | | | | | call QWORD PTR [rip+0x3363d] # 51978 <operator new(unsigned long)@GLIBCXX_3.4>
; : d(other.d), ptr(other.ptr), size(other.size)
1e33b: | | | | | | | vmovdqa xmm0,XMMWORD PTR [rsp+0x40]
1e341: | | | | | | | mov r10,QWORD PTR [rsp+0x50]
1e346: | | | | | | | mov r12,rax
1e349: | | | | | | | mov QWORD PTR [rsp+0x90],r10
1e351: | | | | | | | vmovdqa XMMWORD PTR [rsp+0x80],xmm0
1e35a: | | | | | | | vmovq r9,xmm0
; void ref() noexcept { if (d) d->ref(); }
1e35f: | | | | | | | test r9,r9
1e362: | | | | | | | /-- je 1e37e <Baloo::FileMetaDataProvider::setFileItem()+0x15e>
;#endif // __cpp_lib_atomic_wait
;
; _GLIBCXX_ALWAYS_INLINE __int_type
; fetch_add(__int_type __i,
; memory_order __m = memory_order_seq_cst) noexcept
; { return __atomic_fetch_add(&_M_i, __i, int(__m)); }
1e364: | | | | | | | | lock inc DWORD PTR [r9]
; : d(other.d), ptr(other.ptr), size(other.size)
1e368: | | | | | | | | vmovdqa xmm0,XMMWORD PTR [rsp+0x80]
1e371: | | | | | | | | mov r10,QWORD PTR [rsp+0x90]
1e379: | | | | | | | | vmovq r9,xmm0
;
; [[nodiscard]] static QPair<QTypedArrayData *, T *> allocate(qsizetype capacity, AllocationOption option = QArrayData::KeepSize)
; {
; static_assert(sizeof(QTypedArrayData) == sizeof(QArrayData));
; QArrayData *d;
; void *result = QArrayData::allocate(&d, sizeof(T), alignof(AlignmentDummy), capacity, option);
1e37e: | | | | | | | \-> lea r13,[rsp+0x60]
1e383: | | | | | | | mov QWORD PTR [rsp+0x18],r9
1e388: | | | | | | | mov QWORD PTR [rsp+0x10],r10
1e38d: | | | | | | | mov r8d,0x1
1e393: | | | | | | | vmovdqa XMMWORD PTR [rsp],xmm0
1e398: | | | | | | | mov ecx,0x1
1e39d: | | | | | | | mov edx,0x8
1e3a2: | | | | | | | mov esi,0x18
1e3a7: | | | | | | | mov rdi,r13
1e3aa: | | | | | | | call QWORD PTR [rip+0x32f00] # 512b0 <QArrayData::allocate(QArrayData**, long long, long long, long long, QArrayData::AllocationOption)@Qt_6>
1e3b0: | | | | | | | vmovq xmm2,QWORD PTR [rsp+0x60]
; : d(adata.first), ptr(adata.second), size(n)
1e3b6: | | | | | | | mov QWORD PTR [rsp+0x70],0x0
; : d(other.d), ptr(other.ptr), size(other.size)
1e3bf: | | | | | | | vmovdqa xmm0,XMMWORD PTR [rsp]
1e3c4: | | | | | | | vpinsrq xmm1,xmm2,rax,0x1
1e3ca: | | | | | | | mov r10,QWORD PTR [rsp+0x10]
; void ref() noexcept { if (d) d->ref(); }
1e3cf: | | | | | | | mov r9,QWORD PTR [rsp+0x18]
; : d(adata.first), ptr(adata.second), size(n)
1e3d4: | | | | | | | vmovdqa XMMWORD PTR [rsp+0x60],xmm1
; : d(other.d), ptr(other.ptr), size(other.size)
1e3da: | | | | | | | mov QWORD PTR [rax+0x10],r10
1e3de: | | | | | | | vmovdqu XMMWORD PTR [rax],xmm0
1e3e2: | | | | | | | mov eax,0x1
; void ref() noexcept { if (d) d->ref(); }
1e3e7: | | | | | | | test r9,r9
1e3ea: | | | | | | | /-- je 1e3f8 <Baloo::FileMetaDataProvider::setFileItem()+0x1d8>
1e3ec: | | | | | | | | lock inc DWORD PTR [r9]
;
; T *data = this->begin();
; while (b < e) {
; new (data + this->size) T(*b);
; ++b;
; ++this->size;
1e3f0: | | | | | | | | mov rax,QWORD PTR [rsp+0x70]
1e3f5: | | | | | | | | inc rax
1e3f8: | | | | | | | \-> mov QWORD PTR [rsp+0x70],rax
1e3fd: | | | | | | | mov r8,rbx
1e400: | | | | | | | mov ecx,r15d
1e403: | | | | | | | mov rsi,r13
1e406: | | | | | | | mov edx,0x1
1e40b: | | | | | | | mov rdi,r12
1e40e: | | | | | | | addr32 call 16770 <Baloo::FileFetchJob::FileFetchJob(QList<QString> const&, bool, Baloo::FileFetchJob::UseRealtimeIndexing, QObject*)>
;class QList
1e414: | | | | | | | mov rdi,r13
1e417: | | | | | | | call 15fb0 <QArrayDataPointer<QString>::~QArrayDataPointer()>
; return sizeof(wchar_t) == sizeof(QChar) ? fromUtf16(reinterpret_cast<const char16_t *>(string), size)
; : fromUcs4(reinterpret_cast<const char32_t *>(string), size);
;}
;
;inline constexpr QString::QString() noexcept {}
;inline QString::~QString() {}
1e41c: | | | | | | | lea rdi,[rsp+0x80]
;
; return connectImpl(sender, reinterpret_cast<void **>(&signal),
; receiver, reinterpret_cast<void **>(&slot),
; new QtPrivate::QSlotObject<Func2, typename QtPrivate::List_Left<typename SignalType::Arguments, SlotType::ArgumentCount>::Value,
; typename SignalType::ReturnType>(slot),
; type, types, &SignalType::Object::staticMetaObject);
1e424: | | | | | | | lea r15,[rsp+0x28]
1e429: | | | | | | | call 15f80 <QArrayDataPointer<char16_t>::~QArrayDataPointer()>
; connect(job, &FileFetchJob::finished, this, &FileMetaDataProvider::slotFileFetchFinished);
1e42e: | | | | | | | mov rax,QWORD PTR [rip+0x33a13] # 51e48 <KJob::finished(KJob*, KJob::QPrivateSignal)@Base>
1e435: | | | | | | | mov QWORD PTR [rsp+0x38],0x0
1e43e: | | | | | | | mov QWORD PTR [rsp+0x68],0x0
; new QtPrivate::QSlotObject<Func2, typename QtPrivate::List_Left<typename SignalType::Arguments, SlotType::ArgumentCount>::Value,
1e447: | | | | | | | mov edi,0x20
1e44c: | | | | | | | mov QWORD PTR [rsp+0x30],rax
1e451: | | | | | | | lea rax,[rip+0x3868] # 21cc0 <Baloo::FileMetaDataProvider::slotFileFetchFinished(KJob*)>
1e458: | | | | | | | mov QWORD PTR [rsp+0x60],rax
1e45d: | | | | | | | call QWORD PTR [rip+0x33515] # 51978 <operator new(unsigned long)@GLIBCXX_3.4>
; type, types, &SignalType::Object::staticMetaObject);
1e463: | | | | | | | lea rdx,[rsp+0x30]
1e468: | | | | | | | sub rsp,0x8
; new QtPrivate::QSlotObject<Func2, typename QtPrivate::List_Left<typename SignalType::Arguments, SlotType::ArgumentCount>::Value,
1e46c: | | | | | | | mov r9,rax
; constexpr __atomic_base(__int_type __i) noexcept : _M_i (__i) { }
1e46f: | | | | | | | mov DWORD PTR [rax],0x1
; Compare,
;
; NumOperations
; };
; public:
; explicit QSlotObjectBase(ImplFn fn) : m_ref(1), m_impl(fn) {}
1e475: | | | | | | | lea rax,[rip+0x8ba4] # 27020 <QtPrivate::QSlotObject<void (Baloo::FileMetaDataProvider::*)(KJob*), QtPrivate::List<KJob*>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*)>
1e47c: | | | | | | | mov QWORD PTR [r9+0x8],rax
; break;
; case NumOperations: ;
; }
; }
; public:
; explicit QSlotObject(Func f) : QSlotObjectBase(&impl), function(f) {}
1e480: | | | | | | | mov rax,QWORD PTR [rsp+0x68]
; type, types, &SignalType::Object::staticMetaObject);
1e485: | | | | | | | mov r8,r13
1e488: | | | | | | | mov rcx,rbx
1e48b: | | | | | | | mov rsi,r12
1e48e: | | | | | | | mov rdi,r15
1e491: | | | | | | | mov QWORD PTR [r9+0x10],rax
1e495: | | | | | | | mov rax,QWORD PTR [rsp+0x70]
1e49a: | | | | | | | mov QWORD PTR [r9+0x18],rax
1e49e: | | | | | | | push QWORD PTR [rip+0x334bc] # 51960 <KJob::staticMetaObject@Base>
1e4a4: | | | | | | | push 0x0
1e4a6: | | | | | | | push 0x0
1e4a8: | | | | | | | call QWORD PTR [rip+0x3328a] # 51738 <QObject::connectImpl(QObject const*, void**, QObject const*, void**, QtPrivate::QSlotObjectBase*, Qt::ConnectionType, int const*, QMetaObject const*)@Qt_6>
1e4ae: | | | | | | | mov rdi,r15
1e4b1: | | | | | | | add rsp,0x20
1e4b5: | | | | | | | call QWORD PTR [rip+0x3309d] # 51558 <QMetaObject::Connection::~Connection()@Qt_6>
; job->start();
1e4bb: | | | | | | | mov rax,QWORD PTR [r12]
1e4bf: | | | | | | | mov rdi,r12
1e4c2: | | | | | | | call QWORD PTR [rax+0x60]
1e4c5: | | | | | | | mov rdi,r14
1e4c8: | | | | | | | call 15f80 <QArrayDataPointer<char16_t>::~QArrayDataPointer()>
;}
1e4cd: | | | | | | | mov rdi,rbp
1e4d0: | | | | | | | call QWORD PTR [rip+0x32d82] # 51258 <QUrl::~QUrl()@Qt_6>
1e4d6: | | | \--|--|--|----- jmp 1e2d5 <Baloo::FileMetaDataProvider::setFileItem()+0xb5>
1e4db: | | | | | | nop DWORD PTR [rax+rax*1+0x0]
1e4e0: \--|--|-----|--|--|----> call 1d150 <Baloo::FileMetaDataProvider::insertSingleFileBasicData() [clone .part.0]>
1e4e5: \--|-----|--|--|----- jmp 1e252 <Baloo::FileMetaDataProvider::setFileItem()+0x32>
1e4ea: | | | | nop WORD PTR [rax+rax*1+0x0]
; if (!m_config.fileIndexingEnabled() || !m_config.shouldBeIndexed(filePath) || m_config.onlyBasicIndexing()) {
1e4f0: | | | \----> mov rsi,r14
1e4f3: | | | mov rdi,r12
1e4f6: | | | call QWORD PTR [rip+0x3342c] # 51928 <Baloo::IndexerConfig::shouldBeIndexed(QString const&) const@Base>
1e4fc: | | | test al,al
1e4fe: | | +-------- je 1e326 <Baloo::FileMetaDataProvider::setFileItem()+0x106>
1e504: | | | mov rdi,r12
1e507: | | | call QWORD PTR [rip+0x3366b] # 51b78 <Baloo::IndexerConfig::onlyBasicIndexing() const@Base>
1e50d: | | | test al,al
1e50f: | | \-------- jne 1e326 <Baloo::FileMetaDataProvider::setFileItem()+0x106>
; auto indexingMode = FileFetchJob::UseRealtimeIndexing::Fallback;
1e515: | | mov r15d,0x2
1e51b: | \----------- jmp 1e330 <Baloo::FileMetaDataProvider::setFileItem()+0x110>
;}
1e520: \----------------> call QWORD PTR [rip+0x32e42] # 51368 <__stack_chk_fail@GLIBC_2.4>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment