Closed Bug 612015 Opened 9 years ago Closed 9 years ago

Put all external strings in one arena

Categories

(Core :: JavaScript Engine, enhancement)

x86
macOS
enhancement
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: gwagner, Assigned: gwagner)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

I noticed that external string arenas are rarely full. Why not collect them in one arena instead of allocating separate arenas for separate types.
Assignee: general → anygregor
Attached patch patchSplinter Review
Attachment #490414 - Flags: review?(igor)
Comment on attachment 490414 [details] [diff] [review]
patch

>@@ -155,16 +153,17 @@ struct JSString {
>+        uintN                       externalStringType; /* only for external strings. */

Nit: stay within 78 columns for the comment text.


>+struct JSExternalString : JSString {
>+    static const uintN TYPE_LIMIT = 8;
>+    static JSStringFinalizeOp str_finalizers[TYPE_LIMIT];

Perhaps we should remove the static (not runtime-based array) and just store the finalizer in the string itself? Alternatively we can add a per-runtime callback that would take the external string kind as a parameter. But this is for another bug.
Attachment #490414 - Flags: review?(igor) → review+
http://hg.mozilla.org/tracemonkey/rev/d7543e6c5097
Whiteboard: fixed-in-tracemonkey
http://hg.mozilla.org/mozilla-central/rev/d7543e6c5097
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.