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

@ -35,7 +35,7 @@ size_of_test!(test_size_of_element_data, ElementData, 24);
size_of_test!(test_size_of_property_declaration, style::properties::PropertyDeclaration, 32);
size_of_test!(test_size_of_application_declaration_block, ApplicableDeclarationBlock, 32);
size_of_test!(test_size_of_application_declaration_block, ApplicableDeclarationBlock, 24);
size_of_test!(test_size_of_rule_node, RuleNode, 80);
// This is huge, but we allocate it on the stack and then never move it,