2013-01-28 00:35:12 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
2013-04-17 00:47:10 +04:00
|
|
|
* vim: set ts=8 sts=4 et sw=4 tw=99:
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2013-01-28 00:35:12 +04:00
|
|
|
|
2013-06-20 04:59:09 +04:00
|
|
|
#ifndef js_GCAPI_h
|
|
|
|
#define js_GCAPI_h
|
2013-01-28 00:35:12 +04:00
|
|
|
|
2016-12-23 00:43:42 +03:00
|
|
|
#include "mozilla/TimeStamp.h"
|
2015-04-22 19:43:02 +03:00
|
|
|
#include "mozilla/Vector.h"
|
|
|
|
|
2015-09-29 23:39:33 +03:00
|
|
|
#include "js/GCAnnotations.h"
|
2013-06-28 04:37:29 +04:00
|
|
|
#include "js/HeapAPI.h"
|
2016-01-16 03:26:06 +03:00
|
|
|
#include "js/UniquePtr.h"
|
2017-05-03 01:45:43 +03:00
|
|
|
#include "js/Utility.h"
|
2013-01-28 00:35:12 +04:00
|
|
|
|
2014-05-19 14:09:55 +04:00
|
|
|
namespace js {
|
|
|
|
namespace gc {
|
|
|
|
class GCRuntime;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace gc
|
2015-04-22 19:43:02 +03:00
|
|
|
namespace gcstats {
|
|
|
|
struct Statistics;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace gcstats
|
|
|
|
} // namespace js
|
2014-05-19 14:09:55 +04:00
|
|
|
|
2014-04-17 03:26:33 +04:00
|
|
|
typedef enum JSGCMode {
|
2015-10-17 20:27:16 +03:00
|
|
|
/** Perform only global GCs. */
|
2014-04-17 03:26:33 +04:00
|
|
|
JSGC_MODE_GLOBAL = 0,
|
|
|
|
|
2016-08-25 14:00:56 +03:00
|
|
|
/** Perform per-zone GCs until too much garbage has accumulated. */
|
|
|
|
JSGC_MODE_ZONE = 1,
|
2014-04-17 03:26:33 +04:00
|
|
|
|
2015-10-17 20:27:16 +03:00
|
|
|
/**
|
2014-04-17 03:26:33 +04:00
|
|
|
* Collect in short time slices rather than all at once. Implies
|
2016-08-25 14:00:56 +03:00
|
|
|
* JSGC_MODE_ZONE.
|
2014-04-17 03:26:33 +04:00
|
|
|
*/
|
|
|
|
JSGC_MODE_INCREMENTAL = 2
|
|
|
|
} JSGCMode;
|
|
|
|
|
2015-10-17 20:27:16 +03:00
|
|
|
/**
|
2015-01-02 20:19:43 +03:00
|
|
|
* Kinds of js_GC invocation.
|
|
|
|
*/
|
|
|
|
typedef enum JSGCInvocationKind {
|
|
|
|
/* Normal invocation. */
|
|
|
|
GC_NORMAL = 0,
|
|
|
|
|
|
|
|
/* Minimize GC triggers and release empty GC chunks right away. */
|
|
|
|
GC_SHRINK = 1
|
|
|
|
} JSGCInvocationKind;
|
|
|
|
|
2013-01-28 00:35:12 +04:00
|
|
|
namespace JS {
|
|
|
|
|
|
|
|
#define GCREASONS(D) \
|
|
|
|
/* Reasons internal to the JS engine */ \
|
|
|
|
D(API) \
|
2015-02-06 04:41:56 +03:00
|
|
|
D(EAGER_ALLOC_TRIGGER) \
|
2013-09-17 20:46:32 +04:00
|
|
|
D(DESTROY_RUNTIME) \
|
2017-07-11 19:17:17 +03:00
|
|
|
D(ROOTS_REMOVED) \
|
2013-01-28 00:35:12 +04:00
|
|
|
D(LAST_DITCH) \
|
|
|
|
D(TOO_MUCH_MALLOC) \
|
|
|
|
D(ALLOC_TRIGGER) \
|
|
|
|
D(DEBUG_GC) \
|
2014-06-17 22:20:33 +04:00
|
|
|
D(COMPARTMENT_REVIVED) \
|
2013-01-28 00:35:12 +04:00
|
|
|
D(RESET) \
|
2013-03-14 21:26:06 +04:00
|
|
|
D(OUT_OF_NURSERY) \
|
|
|
|
D(EVICT_NURSERY) \
|
2017-07-25 13:28:41 +03:00
|
|
|
D(DELAYED_ATOMS_GC) \
|
2014-10-24 20:37:31 +04:00
|
|
|
D(SHARED_MEMORY_LIMIT) \
|
2016-08-22 13:14:24 +03:00
|
|
|
D(UNUSED1) \
|
2015-02-07 00:26:15 +03:00
|
|
|
D(INCREMENTAL_TOO_SLOW) \
|
2015-04-13 18:42:41 +03:00
|
|
|
D(ABORT_GC) \
|
2017-07-17 12:54:12 +03:00
|
|
|
D(FULL_WHOLE_CELL_BUFFER) \
|
|
|
|
D(FULL_GENERIC_BUFFER) \
|
|
|
|
D(FULL_VALUE_BUFFER) \
|
|
|
|
D(FULL_CELL_PTR_BUFFER) \
|
|
|
|
D(FULL_SLOT_BUFFER) \
|
2017-07-17 12:54:12 +03:00
|
|
|
D(FULL_SHAPE_BUFFER) \
|
2013-03-14 21:26:06 +04:00
|
|
|
\
|
|
|
|
/* These are reserved for future use. */ \
|
|
|
|
D(RESERVED0) \
|
|
|
|
D(RESERVED1) \
|
|
|
|
D(RESERVED2) \
|
|
|
|
D(RESERVED3) \
|
|
|
|
D(RESERVED4) \
|
|
|
|
D(RESERVED5) \
|
|
|
|
D(RESERVED6) \
|
|
|
|
D(RESERVED7) \
|
|
|
|
D(RESERVED8) \
|
|
|
|
D(RESERVED9) \
|
2013-01-28 00:35:12 +04:00
|
|
|
\
|
|
|
|
/* Reasons from Firefox */ \
|
|
|
|
D(DOM_WINDOW_UTILS) \
|
|
|
|
D(COMPONENT_UTILS) \
|
|
|
|
D(MEM_PRESSURE) \
|
|
|
|
D(CC_WAITING) \
|
|
|
|
D(CC_FORCED) \
|
|
|
|
D(LOAD_END) \
|
|
|
|
D(POST_COMPARTMENT) \
|
|
|
|
D(PAGE_HIDE) \
|
|
|
|
D(NSJSCONTEXT_DESTROY) \
|
|
|
|
D(SET_NEW_DOCUMENT) \
|
|
|
|
D(SET_DOC_SHELL) \
|
|
|
|
D(DOM_UTILS) \
|
|
|
|
D(DOM_IPC) \
|
|
|
|
D(DOM_WORKER) \
|
|
|
|
D(INTER_SLICE_GC) \
|
|
|
|
D(REFRESH_FRAME) \
|
|
|
|
D(FULL_GC_TIMER) \
|
2013-03-19 04:37:24 +04:00
|
|
|
D(SHUTDOWN_CC) \
|
2017-05-24 21:14:31 +03:00
|
|
|
D(UNUSED2) \
|
2015-06-11 07:31:32 +03:00
|
|
|
D(USER_INACTIVE) \
|
2017-09-06 20:18:11 +03:00
|
|
|
D(XPCONNECT_SHUTDOWN) \
|
|
|
|
D(DOCSHELL) \
|
|
|
|
D(HTML_PARSER)
|
2013-01-28 00:35:12 +04:00
|
|
|
|
|
|
|
namespace gcreason {
|
|
|
|
|
|
|
|
/* GCReasons will end up looking like JSGC_MAYBEGC */
|
|
|
|
enum Reason {
|
|
|
|
#define MAKE_REASON(name) name,
|
|
|
|
GCREASONS(MAKE_REASON)
|
|
|
|
#undef MAKE_REASON
|
|
|
|
NO_REASON,
|
|
|
|
NUM_REASONS,
|
|
|
|
|
|
|
|
/*
|
|
|
|
* For telemetry, we want to keep a fixed max bucket size over time so we
|
|
|
|
* don't have to switch histograms. 100 is conservative; as of this writing
|
2014-11-13 16:43:17 +03:00
|
|
|
* there are 52. But the cost of extra buckets seems to be low while the
|
2013-01-28 00:35:12 +04:00
|
|
|
* cost of switching histograms is high.
|
|
|
|
*/
|
|
|
|
NUM_TELEMETRY_REASONS = 100
|
|
|
|
};
|
|
|
|
|
2016-01-19 23:48:22 +03:00
|
|
|
/**
|
|
|
|
* Get a statically allocated C string explaining the given GC reason.
|
|
|
|
*/
|
|
|
|
extern JS_PUBLIC_API(const char*)
|
|
|
|
ExplainReason(JS::gcreason::Reason reason);
|
|
|
|
|
2013-01-28 00:35:12 +04:00
|
|
|
} /* namespace gcreason */
|
|
|
|
|
2014-01-23 23:47:11 +04:00
|
|
|
/*
|
|
|
|
* Zone GC:
|
|
|
|
*
|
|
|
|
* SpiderMonkey's GC is capable of performing a collection on an arbitrary
|
|
|
|
* subset of the zones in the system. This allows an embedding to minimize
|
|
|
|
* collection time by only collecting zones that have run code recently,
|
|
|
|
* ignoring the parts of the heap that are unlikely to have changed.
|
|
|
|
*
|
|
|
|
* When triggering a GC using one of the functions below, it is first necessary
|
|
|
|
* to select the zones to be collected. To do this, you can call
|
|
|
|
* PrepareZoneForGC on each zone, or you can call PrepareForFullGC to select
|
|
|
|
* all zones. Failing to select any zone is an error.
|
|
|
|
*/
|
|
|
|
|
2015-10-17 20:27:16 +03:00
|
|
|
/**
|
2014-01-23 23:47:11 +04:00
|
|
|
* Schedule the given zone to be collected as part of the next GC.
|
|
|
|
*/
|
2015-01-05 16:22:53 +03:00
|
|
|
extern JS_PUBLIC_API(void)
|
2015-03-29 01:22:11 +03:00
|
|
|
PrepareZoneForGC(Zone* zone);
|
2013-01-28 00:35:12 +04:00
|
|
|
|
2015-10-17 20:27:16 +03:00
|
|
|
/**
|
2014-01-23 23:47:11 +04:00
|
|
|
* Schedule all zones to be collected in the next GC.
|
|
|
|
*/
|
2015-01-05 16:22:53 +03:00
|
|
|
extern JS_PUBLIC_API(void)
|
2016-07-07 10:55:41 +03:00
|
|
|
PrepareForFullGC(JSContext* cx);
|
2013-01-28 00:35:12 +04:00
|
|
|
|
2015-10-17 20:27:16 +03:00
|
|
|
/**
|
2014-01-23 23:47:11 +04:00
|
|
|
* When performing an incremental GC, the zones that were selected for the
|
|
|
|
* previous incremental slice must be selected in subsequent slices as well.
|
|
|
|
* This function selects those slices automatically.
|
|
|
|
*/
|
2015-01-05 16:22:53 +03:00
|
|
|
extern JS_PUBLIC_API(void)
|
2016-07-07 10:55:41 +03:00
|
|
|
PrepareForIncrementalGC(JSContext* cx);
|
2013-01-28 00:35:12 +04:00
|
|
|
|
2015-10-17 20:27:16 +03:00
|
|
|
/**
|
2014-01-23 23:47:11 +04:00
|
|
|
* Returns true if any zone in the system has been scheduled for GC with one of
|
|
|
|
* the functions above or by the JS engine.
|
|
|
|
*/
|
2015-01-05 16:22:53 +03:00
|
|
|
extern JS_PUBLIC_API(bool)
|
2016-07-07 10:55:41 +03:00
|
|
|
IsGCScheduled(JSContext* cx);
|
2013-01-28 00:35:12 +04:00
|
|
|
|
2015-10-17 20:27:16 +03:00
|
|
|
/**
|
2014-01-23 23:47:11 +04:00
|
|
|
* Undoes the effect of the Prepare methods above. The given zone will not be
|
|
|
|
* collected in the next GC.
|
|
|
|
*/
|
2015-01-05 16:22:53 +03:00
|
|
|
extern JS_PUBLIC_API(void)
|
2015-03-29 01:22:11 +03:00
|
|
|
SkipZoneForGC(Zone* zone);
|
2013-01-28 00:35:12 +04:00
|
|
|
|
|
|
|
/*
|
2014-01-23 23:47:11 +04:00
|
|
|
* Non-Incremental GC:
|
|
|
|
*
|
|
|
|
* The following functions perform a non-incremental GC.
|
2013-01-28 00:35:12 +04:00
|
|
|
*/
|
|
|
|
|
2015-10-17 20:27:16 +03:00
|
|
|
/**
|
2015-01-02 20:19:43 +03:00
|
|
|
* Performs a non-incremental collection of all selected zones.
|
|
|
|
*
|
|
|
|
* If the gckind argument is GC_NORMAL, then some objects that are unreachable
|
|
|
|
* from the program may still be alive afterwards because of internal
|
|
|
|
* references; if GC_SHRINK is passed then caches and other temporary references
|
|
|
|
* to objects will be cleared and all unreferenced objects will be removed from
|
|
|
|
* the system.
|
2014-01-23 23:47:11 +04:00
|
|
|
*/
|
2015-01-05 16:22:53 +03:00
|
|
|
extern JS_PUBLIC_API(void)
|
2016-07-07 10:55:41 +03:00
|
|
|
GCForReason(JSContext* cx, JSGCInvocationKind gckind, gcreason::Reason reason);
|
2013-01-28 00:35:12 +04:00
|
|
|
|
2014-01-23 23:47:11 +04:00
|
|
|
/*
|
|
|
|
* Incremental GC:
|
|
|
|
*
|
|
|
|
* Incremental GC divides the full mark-and-sweep collection into multiple
|
|
|
|
* slices, allowing client JavaScript code to run between each slice. This
|
|
|
|
* allows interactive apps to avoid long collection pauses. Incremental GC does
|
|
|
|
* not make collection take less time, it merely spreads that time out so that
|
|
|
|
* the pauses are less noticable.
|
|
|
|
*
|
|
|
|
* For a collection to be carried out incrementally the following conditions
|
|
|
|
* must be met:
|
|
|
|
* - The collection must be run by calling JS::IncrementalGC() rather than
|
|
|
|
* JS_GC().
|
|
|
|
* - The GC mode must have been set to JSGC_MODE_INCREMENTAL with
|
|
|
|
* JS_SetGCParameter().
|
|
|
|
*
|
|
|
|
* Note: Even if incremental GC is enabled and working correctly,
|
|
|
|
* non-incremental collections can still happen when low on memory.
|
|
|
|
*/
|
2013-01-28 00:35:12 +04:00
|
|
|
|
2015-10-17 20:27:16 +03:00
|
|
|
/**
|
2015-01-02 20:19:43 +03:00
|
|
|
* Begin an incremental collection and perform one slice worth of work. When
|
|
|
|
* this function returns, the collection may not be complete.
|
|
|
|
* IncrementalGCSlice() must be called repeatedly until
|
2016-07-07 10:55:45 +03:00
|
|
|
* !IsIncrementalGCInProgress(cx).
|
2014-01-23 23:47:11 +04:00
|
|
|
*
|
|
|
|
* Note: SpiderMonkey's GC is not realtime. Slices in practice may be longer or
|
|
|
|
* shorter than the requested interval.
|
|
|
|
*/
|
2015-01-05 16:22:53 +03:00
|
|
|
extern JS_PUBLIC_API(void)
|
2016-07-07 10:55:45 +03:00
|
|
|
StartIncrementalGC(JSContext* cx, JSGCInvocationKind gckind, gcreason::Reason reason,
|
2015-01-02 20:19:43 +03:00
|
|
|
int64_t millis = 0);
|
2015-01-02 20:19:43 +03:00
|
|
|
|
2015-10-17 20:27:16 +03:00
|
|
|
/**
|
2015-01-02 20:19:43 +03:00
|
|
|
* Perform a slice of an ongoing incremental collection. When this function
|
|
|
|
* returns, the collection may not be complete. It must be called repeatedly
|
2016-07-07 10:55:45 +03:00
|
|
|
* until !IsIncrementalGCInProgress(cx).
|
2015-01-02 20:19:43 +03:00
|
|
|
*
|
|
|
|
* Note: SpiderMonkey's GC is not realtime. Slices in practice may be longer or
|
|
|
|
* shorter than the requested interval.
|
|
|
|
*/
|
2015-01-05 16:22:53 +03:00
|
|
|
extern JS_PUBLIC_API(void)
|
2016-07-07 10:55:45 +03:00
|
|
|
IncrementalGCSlice(JSContext* cx, gcreason::Reason reason, int64_t millis = 0);
|
2013-01-28 00:35:12 +04:00
|
|
|
|
2015-10-17 20:27:16 +03:00
|
|
|
/**
|
2016-07-07 10:55:45 +03:00
|
|
|
* If IsIncrementalGCInProgress(cx), this call finishes the ongoing collection
|
|
|
|
* by performing an arbitrarily long slice. If !IsIncrementalGCInProgress(cx),
|
2014-01-23 23:47:11 +04:00
|
|
|
* this is equivalent to GCForReason. When this function returns,
|
2016-07-07 10:55:45 +03:00
|
|
|
* IsIncrementalGCInProgress(cx) will always be false.
|
2014-01-23 23:47:11 +04:00
|
|
|
*/
|
2015-01-05 16:22:53 +03:00
|
|
|
extern JS_PUBLIC_API(void)
|
2016-07-07 10:55:45 +03:00
|
|
|
FinishIncrementalGC(JSContext* cx, gcreason::Reason reason);
|
2013-01-28 00:35:12 +04:00
|
|
|
|
2015-10-17 20:27:16 +03:00
|
|
|
/**
|
2016-07-07 10:55:45 +03:00
|
|
|
* If IsIncrementalGCInProgress(cx), this call aborts the ongoing collection and
|
2015-04-13 18:42:41 +03:00
|
|
|
* performs whatever work needs to be done to return the collector to its idle
|
|
|
|
* state. This may take an arbitrarily long time. When this function returns,
|
2016-07-07 10:55:45 +03:00
|
|
|
* IsIncrementalGCInProgress(cx) will always be false.
|
2015-04-13 18:42:41 +03:00
|
|
|
*/
|
|
|
|
extern JS_PUBLIC_API(void)
|
2016-07-07 10:55:45 +03:00
|
|
|
AbortIncrementalGC(JSContext* cx);
|
2015-04-13 18:42:41 +03:00
|
|
|
|
2015-04-22 19:43:02 +03:00
|
|
|
namespace dbg {
|
|
|
|
|
|
|
|
// The `JS::dbg::GarbageCollectionEvent` class is essentially a view of the
|
|
|
|
// `js::gcstats::Statistics` data without the uber implementation-specific bits.
|
|
|
|
// It should generally be palatable for web developers.
|
|
|
|
class GarbageCollectionEvent
|
|
|
|
{
|
|
|
|
// The major GC number of the GC cycle this data pertains to.
|
|
|
|
uint64_t majorGCNumber_;
|
|
|
|
|
|
|
|
// Reference to a non-owned, statically allocated C string. This is a very
|
|
|
|
// short reason explaining why a GC was triggered.
|
|
|
|
const char* reason;
|
|
|
|
|
|
|
|
// Reference to a nullable, non-owned, statically allocated C string. If the
|
|
|
|
// collection was forced to be non-incremental, this is a short reason of
|
|
|
|
// why the GC could not perform an incremental collection.
|
|
|
|
const char* nonincrementalReason;
|
|
|
|
|
|
|
|
// Represents a single slice of a possibly multi-slice incremental garbage
|
|
|
|
// collection.
|
|
|
|
struct Collection {
|
2016-12-23 00:43:42 +03:00
|
|
|
mozilla::TimeStamp startTimestamp;
|
|
|
|
mozilla::TimeStamp endTimestamp;
|
2015-04-22 19:43:02 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
// The set of garbage collection slices that made up this GC cycle.
|
|
|
|
mozilla::Vector<Collection> collections;
|
|
|
|
|
|
|
|
GarbageCollectionEvent(const GarbageCollectionEvent& rhs) = delete;
|
|
|
|
GarbageCollectionEvent& operator=(const GarbageCollectionEvent& rhs) = delete;
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit GarbageCollectionEvent(uint64_t majorGCNum)
|
|
|
|
: majorGCNumber_(majorGCNum)
|
|
|
|
, reason(nullptr)
|
|
|
|
, nonincrementalReason(nullptr)
|
|
|
|
, collections()
|
|
|
|
{ }
|
|
|
|
|
2016-01-16 03:26:06 +03:00
|
|
|
using Ptr = js::UniquePtr<GarbageCollectionEvent>;
|
2015-04-22 19:43:02 +03:00
|
|
|
static Ptr Create(JSRuntime* rt, ::js::gcstats::Statistics& stats, uint64_t majorGCNumber);
|
|
|
|
|
|
|
|
JSObject* toJSObject(JSContext* cx) const;
|
|
|
|
|
|
|
|
uint64_t majorGCNumber() const { return majorGCNumber_; }
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dbg
|
|
|
|
|
2013-01-28 00:35:12 +04:00
|
|
|
enum GCProgress {
|
|
|
|
/*
|
2017-05-15 18:06:24 +03:00
|
|
|
* During GC, the GC is bracketed by GC_CYCLE_BEGIN/END callbacks. Each
|
|
|
|
* slice between those (whether an incremental or the sole non-incremental
|
|
|
|
* slice) is bracketed by GC_SLICE_BEGIN/GC_SLICE_END.
|
2013-01-28 00:35:12 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
GC_CYCLE_BEGIN,
|
|
|
|
GC_SLICE_BEGIN,
|
|
|
|
GC_SLICE_END,
|
|
|
|
GC_CYCLE_END
|
|
|
|
};
|
|
|
|
|
2015-01-05 16:22:53 +03:00
|
|
|
struct JS_PUBLIC_API(GCDescription) {
|
2016-08-25 14:00:56 +03:00
|
|
|
bool isZone_;
|
2017-05-13 02:46:43 +03:00
|
|
|
bool isComplete_;
|
2015-02-18 15:35:05 +03:00
|
|
|
JSGCInvocationKind invocationKind_;
|
2015-06-11 07:31:31 +03:00
|
|
|
gcreason::Reason reason_;
|
2013-01-28 00:35:12 +04:00
|
|
|
|
2017-05-13 02:46:43 +03:00
|
|
|
GCDescription(bool isZone, bool isComplete, JSGCInvocationKind kind, gcreason::Reason reason)
|
|
|
|
: isZone_(isZone), isComplete_(isComplete), invocationKind_(kind), reason_(reason) {}
|
2013-01-28 00:35:12 +04:00
|
|
|
|
2016-07-23 20:52:47 +03:00
|
|
|
char16_t* formatSliceMessage(JSContext* cx) const;
|
|
|
|
char16_t* formatSummaryMessage(JSContext* cx) const;
|
|
|
|
char16_t* formatJSON(JSContext* cx, uint64_t timestamp) const;
|
2015-04-22 19:43:02 +03:00
|
|
|
|
2017-05-03 01:45:43 +03:00
|
|
|
mozilla::TimeStamp startTime(JSContext* cx) const;
|
|
|
|
mozilla::TimeStamp endTime(JSContext* cx) const;
|
|
|
|
mozilla::TimeStamp lastSliceStart(JSContext* cx) const;
|
|
|
|
mozilla::TimeStamp lastSliceEnd(JSContext* cx) const;
|
|
|
|
|
|
|
|
JS::UniqueChars sliceToJSON(JSContext* cx) const;
|
|
|
|
JS::UniqueChars summaryToJSON(JSContext* cx) const;
|
|
|
|
|
2016-07-23 20:52:47 +03:00
|
|
|
JS::dbg::GarbageCollectionEvent::Ptr toGCEvent(JSContext* cx) const;
|
2013-01-28 00:35:12 +04:00
|
|
|
};
|
|
|
|
|
2017-04-25 23:24:34 +03:00
|
|
|
extern JS_PUBLIC_API(UniqueChars)
|
|
|
|
MinorGcToJSON(JSContext* cx);
|
|
|
|
|
2013-01-28 00:35:12 +04:00
|
|
|
typedef void
|
2016-07-23 20:52:47 +03:00
|
|
|
(* GCSliceCallback)(JSContext* cx, GCProgress progress, const GCDescription& desc);
|
2013-01-28 00:35:12 +04:00
|
|
|
|
2015-10-17 20:27:16 +03:00
|
|
|
/**
|
2014-01-23 23:47:11 +04:00
|
|
|
* The GC slice callback is called at the beginning and end of each slice. This
|
|
|
|
* callback may be used for GC notifications as well as to perform additional
|
|
|
|
* marking.
|
|
|
|
*/
|
2015-01-05 16:22:53 +03:00
|
|
|
extern JS_PUBLIC_API(GCSliceCallback)
|
2016-07-07 10:55:45 +03:00
|
|
|
SetGCSliceCallback(JSContext* cx, GCSliceCallback callback);
|
2013-01-28 00:35:12 +04:00
|
|
|
|
2016-01-19 23:48:22 +03:00
|
|
|
/**
|
|
|
|
* Describes the progress of an observed nursery collection.
|
|
|
|
*/
|
|
|
|
enum class GCNurseryProgress {
|
|
|
|
/**
|
|
|
|
* The nursery collection is starting.
|
|
|
|
*/
|
|
|
|
GC_NURSERY_COLLECTION_START,
|
|
|
|
/**
|
|
|
|
* The nursery collection is ending.
|
|
|
|
*/
|
|
|
|
GC_NURSERY_COLLECTION_END
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A nursery collection callback receives the progress of the nursery collection
|
|
|
|
* and the reason for the collection.
|
|
|
|
*/
|
2016-07-23 20:52:47 +03:00
|
|
|
using GCNurseryCollectionCallback = void(*)(JSContext* cx, GCNurseryProgress progress,
|
2016-01-19 23:48:22 +03:00
|
|
|
gcreason::Reason reason);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the nursery collection callback for the given runtime. When set, it will
|
|
|
|
* be called at the start and end of every nursery collection.
|
|
|
|
*/
|
|
|
|
extern JS_PUBLIC_API(GCNurseryCollectionCallback)
|
2016-07-07 10:55:45 +03:00
|
|
|
SetGCNurseryCollectionCallback(JSContext* cx, GCNurseryCollectionCallback callback);
|
2016-01-19 23:48:22 +03:00
|
|
|
|
2016-08-18 23:30:32 +03:00
|
|
|
typedef void
|
|
|
|
(* DoCycleCollectionCallback)(JSContext* cx);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The purge gray callback is called after any COMPARTMENT_REVIVED GC in which
|
|
|
|
* the majority of compartments have been marked gray.
|
|
|
|
*/
|
|
|
|
extern JS_PUBLIC_API(DoCycleCollectionCallback)
|
|
|
|
SetDoCycleCollectionCallback(JSContext* cx, DoCycleCollectionCallback callback);
|
|
|
|
|
2015-10-17 20:27:16 +03:00
|
|
|
/**
|
2014-01-23 23:47:11 +04:00
|
|
|
* Incremental GC defaults to enabled, but may be disabled for testing or in
|
|
|
|
* embeddings that have not yet implemented barriers on their native classes.
|
|
|
|
* There is not currently a way to re-enable incremental GC once it has been
|
|
|
|
* disabled on the runtime.
|
2013-01-28 00:35:12 +04:00
|
|
|
*/
|
2015-01-05 16:22:53 +03:00
|
|
|
extern JS_PUBLIC_API(void)
|
2016-07-07 10:56:09 +03:00
|
|
|
DisableIncrementalGC(JSContext* cx);
|
2013-01-28 00:35:12 +04:00
|
|
|
|
2015-10-17 20:27:16 +03:00
|
|
|
/**
|
2014-01-23 23:47:11 +04:00
|
|
|
* Returns true if incremental GC is enabled. Simply having incremental GC
|
|
|
|
* enabled is not sufficient to ensure incremental collections are happening.
|
|
|
|
* See the comment "Incremental GC" above for reasons why incremental GC may be
|
|
|
|
* suppressed. Inspection of the "nonincremental reason" field of the
|
|
|
|
* GCDescription returned by GCSliceCallback may help narrow down the cause if
|
|
|
|
* collections are not happening incrementally when expected.
|
|
|
|
*/
|
2015-01-05 16:22:53 +03:00
|
|
|
extern JS_PUBLIC_API(bool)
|
2016-07-07 10:56:09 +03:00
|
|
|
IsIncrementalGCEnabled(JSContext* cx);
|
2013-01-28 00:35:12 +04:00
|
|
|
|
2015-10-17 20:27:16 +03:00
|
|
|
/**
|
2014-01-23 23:47:11 +04:00
|
|
|
* Returns true while an incremental GC is ongoing, both when actively
|
|
|
|
* collecting and between slices.
|
|
|
|
*/
|
2015-01-05 16:22:53 +03:00
|
|
|
extern JS_PUBLIC_API(bool)
|
2016-07-07 10:56:09 +03:00
|
|
|
IsIncrementalGCInProgress(JSContext* cx);
|
2013-01-28 00:35:12 +04:00
|
|
|
|
2017-04-24 05:30:06 +03:00
|
|
|
/**
|
|
|
|
* Returns true while an incremental GC is ongoing, both when actively
|
|
|
|
* collecting and between slices.
|
|
|
|
*/
|
|
|
|
extern JS_PUBLIC_API(bool)
|
|
|
|
IsIncrementalGCInProgress(JSRuntime* rt);
|
|
|
|
|
2014-01-23 23:47:11 +04:00
|
|
|
/*
|
2017-02-13 14:11:09 +03:00
|
|
|
* Returns true when writes to GC thing pointers (and reads from weak pointers)
|
|
|
|
* must call an incremental barrier. This is generally only true when running
|
|
|
|
* mutator code in-between GC slices. At other times, the barrier may be elided
|
|
|
|
* for performance.
|
2014-01-23 23:47:11 +04:00
|
|
|
*/
|
2015-01-05 16:22:53 +03:00
|
|
|
extern JS_PUBLIC_API(bool)
|
2016-07-07 10:56:09 +03:00
|
|
|
IsIncrementalBarrierNeeded(JSContext* cx);
|
2013-01-28 00:35:12 +04:00
|
|
|
|
2014-01-23 23:47:11 +04:00
|
|
|
/*
|
2017-02-13 14:11:09 +03:00
|
|
|
* Notify the GC that a reference to a JSObject is about to be overwritten.
|
|
|
|
* This method must be called if IsIncrementalBarrierNeeded.
|
2014-01-23 23:47:11 +04:00
|
|
|
*/
|
2015-01-05 16:22:53 +03:00
|
|
|
extern JS_PUBLIC_API(void)
|
2017-02-13 14:11:09 +03:00
|
|
|
IncrementalPreWriteBarrier(JSObject* obj);
|
2013-01-28 00:35:12 +04:00
|
|
|
|
2017-02-13 14:11:09 +03:00
|
|
|
/*
|
|
|
|
* Notify the GC that a weak reference to a GC thing has been read.
|
|
|
|
* This method must be called if IsIncrementalBarrierNeeded.
|
|
|
|
*/
|
2015-01-05 16:22:53 +03:00
|
|
|
extern JS_PUBLIC_API(void)
|
2017-02-13 14:11:09 +03:00
|
|
|
IncrementalReadBarrier(GCCellPtr thing);
|
2013-01-29 06:25:23 +04:00
|
|
|
|
2015-10-17 20:27:16 +03:00
|
|
|
/**
|
2014-01-23 23:47:11 +04:00
|
|
|
* Returns true if the most recent GC ran incrementally.
|
|
|
|
*/
|
2015-01-05 16:22:53 +03:00
|
|
|
extern JS_PUBLIC_API(bool)
|
2017-04-24 05:30:06 +03:00
|
|
|
WasIncrementalGC(JSRuntime* rt);
|
2014-01-23 23:47:11 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Generational GC:
|
|
|
|
*
|
2014-02-25 03:08:05 +04:00
|
|
|
* Note: Generational GC is not yet enabled by default. The following class
|
|
|
|
* is non-functional unless SpiderMonkey was configured with
|
2014-01-23 23:47:11 +04:00
|
|
|
* --enable-gcgenerational.
|
|
|
|
*/
|
|
|
|
|
2015-10-17 20:27:16 +03:00
|
|
|
/** Ensure that generational GC is disabled within some scope. */
|
2015-01-05 16:22:53 +03:00
|
|
|
class JS_PUBLIC_API(AutoDisableGenerationalGC)
|
2014-02-22 03:54:25 +04:00
|
|
|
{
|
2017-02-02 22:12:43 +03:00
|
|
|
JSContext* cx;
|
2014-02-22 03:54:25 +04:00
|
|
|
|
|
|
|
public:
|
2017-02-02 22:12:43 +03:00
|
|
|
explicit AutoDisableGenerationalGC(JSContext* cx);
|
2014-02-25 03:08:05 +04:00
|
|
|
~AutoDisableGenerationalGC();
|
2014-02-22 03:54:25 +04:00
|
|
|
};
|
|
|
|
|
2015-10-17 20:27:16 +03:00
|
|
|
/**
|
2014-01-23 23:47:11 +04:00
|
|
|
* Returns true if generational allocation and collection is currently enabled
|
|
|
|
* on the given runtime.
|
|
|
|
*/
|
2015-01-05 16:22:53 +03:00
|
|
|
extern JS_PUBLIC_API(bool)
|
2015-03-29 01:22:11 +03:00
|
|
|
IsGenerationalGCEnabled(JSRuntime* rt);
|
2013-01-28 00:35:12 +04:00
|
|
|
|
2015-10-17 20:27:16 +03:00
|
|
|
/**
|
2014-01-23 23:47:11 +04:00
|
|
|
* Returns the GC's "number". This does not correspond directly to the number
|
|
|
|
* of GCs that have been run, but is guaranteed to be monotonically increasing
|
|
|
|
* with GC activity.
|
|
|
|
*/
|
2015-01-05 16:22:53 +03:00
|
|
|
extern JS_PUBLIC_API(size_t)
|
2013-09-17 21:50:03 +04:00
|
|
|
GetGCNumber();
|
|
|
|
|
2015-10-17 20:27:16 +03:00
|
|
|
/**
|
2016-10-06 02:04:31 +03:00
|
|
|
* Pass a subclass of this "abstract" class to callees to require that they
|
|
|
|
* never GC. Subclasses can use assertions or the hazard analysis to ensure no
|
|
|
|
* GC happens.
|
2014-05-29 04:34:36 +04:00
|
|
|
*/
|
2016-10-06 02:04:31 +03:00
|
|
|
class JS_PUBLIC_API(AutoRequireNoGC)
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
AutoRequireNoGC() {}
|
|
|
|
~AutoRequireNoGC() {}
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2016-10-27 13:03:53 +03:00
|
|
|
* Diagnostic assert (see MOZ_DIAGNOSTIC_ASSERT) that GC cannot occur while this
|
|
|
|
* class is live. This class does not disable the static rooting hazard
|
|
|
|
* analysis.
|
|
|
|
*
|
|
|
|
* This works by entering a GC unsafe region, which is checked on allocation and
|
|
|
|
* on GC.
|
2016-10-06 02:04:31 +03:00
|
|
|
*/
|
2016-10-27 13:03:53 +03:00
|
|
|
class JS_PUBLIC_API(AutoAssertNoGC) : public AutoRequireNoGC
|
2014-05-29 04:34:36 +04:00
|
|
|
{
|
2017-02-02 22:12:43 +03:00
|
|
|
JSContext* cx_;
|
2014-05-29 04:34:36 +04:00
|
|
|
|
|
|
|
public:
|
2017-09-01 12:13:51 +03:00
|
|
|
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
|
|
|
|
// This gets the context from TLS if it is not passed in.
|
2017-02-02 22:12:43 +03:00
|
|
|
explicit AutoAssertNoGC(JSContext* cx = nullptr);
|
2016-10-27 13:03:53 +03:00
|
|
|
~AutoAssertNoGC();
|
2017-08-01 11:42:04 +03:00
|
|
|
#else
|
2017-09-01 12:13:51 +03:00
|
|
|
explicit AutoAssertNoGC(JSContext* cx = nullptr) {}
|
|
|
|
~AutoAssertNoGC() {}
|
2017-08-01 11:42:04 +03:00
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
2015-10-17 20:27:16 +03:00
|
|
|
/**
|
2017-09-01 12:13:51 +03:00
|
|
|
* Disable the static rooting hazard analysis in the live region and assert in
|
|
|
|
* debug builds if any allocation that could potentially trigger a GC occurs
|
|
|
|
* while this guard object is live. This is most useful to help the exact
|
|
|
|
* rooting hazard analysis in complex regions, since it cannot understand
|
|
|
|
* dataflow.
|
2014-01-23 23:47:11 +04:00
|
|
|
*
|
2014-10-18 03:57:52 +04:00
|
|
|
* Note: GC behavior is unpredictable even when deterministic and is generally
|
2014-01-23 23:47:11 +04:00
|
|
|
* non-deterministic in practice. The fact that this guard has not
|
|
|
|
* asserted is not a guarantee that a GC cannot happen in the guarded
|
|
|
|
* region. As a rule, anyone performing a GC unsafe action should
|
|
|
|
* understand the GC properties of all code in that region and ensure
|
|
|
|
* that the hazard analysis is correct for that code, rather than relying
|
|
|
|
* on this class.
|
|
|
|
*/
|
2017-09-01 12:13:51 +03:00
|
|
|
#ifdef DEBUG
|
|
|
|
class JS_PUBLIC_API(AutoSuppressGCAnalysis) : public AutoAssertNoGC
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit AutoSuppressGCAnalysis(JSContext* cx = nullptr) : AutoAssertNoGC(cx) {}
|
|
|
|
} JS_HAZ_GC_SUPPRESSED;
|
|
|
|
#else
|
|
|
|
class JS_PUBLIC_API(AutoSuppressGCAnalysis) : public AutoRequireNoGC
|
2014-09-19 12:57:11 +04:00
|
|
|
{
|
|
|
|
public:
|
2017-09-01 12:13:51 +03:00
|
|
|
explicit AutoSuppressGCAnalysis(JSContext* cx = nullptr) {}
|
2016-05-19 22:53:29 +03:00
|
|
|
} JS_HAZ_GC_SUPPRESSED;
|
2017-09-01 12:13:51 +03:00
|
|
|
#endif
|
2014-09-19 12:57:11 +04:00
|
|
|
|
2015-10-17 20:27:16 +03:00
|
|
|
/**
|
2014-09-19 12:57:11 +04:00
|
|
|
* Assert that code is only ever called from a GC callback, disable the static
|
|
|
|
* rooting hazard analysis and assert if any allocation that could potentially
|
|
|
|
* trigger a GC occurs while this guard object is live.
|
|
|
|
*
|
|
|
|
* This is useful to make the static analysis ignore code that runs in GC
|
|
|
|
* callbacks.
|
|
|
|
*/
|
|
|
|
class JS_PUBLIC_API(AutoAssertGCCallback) : public AutoSuppressGCAnalysis
|
2013-11-06 03:02:35 +04:00
|
|
|
{
|
|
|
|
public:
|
2017-04-25 12:56:34 +03:00
|
|
|
#ifdef DEBUG
|
|
|
|
AutoAssertGCCallback();
|
|
|
|
#else
|
|
|
|
AutoAssertGCCallback() {}
|
|
|
|
#endif
|
2014-05-29 04:34:36 +04:00
|
|
|
};
|
|
|
|
|
2015-10-17 20:27:16 +03:00
|
|
|
/**
|
2014-05-29 04:34:36 +04:00
|
|
|
* Place AutoCheckCannotGC in scopes that you believe can never GC. These
|
2016-10-27 13:03:53 +03:00
|
|
|
* annotations will be verified both dynamically via AutoAssertNoGC, and
|
2014-05-29 04:34:36 +04:00
|
|
|
* statically with the rooting hazard analysis (implemented by making the
|
|
|
|
* analysis consider AutoCheckCannotGC to be a GC pointer, and therefore
|
|
|
|
* complain if it is live across a GC call.) It is useful when dealing with
|
|
|
|
* internal pointers to GC things where the GC thing itself may not be present
|
|
|
|
* for the static analysis: e.g. acquiring inline chars from a JSString* on the
|
|
|
|
* heap.
|
2016-10-06 02:04:31 +03:00
|
|
|
*
|
|
|
|
* We only do the assertion checking in DEBUG builds.
|
2014-05-29 04:34:36 +04:00
|
|
|
*/
|
2016-10-06 02:04:31 +03:00
|
|
|
#ifdef DEBUG
|
2016-10-27 13:03:53 +03:00
|
|
|
class JS_PUBLIC_API(AutoCheckCannotGC) : public AutoAssertNoGC
|
2014-05-29 04:34:36 +04:00
|
|
|
{
|
2014-05-29 21:26:55 +04:00
|
|
|
public:
|
2017-02-02 22:12:43 +03:00
|
|
|
explicit AutoCheckCannotGC(JSContext* cx = nullptr) : AutoAssertNoGC(cx) {}
|
2015-09-29 23:39:33 +03:00
|
|
|
} JS_HAZ_GC_INVALIDATED;
|
2016-10-06 02:04:31 +03:00
|
|
|
#else
|
|
|
|
class JS_PUBLIC_API(AutoCheckCannotGC) : public AutoRequireNoGC
|
|
|
|
{
|
|
|
|
public:
|
2017-02-02 22:12:43 +03:00
|
|
|
explicit AutoCheckCannotGC(JSContext* cx = nullptr) {}
|
2016-10-06 02:04:31 +03:00
|
|
|
} JS_HAZ_GC_INVALIDATED;
|
|
|
|
#endif
|
2013-09-17 21:50:03 +04:00
|
|
|
|
2015-10-17 20:27:16 +03:00
|
|
|
/**
|
2013-01-28 00:35:12 +04:00
|
|
|
* Unsets the gray bit for anything reachable from |thing|. |kind| should not be
|
2016-05-09 04:17:26 +03:00
|
|
|
* JS::TraceKind::Shape. |thing| should be non-null. The return value indicates
|
|
|
|
* if anything was unmarked.
|
2013-01-28 00:35:12 +04:00
|
|
|
*/
|
2013-08-19 17:48:35 +04:00
|
|
|
extern JS_FRIEND_API(bool)
|
2014-12-05 20:38:33 +03:00
|
|
|
UnmarkGrayGCThingRecursively(GCCellPtr thing);
|
2013-01-28 00:35:12 +04:00
|
|
|
|
2014-07-31 23:14:17 +04:00
|
|
|
} /* namespace JS */
|
|
|
|
|
|
|
|
namespace js {
|
|
|
|
namespace gc {
|
|
|
|
|
2014-01-25 08:14:56 +04:00
|
|
|
static MOZ_ALWAYS_INLINE void
|
2014-05-20 01:58:05 +04:00
|
|
|
ExposeGCThingToActiveJS(JS::GCCellPtr thing)
|
2013-01-28 00:35:12 +04:00
|
|
|
{
|
2016-11-04 20:32:36 +03:00
|
|
|
// GC things residing in the nursery cannot be gray: they have no mark bits.
|
|
|
|
// All live objects in the nursery are moved to tenured at the beginning of
|
|
|
|
// each GC slice, so the gray marker never sees nursery things.
|
2014-12-02 09:34:25 +03:00
|
|
|
if (IsInsideNursery(thing.asCell()))
|
2013-04-02 02:31:49 +04:00
|
|
|
return;
|
2016-11-04 20:32:36 +03:00
|
|
|
|
|
|
|
// There's nothing to do for permanent GC things that might be owned by
|
|
|
|
// another runtime.
|
|
|
|
if (thing.mayBeOwnedByOtherRuntime())
|
|
|
|
return;
|
|
|
|
|
2017-02-02 22:12:43 +03:00
|
|
|
if (IsIncrementalBarrierNeededOnTenuredGCThing(thing))
|
2017-02-13 14:11:09 +03:00
|
|
|
JS::IncrementalReadBarrier(thing);
|
2017-04-25 16:07:55 +03:00
|
|
|
else if (js::gc::detail::TenuredCellIsMarkedGray(thing.asCell()))
|
2014-12-05 20:38:33 +03:00
|
|
|
JS::UnmarkGrayGCThingRecursively(thing);
|
2017-02-13 14:11:09 +03:00
|
|
|
|
2017-04-25 16:07:55 +03:00
|
|
|
MOZ_ASSERT(!js::gc::detail::TenuredCellIsMarkedGray(thing.asCell()));
|
2013-01-28 00:35:12 +04:00
|
|
|
}
|
|
|
|
|
2017-04-26 13:18:39 +03:00
|
|
|
template <typename T>
|
|
|
|
extern JS_PUBLIC_API(bool)
|
|
|
|
EdgeNeedsSweepUnbarrieredSlow(T* thingp);
|
|
|
|
|
|
|
|
static MOZ_ALWAYS_INLINE bool
|
|
|
|
EdgeNeedsSweepUnbarriered(JSObject** objp)
|
|
|
|
{
|
|
|
|
// This function does not handle updating nursery pointers. Raw JSObject
|
|
|
|
// pointers should be updated separately or replaced with
|
|
|
|
// JS::Heap<JSObject*> which handles this automatically.
|
|
|
|
MOZ_ASSERT(!JS::CurrentThreadIsHeapMinorCollecting());
|
|
|
|
if (IsInsideNursery(reinterpret_cast<Cell*>(*objp)))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
auto zone = JS::shadow::Zone::asShadowZone(detail::GetGCThingZone(uintptr_t(*objp)));
|
|
|
|
if (!zone->isGCSweepingOrCompacting())
|
|
|
|
return false;
|
|
|
|
|
|
|
|
return EdgeNeedsSweepUnbarrieredSlow(objp);
|
|
|
|
}
|
|
|
|
|
2014-07-31 23:14:17 +04:00
|
|
|
} /* namespace gc */
|
|
|
|
} /* namespace js */
|
|
|
|
|
|
|
|
namespace JS {
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This should be called when an object that is marked gray is exposed to the JS
|
|
|
|
* engine (by handing it to running JS code or writing it into live JS
|
|
|
|
* data). During incremental GC, since the gray bits haven't been computed yet,
|
|
|
|
* we conservatively mark the object black.
|
|
|
|
*/
|
2014-01-25 08:14:56 +04:00
|
|
|
static MOZ_ALWAYS_INLINE void
|
2015-03-29 01:22:11 +03:00
|
|
|
ExposeObjectToActiveJS(JSObject* obj)
|
2013-09-09 07:28:48 +04:00
|
|
|
{
|
2016-09-29 12:18:50 +03:00
|
|
|
MOZ_ASSERT(obj);
|
2017-04-26 13:18:39 +03:00
|
|
|
MOZ_ASSERT(!js::gc::EdgeNeedsSweepUnbarrieredSlow(&obj));
|
2014-05-20 01:58:05 +04:00
|
|
|
js::gc::ExposeGCThingToActiveJS(GCCellPtr(obj));
|
2014-07-31 23:14:17 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static MOZ_ALWAYS_INLINE void
|
2015-03-29 01:22:11 +03:00
|
|
|
ExposeScriptToActiveJS(JSScript* script)
|
2014-07-31 23:14:17 +04:00
|
|
|
{
|
2017-04-26 13:18:39 +03:00
|
|
|
MOZ_ASSERT(!js::gc::EdgeNeedsSweepUnbarrieredSlow(&script));
|
2014-05-20 01:58:05 +04:00
|
|
|
js::gc::ExposeGCThingToActiveJS(GCCellPtr(script));
|
2013-09-09 07:28:48 +04:00
|
|
|
}
|
|
|
|
|
2014-01-23 23:47:11 +04:00
|
|
|
/*
|
|
|
|
* Internal to Firefox.
|
|
|
|
*/
|
|
|
|
extern JS_FRIEND_API(void)
|
2017-07-11 19:17:17 +03:00
|
|
|
NotifyGCRootsRemoved(JSContext* cx);
|
2014-01-23 23:47:11 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Internal to Firefox.
|
|
|
|
*/
|
|
|
|
extern JS_FRIEND_API(void)
|
2016-07-07 10:55:45 +03:00
|
|
|
NotifyDidPaint(JSContext* cx);
|
2014-01-23 23:47:11 +04:00
|
|
|
|
2013-01-28 00:35:12 +04:00
|
|
|
} /* namespace JS */
|
|
|
|
|
2013-06-20 04:59:09 +04:00
|
|
|
#endif /* js_GCAPI_h */
|