Closed Bug 525527 Opened 15 years ago Closed 15 years ago

TM: avoid uint16 in JSXML (slow and can interfere with conservative stack scanning)

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)

      No description provided.
Attached patch patchSplinter Review
Assignee: general → gal
Attachment #409383 - Flags: review?(igor)
Blocks: 516832
Comment on attachment 409383 [details] [diff] [review]
patch

>diff --git a/js/src/jsxml.h b/js/src/jsxml.h
>--- a/js/src/jsxml.h
>+++ b/js/src/jsxml.h
>@@ -107,19 +107,18 @@ struct JSXML {
> #ifdef DEBUG_notme
>     JSCList             links;
>     uint32              serial;
> #endif
>     JSObject            *object;
>     void                *domnode;       /* DOM node if mapped info item */
>     JSXML               *parent;
>     JSObject            *name;
>-    uint16              xml_class;      /* discriminates u, below */
>-    uint16              xml_flags;      /* flags, see below */
>-    uint32              align;
>+    uint32              xml_class;      /* discriminates u, below */
>+    uint32              xml_flags;      /* flags, see below */

Nit: comment here that all fields must be at least 4 bytes in size and that for code simplicity we tolerate wasteful uint32 usage for xml_flags and xml_class. Also refer to this bug for reasons.
Attachment #409383 - Flags: review?(igor) → review+
No space is wasted here. I eliminated the alignment field. So this patch is strictly faster without wasting a single bit. I am not convinced the 16-bit fields are actually a problem. This patch is mostly preventive. We don't comment JSObject either. I think I will add a comment to the conservative scanning code instead.
http://hg.mozilla.org/tracemonkey/rev/444068768c1e
Whiteboard: fixed-in-tracemonkey
http://hg.mozilla.org/mozilla-central/rev/444068768c1e
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: