style: Pack the shadow cascade order in ApplicableDeclarationBlock.

I didn't bother not shifting there. We need to load the whole thing and shift
for at least one of cascade level / shadow cascade order.

Callers of level() other than for_rule_tree are non-existent in release builds,
so we'd be doing the shift anyway. I can implement the same thing for
shadow_cascade_order too, but I don't think that optimization is measurable in
any way, either, the compiler should make the decision.

And just in case, the simpler version actually generated less instructions in:

  https://play.rust-lang.org/?gist=ceadb0d3cbce4eeca76e4d9ab9a1c744&version=nightly

with the simple thing.

Bug: 1455032
Reviewed-by: heycam
MozReview-Commit-ID: 8xPBJmlcyKh
This commit is contained in:
Emilio Cobos Álvarez 2018-04-18 19:48:24 +02:00
parent b1fbb28b8a
commit b5c18c24fe
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
3 changed files with 57 additions and 38 deletions

View file

@ -170,7 +170,7 @@ const FREE_LIST_LOCKED: *mut RuleNode = 0x02 as *mut RuleNode;
///
/// In particular, it'd be `0` for the innermost shadow host, `1` for the next,
/// and so on.
pub type ShadowCascadeOrder = u32;
pub type ShadowCascadeOrder = u8;
impl RuleTree {
/// Construct a new rule tree.