free up bits in String::lengthAndFlags for new string subtypes

RESOLVED FIXED in mozilla16

Status

()

Core
JavaScript Engine
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: luke, Assigned: luke)

Tracking

unspecified
mozilla16
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [js:t])

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Created attachment 633577 [details] [diff] [review]
patch

There are a few interesting optimizations that require adding new string subtypes (e.g., bug 654190) but can't because the 4 flag bits in lengthAndFlags are a bit crowded.  Currently, ropes and dependent strings get their own bit (which allows a single cmp to test), but only testing the rope bit (or their absence: isLinear) is hot.  This patch frees up the dependent string bit which should give us enough room for the next few optimizations.
(Assignee)

Updated

5 years ago
Attachment #633577 - Flags: review?(n.nethercote)
Comment on attachment 633577 [details] [diff] [review]
patch

Review of attachment 633577 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/vm/String.cpp
@@ +336,2 @@
>  
> +    /* TODO: explain why undepended. */

?

::: js/src/vm/String.h
@@ +92,2 @@
>   *  |
> + * JSLinearString (abstract)     chars / may not be null-terminated

Can you change this to "might"?  I always find "may" ambiguous -- does it mean "might" or "must"?
Attachment #633577 - Flags: review?(n.nethercote) → review+
(Assignee)

Comment 2

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/613262f091e6
Target Milestone: --- → mozilla16
Whiteboard: [js:t]

Comment 3

5 years ago
https://hg.mozilla.org/mozilla-central/rev/613262f091e6
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.