mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 62a979cc89a2 due to risk (bug 614155).
This commit is contained in:
parent
76e3096daf
commit
369b6ada3c
@ -146,6 +146,9 @@ JSCompartment::init()
|
||||
return false;
|
||||
#endif
|
||||
|
||||
if (!toSourceCache.init())
|
||||
return false;
|
||||
|
||||
#if ENABLE_YARR_JIT
|
||||
regExpAllocator = JSC::ExecutableAllocator::create();
|
||||
if (!regExpAllocator)
|
||||
@ -547,7 +550,7 @@ JSCompartment::purge(JSContext *cx)
|
||||
js_DestroyScriptsToGC(cx, this);
|
||||
|
||||
nativeIterCache.purge();
|
||||
toSourceCache.destroyIfConstructed();
|
||||
toSourceCache.clear();
|
||||
|
||||
#ifdef JS_TRACER
|
||||
/*
|
||||
|
@ -442,8 +442,7 @@ struct JS_FRIEND_API(JSCompartment) {
|
||||
|
||||
js::NativeIterCache nativeIterCache;
|
||||
|
||||
typedef js::LazilyConstructed<js::ToSourceCache> LazyToSourceCache;
|
||||
LazyToSourceCache toSourceCache;
|
||||
js::ToSourceCache toSourceCache;
|
||||
|
||||
JSCompartment(JSRuntime *rt);
|
||||
~JSCompartment();
|
||||
|
@ -2044,8 +2044,8 @@ fun_toStringHelper(JSContext *cx, JSObject *obj, uintN indent)
|
||||
if (!fun)
|
||||
return NULL;
|
||||
|
||||
if (!indent && !cx->compartment->toSourceCache.empty()) {
|
||||
ToSourceCache::Ptr p = cx->compartment->toSourceCache.ref().lookup(fun);
|
||||
if (!indent) {
|
||||
ToSourceCache::Ptr p = cx->compartment->toSourceCache.lookup(fun);
|
||||
if (p)
|
||||
return p->value;
|
||||
}
|
||||
@ -2054,17 +2054,8 @@ fun_toStringHelper(JSContext *cx, JSObject *obj, uintN indent)
|
||||
if (!str)
|
||||
return false;
|
||||
|
||||
if (!indent) {
|
||||
LazilyConstructed<ToSourceCache> &lazy = cx->compartment->toSourceCache;
|
||||
|
||||
if (lazy.empty()) {
|
||||
lazy.construct();
|
||||
if (!lazy.ref().init())
|
||||
return false;
|
||||
}
|
||||
|
||||
lazy.ref().put(fun, str);
|
||||
}
|
||||
if (!indent)
|
||||
cx->compartment->toSourceCache.put(fun, str);
|
||||
|
||||
return str;
|
||||
}
|
||||
|
@ -311,9 +311,6 @@ class LazilyConstructed
|
||||
|
||||
T &asT() { return *storage.addr(); }
|
||||
|
||||
LazilyConstructed operator=(const LazilyConstructed &other);
|
||||
explicit LazilyConstructed(const LazilyConstructed &other);
|
||||
|
||||
public:
|
||||
LazilyConstructed() { constructed = false; }
|
||||
~LazilyConstructed() { if (constructed) asT().~T(); }
|
||||
@ -368,11 +365,6 @@ class LazilyConstructed
|
||||
ref().~T();
|
||||
constructed = false;
|
||||
}
|
||||
|
||||
void destroyIfConstructed() {
|
||||
if (!empty())
|
||||
destroy();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user