Last Comment Bug 765297 - free up bits in String::lengthAndFlags for new string subtypes
: free up bits in String::lengthAndFlags for new string subtypes
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
-- normal (vote)
: mozilla16
Assigned To: Luke Wagner [:luke]
: Jason Orendorff [:jorendorff]
Depends on:
  Show dependency treegraph
Reported: 2012-06-15 10:40 PDT by Luke Wagner [:luke]
Modified: 2012-08-13 16:17 PDT (History)
4 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

patch (28.51 KB, patch)
2012-06-15 10:40 PDT, Luke Wagner [:luke]
n.nethercote: review+
Details | Diff | Splinter Review

Description User image Luke Wagner [:luke] 2012-06-15 10:40:37 PDT
Created attachment 633577 [details] [diff] [review]

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.
Comment 1 User image Nicholas Nethercote [:njn] 2012-06-17 16:59:46 PDT
Comment on attachment 633577 [details] [diff] [review]

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"?
Comment 3 User image Ed Morley [:emorley] 2012-06-19 01:20:27 PDT

Note You need to log in before you can comment on or make changes to this bug.