Closed Bug 1246186 Opened 8 years ago Closed 1 month ago

Figure out the right semantics for Allocate<JSObject, NoGC>

Categories

(Core :: JavaScript: GC, defect)

defect

Tracking

()

RESOLVED INCOMPLETE
Tracking Status
firefox47 --- affected

People

(Reporter: terrence, Unassigned)

References

Details

After bug 1245965 lands, CreateMatchResultFallbackFunc will be the only caller of Allocate<JSObject, NoGC>.

Because of the NewObjectCache (the prior only user), the current semantics are that Allocate<JSObject, NoGC> will just fail outright if the Nursery is full, rather than falling back to Tenured and filling up memory. This behavior is quite weird and frequently not what is intended. Is this actually the behavior you wanted? Now that CreateMatchResultFallbackFunc is the only caller, we could shift the semantics however we want.
Flags: needinfo?(arai.unmht)
wow, thank you for pointing that out.
I checked the return value of Allocate<JSObject, NoGC> and it's 0 in most of time (it returns non-null only 2% while running octane/regexp)

commenting out |if (!allowGC) return nullptr;| doesn't improve the octane score, but regress.

octane/regexp score:

  current m-c:                                      3559
  current m-c + comment out !allowGC branch:        3003
  current m-c + remove fallback for createGCObject: 3539

  bug 887016 patched:                               3212
  bug 887016 + comment out !allowGC branch:         2991
  bug 887016 + remove fallback for createGCObject:  3215

so, at least fallback to Tenured won't be what we want there.
anyway, maybe, we just don't have to fallback to Allocate when createGCObject fails?
(looks like fallback for newGCString/newGCFatInlineString was sufficient...)
Flags: needinfo?(arai.unmht)
Severity: normal → S3
Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.