mirror of
https://github.com/servo/servo.git
synced 2025-08-07 22:45:34 +01:00
style: Reduce the amount of code generated by UnparsedValues::substitute_variables.
This reduces the amount of assembly instructions generated by this function from 18k+ to ~800. This should make reasoning about its stack space usage sane, and should fix the ASAN stack overflows, but also we should take this regardless, because it's saner and makes reading it simpler. I also think that the writing_mode shenanigans is fixing a bug (I think before this, we'd pick the first physical value which mapped to any of the properties, which is wrong), but I haven't bothered looking for a test-case that fails before my patch. The relevant WPTs (css/css-logical/animation*) still pass. Differential Revision: https://phabricator.services.mozilla.com/D105342
This commit is contained in:
parent
b0d05d1a5d
commit
490db1e2bd
5 changed files with 57 additions and 59 deletions
|
@ -948,7 +948,7 @@
|
|||
input.parse_entirely(|input| parse_value(context, input)).map(|longhands| {
|
||||
% for sub_property in shorthand.sub_properties:
|
||||
% if sub_property.may_be_disabled_in(shorthand, engine):
|
||||
if NonCustomPropertyId::from(LonghandId::${sub_property.camel_case}).allowed_in(context) {
|
||||
if NonCustomPropertyId::from(LonghandId::${sub_property.camel_case}).allowed_in_ignoring_rule_type(context) {
|
||||
% endif
|
||||
declarations.push(PropertyDeclaration::${sub_property.camel_case}(
|
||||
longhands.${sub_property.ident}
|
||||
|
@ -980,7 +980,7 @@
|
|||
#[allow(unused_imports)]
|
||||
use crate::values::specified;
|
||||
|
||||
pub fn parse_value<'i, 't>(
|
||||
fn parse_value<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Longhands, ParseError<'i>> {
|
||||
|
@ -1024,7 +1024,7 @@
|
|||
#[allow(unused_imports)]
|
||||
use crate::values::specified;
|
||||
|
||||
pub fn parse_value<'i, 't>(
|
||||
fn parse_value<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Longhands, ParseError<'i>> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue