Source/JavaScriptCore/ChangeLog

 12019-06-27 Konstantin Tokarev <annulen@yandex.ru>
 2
 3 Use JSC_GLIB_API_ENABLED instead of USE(GLIB) as a compile-time check for GLib JSC API
 4 https://bugs.webkit.org/show_bug.cgi?id=199270
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 This change allows building code with enabled USE(GLIB) but without
 9 GLib JSC API.
 10
 11 * heap/Heap.cpp:
 12 (JSC::Heap::releaseDelayedReleasedObjects):
 13 * heap/Heap.h:
 14 * heap/HeapInlines.h:
 15
1162019-06-27 Devin Rousso <drousso@apple.com>
217
318 Web Inspector: throw an error if console.count/console.countReset is called with an object that throws an error from toString

Source/JavaScriptCore/heap/Heap.cpp

9696#include <wtf/spi/cocoa/objcSPI.h>
9797#endif
9898
99 #if USE(GLIB)
 99#ifdef JSC_GLIB_API_ENABLED
100100#include "JSCGLibWrapperObject.h"
101101#endif
102102

@@void Heap::lastChanceToFinalize()
477477
478478void Heap::releaseDelayedReleasedObjects()
479479{
480 #if USE(FOUNDATION) || USE(GLIB)
 480#if USE(FOUNDATION) || defined(JSC_GLIB_API_ENABLED)
481481 // We need to guard against the case that releasing an object can create more objects due to the
482482 // release calling into JS. When those JS call(s) exit and all locks are being dropped we end up
483483 // back here and could try to recursively release objects. We guard that with a recursive entry

Source/JavaScriptCore/heap/Heap.h

@@class VM;
8686class WeakGCMapBase;
8787struct CurrentThreadState;
8888
89 #if USE(GLIB)
 89#ifdef JSC_GLIB_API_ENABLED
9090class JSCGLibWrapperObject;
9191#endif
9292

@@public:
279279#if USE(FOUNDATION)
280280 template<typename T> void releaseSoon(RetainPtr<T>&&);
281281#endif
282 #if USE(GLIB)
 282#ifdef JSC_GLIB_API_ENABLED
283283 void releaseSoon(std::unique_ptr<JSCGLibWrapperObject>&&);
284284#endif
285285

@@private:
664664 Vector<RetainPtr<CFTypeRef>> m_delayedReleaseObjects;
665665 unsigned m_delayedReleaseRecursionCount { 0 };
666666#endif
667 #if USE(GLIB)
 667#ifdef JSC_GLIB_API_ENABLED
668668 Vector<std::unique_ptr<JSCGLibWrapperObject>> m_delayedReleaseObjects;
669669 unsigned m_delayedReleaseRecursionCount { 0 };
670670#endif

Source/JavaScriptCore/heap/HeapInlines.h

@@inline void Heap::releaseSoon(RetainPtr<T>&& object)
164164}
165165#endif
166166
167 #if USE(GLIB)
 167#ifdef JSC_GLIB_API_ENABLED
168168inline void Heap::releaseSoon(std::unique_ptr<JSCGLibWrapperObject>&& object)
169169{
170170 m_delayedReleaseObjects.append(WTFMove(object));