mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 23:08:39 +09:00
Reverting rev b7e45308 and 9824659d again as I can still get a crash in RegExpShared::finalize(FreeOp* fop)
This commit is contained in:
parent
2b9187d8bf
commit
bb547a1b55
3 changed files with 12 additions and 14 deletions
|
|
@ -340,6 +340,9 @@ class TenuredCell : public Cell
|
|||
static MOZ_ALWAYS_INLINE void writeBarrierPost(void* cellp, TenuredCell* prior,
|
||||
TenuredCell* next);
|
||||
|
||||
// Default implementation for kinds that don't require finalization.
|
||||
void finalize(FreeOp* fop) {}
|
||||
|
||||
// Default implementation for kinds that don't require fixup.
|
||||
void fixupAfterMovingGC() {}
|
||||
|
||||
|
|
|
|||
|
|
@ -952,6 +952,12 @@ RegExpShared::RegExpShared(JSAtom* source, RegExpFlag flags)
|
|||
numNamedCaptures_(0), groupsTemplate_(nullptr)
|
||||
{}
|
||||
|
||||
RegExpShared::~RegExpShared()
|
||||
{
|
||||
for (size_t i = 0; i < tables.length(); i++)
|
||||
js_delete(tables[i]);
|
||||
}
|
||||
|
||||
void
|
||||
RegExpShared::traceChildren(JSTracer* trc)
|
||||
{
|
||||
|
|
@ -972,16 +978,6 @@ RegExpShared::discardJitCode()
|
|||
comp.jitCode = nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
RegExpShared::finalize(FreeOp* fop)
|
||||
{
|
||||
for (auto& comp : compilationArray)
|
||||
js_free(comp.byteCode);
|
||||
for (size_t i = 0; i < tables.length(); i++)
|
||||
js_free(tables[i]);
|
||||
tables.~JitCodeTables();
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
RegExpShared::compile(JSContext* cx, MutableHandleRegExpShared re, HandleLinearString input,
|
||||
CompilationMode mode, ForceByteCodeEnum force)
|
||||
|
|
|
|||
|
|
@ -121,6 +121,7 @@ class RegExpShared : public gc::TenuredCell
|
|||
uint8_t* byteCode;
|
||||
|
||||
RegExpCompilation() : byteCode(nullptr) {}
|
||||
~RegExpCompilation() { js_free(byteCode); }
|
||||
|
||||
bool compiled(ForceByteCodeEnum force = DontForceByteCode) const {
|
||||
return byteCode || (force == DontForceByteCode && jitCode);
|
||||
|
|
@ -148,8 +149,7 @@ class RegExpShared : public gc::TenuredCell
|
|||
}
|
||||
|
||||
// Tables referenced by JIT code.
|
||||
using JitCodeTables = Vector<uint8_t*, 0, SystemAllocPolicy>;
|
||||
JitCodeTables tables;
|
||||
Vector<uint8_t*, 0, SystemAllocPolicy> tables;
|
||||
|
||||
/* Internal functions. */
|
||||
RegExpShared(JSAtom* source, RegExpFlag flags);
|
||||
|
|
@ -172,7 +172,7 @@ class RegExpShared : public gc::TenuredCell
|
|||
}
|
||||
|
||||
public:
|
||||
~RegExpShared() = delete;
|
||||
~RegExpShared();
|
||||
|
||||
// Execute this RegExp on input starting from searchIndex, filling in
|
||||
// matches if specified and otherwise only determining if there is a match.
|
||||
|
|
@ -222,7 +222,6 @@ class RegExpShared : public gc::TenuredCell
|
|||
|
||||
void traceChildren(JSTracer* trc);
|
||||
void discardJitCode();
|
||||
void finalize(FreeOp* fop);
|
||||
|
||||
static size_t offsetOfSource() {
|
||||
return offsetof(RegExpShared, source);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue