If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

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

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:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 attachment)

8.27 KB, patch
dmandelin
: review+
Igor Bukanov
: review+
Details | Diff | Splinter Review
(Assignee)

Description

8 years ago
Quite noticable speedup for the gc path.
(Assignee)

Comment 1

8 years ago
Created attachment 387816 [details] [diff] [review]
patch
Assignee: general → gal
Attachment #387816 - Flags: review?(brendan)
(Assignee)

Updated

8 years ago
Attachment #387816 - Flags: review?(igor)
(Assignee)

Updated

8 years ago
Attachment #387816 - Flags: review?(brendan) → review?(dmandelin)
(Assignee)

Updated

8 years ago
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.
(Assignee)

Comment 3

8 years ago
http://hg.mozilla.org/tracemonkey/rev/81af09df8033
Whiteboard: fixed-in-tracemonkey

Comment 4

8 years ago
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+

Comment 5

8 years ago
http://hg.mozilla.org/mozilla-central/rev/81af09df8033
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED

Updated

8 years ago
Blocks: 504033
You need to log in before you can comment on or make changes to this bug.