Closed Bug 503461 Opened 15 years ago Closed 15 years ago

TM: inline FinalizeObject into jsgc and make sure Scope hold() and drop() are inline too

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: gal, Assigned: gal)

References

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

Quite noticable speedup for the gc path.
Attached patch patchSplinter Review
Assignee: general → gal
Attachment #387816 - Flags: review?(brendan)
Attachment #387816 - Flags: review?(igor)
Attachment #387816 - Flags: review?(brendan) → review?(dmandelin)
Blocks: 503462
Attachment #387816 - Flags: review?(dmandelin) → review+
Comment on attachment 387816 [details] [diff] [review]
patch

I'm not super familiar with these finalizers but from what I see you simply moved some functions from one file to another so they can be inlined at the point where they are called the most, so it looks good to me.
http://hg.mozilla.org/tracemonkey/rev/81af09df8033
Whiteboard: fixed-in-tracemonkey
Comment on attachment 387816 [details] [diff] [review]
patch

>+static void
>+FinalizeObject(JSContext *cx, JSObject *obj)
>+{
>+    /* Cope with stillborn objects that have no map. */
>+    if (!obj->map)
>+        return;
>+
>+    if (JS_UNLIKELY(cx->debugHooks->objectHook != NULL)) {
>+        cx->debugHooks->objectHook(cx, obj, JS_FALSE,
>+                                   cx->debugHooks->objectHookData);
>+    }
>+
>+    /* Finalize obj first, in case it needs map and slots. */
>+    STOBJ_GET_CLASS(obj)->finalize(cx, obj);

For the default JS objects and arrays we are calling here the empty JS_FinalizeStub method. My guess is that avoiding calling this method via simple check can make the finalization faster. But this can go to a separated bug.
Attachment #387816 - Flags: review?(igor) → review+
http://hg.mozilla.org/mozilla-central/rev/81af09df8033
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Blocks: 504033
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: