Skip to content

Instantly share code, notes, and snippets.

@davispuh
Created March 19, 2023 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davispuh/2d2cf721146e0f4ea03e17d0c6cfe368 to your computer and use it in GitHub Desktop.
Save davispuh/2d2cf721146e0f4ea03e17d0c6cfe368 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 1e500 <Baloo::FileMetaDataProvider::setFileItem()+0x2e0>
; 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 2aed0 <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 2aed0 <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()>
; } else {
; job = new FileFetchJob(QStringList{filePath}, true, FileFetchJob::UseRealtimeIndexing::Fallback, 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 1e5e0 <Baloo::FileMetaDataProvider::setFileItem()+0x3c0>
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: | | | | /-- je 1e350 <Baloo::FileMetaDataProvider::setFileItem()+0x130>
1e322: | | | | | mov rsi,r14
1e325: | | | | | mov rdi,r12
1e328: | | | | | call QWORD PTR [rip+0x335fa] # 51928 <Baloo::IndexerConfig::shouldBeIndexed(QString const&) const@Base>
1e32e: | | | | | test al,al
1e330: | | | | +-- je 1e350 <Baloo::FileMetaDataProvider::setFileItem()+0x130>
1e332: | | | | | mov rdi,r12
1e335: | | | | | call QWORD PTR [rip+0x3383d] # 51b78 <Baloo::IndexerConfig::onlyBasicIndexing() const@Base>
1e33b: | | | | | test al,al
1e33d: | | | | /-----|-- je 1e510 <Baloo::FileMetaDataProvider::setFileItem()+0x2f0>
1e343: | | | | | | data16 cs nop WORD PTR [rax+rax*1+0x0]
1e34e: | | | | | | xchg ax,ax
; m_realTimeIndexing = true;
1e350: | | | | | \-> mov BYTE PTR [rbx+0x11],0x1
; job = new FileFetchJob(QStringList{filePath}, true, FileFetchJob::UseRealtimeIndexing::Only, this);
1e354: | | | | | mov edi,0x78
1e359: | | | | | call QWORD PTR [rip+0x33619] # 51978 <operator new(unsigned long)@GLIBCXX_3.4>
; : d(other.d), ptr(other.ptr), size(other.size)
1e35f: | | | | | vmovdqa xmm0,XMMWORD PTR [rsp+0x40]
1e365: | | | | | mov r9,QWORD PTR [rsp+0x50]
1e36a: | | | | | mov r12,rax
1e36d: | | | | | mov QWORD PTR [rsp+0x90],r9
1e375: | | | | | vmovdqa XMMWORD PTR [rsp+0x80],xmm0
1e37e: | | | | | vmovq r15,xmm0
; void ref() noexcept { if (d) d->ref(); }
1e383: | | | | | test r15,r15
1e386: | | | | | /-- je 1e3a2 <Baloo::FileMetaDataProvider::setFileItem()+0x182>
;#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)); }
1e388: | | | | | | lock inc DWORD PTR [r15]
; : d(other.d), ptr(other.ptr), size(other.size)
1e38c: | | | | | | vmovdqa xmm0,XMMWORD PTR [rsp+0x80]
1e395: | | | | | | mov r9,QWORD PTR [rsp+0x90]
1e39d: | | | | | | vmovq r15,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);
1e3a2: | | | | | \-> lea r13,[rsp+0x60]
1e3a7: | | | | | mov QWORD PTR [rsp+0x18],r9
1e3ac: | | | | | vmovdqa XMMWORD PTR [rsp],xmm0
1e3b1: | | | | | mov r8d,0x1
1e3b7: | | | | | mov ecx,0x1
1e3bc: | | | | | mov edx,0x8
1e3c1: | | | | | mov esi,0x18
1e3c6: | | | | | mov rdi,r13
1e3c9: | | | | | call QWORD PTR [rip+0x32ee1] # 512b0 <QArrayData::allocate(QArrayData**, long long, long long, long long, QArrayData::AllocationOption)@Qt_6>
1e3cf: | | | | | vmovdqa xmm0,XMMWORD PTR [rsp]
1e3d4: | | | | | vmovq xmm2,QWORD PTR [rsp+0x60]
; : d(adata.first), ptr(adata.second), size(n)
1e3da: | | | | | mov QWORD PTR [rsp+0x70],0x0
; : d(other.d), ptr(other.ptr), size(other.size)
1e3e3: | | | | | mov r9,QWORD PTR [rsp+0x18]
1e3e8: | | | | | vpinsrq xmm1,xmm2,rax,0x1
; : d(adata.first), ptr(adata.second), size(n)
1e3ee: | | | | | vmovdqa XMMWORD PTR [rsp+0x60],xmm1
; : d(other.d), ptr(other.ptr), size(other.size)
1e3f4: | | | | | mov QWORD PTR [rax+0x10],r9
1e3f8: | | | | | vmovdqu XMMWORD PTR [rax],xmm0
1e3fc: | | | | | mov eax,0x1
; void ref() noexcept { if (d) d->ref(); }
1e401: | | | | | test r15,r15
1e404: | | | | | /-- je 1e412 <Baloo::FileMetaDataProvider::setFileItem()+0x1f2>
1e406: | | | | | | lock inc DWORD PTR [r15]
;
; T *data = this->begin();
; while (b < e) {
; new (data + this->size) T(*b);
; ++b;
; ++this->size;
1e40a: | | | | | | mov rax,QWORD PTR [rsp+0x70]
1e40f: | | | | | | inc rax
1e412: | | | | | \-> mov QWORD PTR [rsp+0x70],rax
1e417: | | | | | mov r8,rbx
1e41a: | | | | | mov ecx,0x1
; job = new FileFetchJob(QStringList{filePath}, true, FileFetchJob::UseRealtimeIndexing::Fallback, this);
1e41f: | | | | | /----> mov rsi,r13
1e422: | | | | | | mov edx,0x1
1e427: | | | | | | mov rdi,r12
1e42a: | | | | | | addr32 call 16770 <Baloo::FileFetchJob::FileFetchJob(QList<QString> const&, bool, Baloo::FileFetchJob::UseRealtimeIndexing, QObject*)>
;class QList
1e430: | | | | | | mov rdi,r13
;
; 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);
1e433: | | | | | | lea r15,[rsp+0x28]
1e438: | | | | | | 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() {}
1e43d: | | | | | | lea rdi,[rsp+0x80]
1e445: | | | | | | call 15f80 <QArrayDataPointer<char16_t>::~QArrayDataPointer()>
; connect(job, &FileFetchJob::finished, this, &FileMetaDataProvider::slotFileFetchFinished);
1e44a: | | | | | | mov rax,QWORD PTR [rip+0x339f7] # 51e48 <KJob::finished(KJob*, KJob::QPrivateSignal)@Base>
1e451: | | | | | | mov QWORD PTR [rsp+0x38],0x0
1e45a: | | | | | | mov QWORD PTR [rsp+0x68],0x0
; new QtPrivate::QSlotObject<Func2, typename QtPrivate::List_Left<typename SignalType::Arguments, SlotType::ArgumentCount>::Value,
1e463: | | | | | | mov edi,0x20
1e468: | | | | | | mov QWORD PTR [rsp+0x30],rax
1e46d: | | | | | | lea rax,[rip+0x390c] # 21d80 <Baloo::FileMetaDataProvider::slotFileFetchFinished(KJob*)>
1e474: | | | | | | mov QWORD PTR [rsp+0x60],rax
1e479: | | | | | | call QWORD PTR [rip+0x334f9] # 51978 <operator new(unsigned long)@GLIBCXX_3.4>
; type, types, &SignalType::Object::staticMetaObject);
1e47f: | | | | | | lea rdx,[rsp+0x30]
1e484: | | | | | | sub rsp,0x8
; new QtPrivate::QSlotObject<Func2, typename QtPrivate::List_Left<typename SignalType::Arguments, SlotType::ArgumentCount>::Value,
1e488: | | | | | | mov r9,rax
; constexpr __atomic_base(__int_type __i) noexcept : _M_i (__i) { }
1e48b: | | | | | | mov DWORD PTR [rax],0x1
; Compare,
;
; NumOperations
; };
; public:
; explicit QSlotObjectBase(ImplFn fn) : m_ref(1), m_impl(fn) {}
1e491: | | | | | | lea rax,[rip+0x8b18] # 26fb0 <QtPrivate::QSlotObject<void (Baloo::FileMetaDataProvider::*)(KJob*), QtPrivate::List<KJob*>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*)>
1e498: | | | | | | mov QWORD PTR [r9+0x8],rax
; break;
; case NumOperations: ;
; }
; }
; public:
; explicit QSlotObject(Func f) : QSlotObjectBase(&impl), function(f) {}
1e49c: | | | | | | mov rax,QWORD PTR [rsp+0x68]
; type, types, &SignalType::Object::staticMetaObject);
1e4a1: | | | | | | mov r8,r13
1e4a4: | | | | | | mov rcx,rbx
1e4a7: | | | | | | mov rsi,r12
1e4aa: | | | | | | mov rdi,r15
1e4ad: | | | | | | mov QWORD PTR [r9+0x10],rax
1e4b1: | | | | | | mov rax,QWORD PTR [rsp+0x70]
1e4b6: | | | | | | mov QWORD PTR [r9+0x18],rax
1e4ba: | | | | | | push QWORD PTR [rip+0x334a0] # 51960 <KJob::staticMetaObject@Base>
1e4c0: | | | | | | push 0x0
1e4c2: | | | | | | push 0x0
1e4c4: | | | | | | call QWORD PTR [rip+0x3326e] # 51738 <QObject::connectImpl(QObject const*, void**, QObject const*, void**, QtPrivate::QSlotObjectBase*, Qt::ConnectionType, int const*, QMetaObject const*)@Qt_6>
1e4ca: | | | | | | mov rdi,r15
1e4cd: | | | | | | add rsp,0x20
1e4d1: | | | | | | call QWORD PTR [rip+0x33081] # 51558 <QMetaObject::Connection::~Connection()@Qt_6>
; job->start();
1e4d7: | | | | | | mov rax,QWORD PTR [r12]
1e4db: | | | | | | mov rdi,r12
1e4de: | | | | | | call QWORD PTR [rax+0x60]
1e4e1: | | | | | | mov rdi,r14
1e4e4: | | | | | | call 15f80 <QArrayDataPointer<char16_t>::~QArrayDataPointer()>
;}
1e4e9: | | | | | | mov rdi,rbp
1e4ec: | | | | | | call QWORD PTR [rip+0x32d66] # 51258 <QUrl::~QUrl()@Qt_6>
1e4f2: | | | \--|--|----- jmp 1e2d5 <Baloo::FileMetaDataProvider::setFileItem()+0xb5>
1e4f7: | | | | | nop WORD PTR [rax+rax*1+0x0]
1e500: | \--|-----|--|----> call 1d150 <Baloo::FileMetaDataProvider::insertSingleFileBasicData() [clone .part.0]>
1e505: | \-----|--|----- jmp 1e252 <Baloo::FileMetaDataProvider::setFileItem()+0x32>
1e50a: | | | nop WORD PTR [rax+rax*1+0x0]
; job = new FileFetchJob(QStringList{filePath}, true, FileFetchJob::UseRealtimeIndexing::Fallback, this);
1e510: | \--|----> mov edi,0x78
1e515: | | call QWORD PTR [rip+0x3345d] # 51978 <operator new(unsigned long)@GLIBCXX_3.4>
; : d(other.d), ptr(other.ptr), size(other.size)
1e51b: | | vmovdqa xmm0,XMMWORD PTR [rsp+0x40]
1e521: | | mov r9,QWORD PTR [rsp+0x50]
1e526: | | mov r12,rax
1e529: | | mov QWORD PTR [rsp+0x90],r9
1e531: | | vmovdqa XMMWORD PTR [rsp+0x80],xmm0
1e53a: | | vmovq r15,xmm0
; void ref() noexcept { if (d) d->ref(); }
1e53f: | | test r15,r15
1e542: | | /-- je 1e55e <Baloo::FileMetaDataProvider::setFileItem()+0x33e>
; { return __atomic_fetch_add(&_M_i, __i, int(__m)); }
1e544: | | | lock inc DWORD PTR [r15]
; : d(other.d), ptr(other.ptr), size(other.size)
1e548: | | | vmovdqa xmm0,XMMWORD PTR [rsp+0x80]
1e551: | | | mov r9,QWORD PTR [rsp+0x90]
1e559: | | | vmovq r15,xmm0
1e55e: | | \-> lea r13,[rsp+0x60]
1e563: | | mov QWORD PTR [rsp+0x18],r9
1e568: | | vmovdqa XMMWORD PTR [rsp],xmm0
1e56d: | | mov r8d,0x1
1e573: | | mov ecx,0x1
1e578: | | mov edx,0x8
1e57d: | | mov esi,0x18
1e582: | | mov rdi,r13
1e585: | | call QWORD PTR [rip+0x32d25] # 512b0 <QArrayData::allocate(QArrayData**, long long, long long, long long, QArrayData::AllocationOption)@Qt_6>
1e58b: | | vmovdqa xmm0,XMMWORD PTR [rsp]
1e590: | | vmovq xmm3,QWORD PTR [rsp+0x60]
; : d(adata.first), ptr(adata.second), size(n)
1e596: | | mov QWORD PTR [rsp+0x70],0x0
; : d(other.d), ptr(other.ptr), size(other.size)
1e59f: | | mov r9,QWORD PTR [rsp+0x18]
1e5a4: | | vpinsrq xmm1,xmm3,rax,0x1
; : d(adata.first), ptr(adata.second), size(n)
1e5aa: | | vmovdqa XMMWORD PTR [rsp+0x60],xmm1
; : d(other.d), ptr(other.ptr), size(other.size)
1e5b0: | | mov QWORD PTR [rax+0x10],r9
1e5b4: | | vmovdqu XMMWORD PTR [rax],xmm0
1e5b8: | | mov eax,0x1
; void ref() noexcept { if (d) d->ref(); }
1e5bd: | | test r15,r15
1e5c0: | | /-- je 1e5ce <Baloo::FileMetaDataProvider::setFileItem()+0x3ae>
1e5c2: | | | lock inc DWORD PTR [r15]
1e5c6: | | | mov rax,QWORD PTR [rsp+0x70]
1e5cb: | | | inc rax
1e5ce: | | \-> mov QWORD PTR [rsp+0x70],rax
1e5d3: | | mov r8,rbx
1e5d6: | | mov ecx,0x2
1e5db: | \----- jmp 1e41f <Baloo::FileMetaDataProvider::setFileItem()+0x1ff>
;}
1e5e0: \-------------------> call QWORD PTR [rip+0x32d82] # 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