mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 2679510e9371 (bug 1013586) for Android jsreftest crashes.
CLOSED TREE
This commit is contained in:
parent
d6e7fee76e
commit
a75a5ec059
@ -435,8 +435,8 @@ RegExpObject::toString(JSContext *cx) const
|
||||
|
||||
/* RegExpShared */
|
||||
|
||||
RegExpShared::RegExpShared(JSCompartment *comp, JSAtom *source, RegExpFlag flags)
|
||||
: comp(comp), source(source), flags(flags), parenCount(0), canStringMatch(false), marked_(false)
|
||||
RegExpShared::RegExpShared(JSAtom *source, RegExpFlag flags)
|
||||
: source(source), flags(flags), parenCount(0), canStringMatch(false), marked_(false)
|
||||
{
|
||||
#ifdef JS_YARR
|
||||
bytecode = nullptr;
|
||||
@ -558,9 +558,6 @@ RegExpShared::compile(JSContext *cx, bool matchOnly, const jschar *sampleChars,
|
||||
bool
|
||||
RegExpShared::compile(JSContext *cx, HandleAtom pattern, bool matchOnly, const jschar *sampleChars, size_t sampleLength)
|
||||
{
|
||||
if (cx->compartment() != comp)
|
||||
MOZ_CRASH();
|
||||
|
||||
if (!ignoreCase() && !StringHasRegExpMetaChars(pattern->chars(), pattern->length())) {
|
||||
canStringMatch = true;
|
||||
parenCount = 0;
|
||||
@ -632,9 +629,6 @@ RegExpShared::compile(JSContext *cx, HandleAtom pattern, bool matchOnly, const j
|
||||
#ifdef JS_ION
|
||||
JS_ASSERT(!code.jitCode || !code.byteCode);
|
||||
jitCode = code.jitCode;
|
||||
|
||||
if (jitCode && jitCode->tenuredZone() != comp->zone())
|
||||
MOZ_CRASH();
|
||||
#endif
|
||||
|
||||
byteCode = code.byteCode;
|
||||
@ -976,9 +970,6 @@ RegExpCompartment::sweep(JSRuntime *rt)
|
||||
for (Set::Enum e(set_); !e.empty(); e.popFront()) {
|
||||
RegExpShared *shared = e.front();
|
||||
|
||||
if (this != &shared->compartment()->regExps)
|
||||
MOZ_CRASH();
|
||||
|
||||
// Sometimes RegExpShared instances are marked without the
|
||||
// compartment being subsequently cleared. This can happen if a GC is
|
||||
// restarted while in progress (i.e. performing a full GC in the
|
||||
@ -1011,9 +1002,6 @@ RegExpCompartment::sweep(JSRuntime *rt)
|
||||
bool
|
||||
RegExpCompartment::get(JSContext *cx, JSAtom *source, RegExpFlag flags, RegExpGuard *g)
|
||||
{
|
||||
if (this != &cx->compartment()->regExps)
|
||||
MOZ_CRASH();
|
||||
|
||||
Key key(source, flags);
|
||||
Set::AddPtr p = set_.lookupForAdd(key);
|
||||
if (p) {
|
||||
@ -1021,14 +1009,11 @@ RegExpCompartment::get(JSContext *cx, JSAtom *source, RegExpFlag flags, RegExpGu
|
||||
// from the table (which only holds weak references).
|
||||
MaybeTraceRegExpShared(cx, *p);
|
||||
|
||||
if ((*p)->compartment() != cx->compartment())
|
||||
MOZ_CRASH();
|
||||
|
||||
g->init(**p);
|
||||
return true;
|
||||
}
|
||||
|
||||
ScopedJSDeletePtr<RegExpShared> shared(cx->new_<RegExpShared>(cx->compartment(), source, flags));
|
||||
ScopedJSDeletePtr<RegExpShared> shared(cx->new_<RegExpShared>(source, flags));
|
||||
if (!shared)
|
||||
return false;
|
||||
|
||||
|
@ -122,8 +122,6 @@ class RegExpShared
|
||||
#endif
|
||||
#endif
|
||||
|
||||
JSCompartment *comp;
|
||||
|
||||
/* Source to the RegExp, for lazy compilation. */
|
||||
HeapPtrAtom source;
|
||||
|
||||
@ -163,7 +161,7 @@ class RegExpShared
|
||||
#endif
|
||||
|
||||
public:
|
||||
RegExpShared(JSCompartment *comp, JSAtom *source, RegExpFlag flags);
|
||||
RegExpShared(JSAtom *source, RegExpFlag flags);
|
||||
~RegExpShared();
|
||||
|
||||
#ifdef JS_YARR
|
||||
@ -202,10 +200,6 @@ class RegExpShared
|
||||
|
||||
/* Accessors */
|
||||
|
||||
JSCompartment *compartment() const {
|
||||
return comp;
|
||||
}
|
||||
|
||||
size_t getParenCount() const {
|
||||
JS_ASSERT(isCompiled(true) || isCompiled(false) || canStringMatch);
|
||||
return parenCount;
|
||||
@ -463,10 +457,6 @@ class RegExpObject : public JSObject
|
||||
|
||||
void setShared(RegExpShared &shared) {
|
||||
JS_ASSERT(!maybeShared());
|
||||
if (maybeShared())
|
||||
MOZ_CRASH();
|
||||
if (shared.compartment() != compartment())
|
||||
MOZ_CRASH();
|
||||
JSObject::setPrivate(&shared);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user