add API to enable/disable per-compartment GCs

RESOLVED FIXED

Status

()

Core
JavaScript Engine
RESOLVED FIXED
8 years ago
8 years ago

People

(Reporter: gal, Assigned: gal)

Tracking

Trunk
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(blocking2.0 betaN+)

Details

(Whiteboard: [fixed-in-tracemonkey][hardblocker])

Attachments

(1 attachment, 2 obsolete attachments)

Comment hidden (empty)
(Assignee)

Comment 1

8 years ago
Created attachment 502322 [details] [diff] [review]
draft patch
Assignee: general → gal
(Assignee)

Comment 2

8 years ago
Created attachment 502323 [details] [diff] [review]
draft patch, v2
Attachment #502322 - Attachment is obsolete: true
(Assignee)

Comment 3

8 years ago
Created attachment 502426 [details] [diff] [review]
patch
Attachment #502323 - Attachment is obsolete: true
Attachment #502426 - Flags: review?(jst)
(Assignee)

Updated

8 years ago
Attachment #502426 - Flags: review?(brendan)
(Assignee)

Comment 4

8 years ago
brendan, if you can review the pref setting code as well, feel free to clear the review request for jst
(Assignee)

Updated

8 years ago
blocking2.0: --- → ?
Comment on attachment 502426 [details] [diff] [review]
patch

>+static int
>+SetMemoryGCModePrefChangedCallback(const char* aPrefName, void* aClosure)

I don't know why memory is in these names, but it seems to be all over!

>diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp
>--- a/js/src/jsapi.cpp
>+++ b/js/src/jsapi.cpp
>@@ -2592,16 +2592,19 @@ JS_SetGCParameter(JSRuntime *rt, JSGCPar
>         rt->gcMaxBytes = value;
>         break;
>       case JSGC_MAX_MALLOC_BYTES:
>         rt->setGCMaxMallocBytes(value);
>         break;
>       case JSGC_STACKPOOL_LIFESPAN:
>         rt->gcEmptyArenaPoolLifespan = value;
>         break;
>+      case JSGC_MODE:
>+        rt->gcMode = JSGCMode(value);
>+        break;

Check (or at least assert) that value is in the legal range.

>+typedef enum JSGCMode {
>+    /* Perform only global GCs. */
>+    JSGC_STOP_THE_WORLD_ONLY = 0,

JSGC_MODE_GLOBAL and JSGC_MODE_COMPARTMENT?  "Stop the world" is a separate concept, more related to mutator
blocking than separation of heaps and collection, IMO.

>+    /* Perform per-compartment GCs until too much garbage has accumulated. */
>+    JSGC_PER_COMPARTMENT = 1
>+} JSGCMode;
>+

r=shaver with those changes.
Attachment #502426 - Flags: review+
(Assignee)

Updated

8 years ago
Attachment #502426 - Flags: review?(jst)
Attachment #502426 - Flags: review?(brendan)
Nice review, shaver!

/be
(Assignee)

Comment 7

8 years ago
http://hg.mozilla.org/tracemonkey/rev/de9053031560
Whiteboard: fixed-in-tracemonkey
blocking2.0: ? → betaN+
Whiteboard: fixed-in-tracemonkey → [fixed-in-tracemonkey][hardblocker]
http://hg.mozilla.org/mozilla-central/rev/de9053031560
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.