Closed Bug 948638 Opened 10 years ago Closed 10 years ago

Always use jsid struct types


(Core :: JavaScript Engine, defect)

Not set





(Reporter: sstangl, Assigned: sstangl)



(Whiteboard: [qa-])


(1 file)

Bug 939505 introduced JS_DEBUG for exported headers in order to allow linking against ptrdiff_t jsid mozjs when DEBUG is defined for the parent project. Bug 948099 extends JS_DEBUG to the rest of the engine.

Waldo pointed out that we wouldn't need JS_DEBUG for jsid if we always used jsid struct types, and that we haven't measured the performance impact of making that switch.

The attached patch makes that change. Landing this patch will hopefully let us revert JS_DEBUG.

Octane performance is largely unchanged, except that octane-regexp receives a consistent performance improvement from ~1800 to ~1950 on both x86 and x86_64. I'm not sure why that is, but I'll take it.
Attachment #8345502 - Flags: review?(jwalden+bmo)
Comment on attachment 8345502 [details] [diff] [review]

Review of attachment 8345502 [details] [diff] [review]:

::: js/public/Id.h
@@ +33,5 @@
>      size_t asBits;
>      bool operator==(jsid rhs) const { return asBits == rhs.asBits; }
>      bool operator!=(jsid rhs) const { return asBits != rhs.asBits; }
>  };
> +#define JSID_BITS(id) (id.asBits)

Would be nice to get rid of this too, but that can be done in a separate patch, no need to hold this up for that.
Attachment #8345502 - Flags: review?(jwalden+bmo) → review+
Make sure to double check that this patch doesn't increase the number of static constructors; you might have to sprinkle some MOZ_CONSTEXPR about.
Per a Try run at, num_ctors increased from 94 to 123. Looking at the Tryserver history at[[81,23,6]]&sel=none&displayrange=7&datatype=running shows this 123 range occurring intermittently.
Pushed. Will address possible static constructor count increase after some runs.
Regression: Mozilla-Inbound - Number of Constructors - CentOS (x86_64) release 5 (Final) - 35.1% increase
    Previous: avg 94.000 stddev 0.000 of 12 runs up to revision 28587965e647
    New     : avg 127.000 stddev 0.000 of 12 runs since revision a9acb6b5ed0f
    Change  : +33.000 (35.1% / z=0.000)
    Graph   :

Changeset range:

    : Sean Stangl <> - Bug 948638 - Always use jsid struct types. r=Waldo

  * - Always use jsid struct types
Assignee: nobody → sstangl
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
Depends on: 949183
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.