Closed Bug 1434263 Opened 8 years ago Closed 8 years ago

Give JSString an IsLinear flag instead of IsFlat

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla60
Tracking Status
firefox60 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

Details

Attachments

(1 file)

Attached patch PatchSplinter Review
For bug 1434230 we want strings to have an explicit IsLinear flag - the current (flags & TYPE_FLAGS_MASK) != 0 predicate for isLinear() is hard to work with for that bug. I think it makes sense to get rid of the IsFlat bit. JSString::isFlat() can be defined as isLinear() && !isDependent() && !isExternal() - that's slightly slower but flat strings will hopefully be removed at some point (bug 1330776) and isLinear() is the much hotter query. Another option is to have both IsFlat/IsLinear bits; I can do that too if you think it's better.
Attachment #8946639 - Flags: review?(luke)
Comment on attachment 8946639 [details] [diff] [review] Patch Review of attachment 8946639 [details] [diff] [review]: ----------------------------------------------------------------- It's nice that compile errors mostly (completely?) pointed out every place that needed updating. ::: js/src/vm/String.h @@ +219,5 @@ > * > * String Instance Subtype > * type encoding predicate > * ------------------------------------ > + * Rope 000000 xxxxx0 Naturally, now we must find something to do with these other 7 bits ;)
Attachment #8946639 - Flags: review?(luke) → review+
With the current approach in bug 1434230 I don't strictly need this patch anymore, but it still makes it easier to reason about the new code, so I'll just land it.
Pushed by jandemooij@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/a806fd1e5427 Refactor JSString to have an IsLinear flag instead of IsFlat. r=luke
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: