Last Comment Bug 765297 - free up bits in String::lengthAndFlags for new string subtypes
: free up bits in String::lengthAndFlags for new string subtypes
Status: RESOLVED FIXED
[js:t]
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla16
Assigned To: Luke Wagner [:luke]
:
Mentors:
Depends on:
Blocks:
  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:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


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

Description Luke Wagner [:luke] 2012-06-15 10:40:37 PDT
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.
Comment 1 Nicholas Nethercote [:njn] 2012-06-17 16:59:46 PDT
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"?
Comment 3 Ed Morley [:emorley] 2012-06-19 01:20:27 PDT
https://hg.mozilla.org/mozilla-central/rev/613262f091e6

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