@@ -88,28 +88,21 @@ impl RawEmitter {
8888
8989 // The inlining in this code works like the following:
9090 //
91- // The `skip_search` function is always inlined into the parent `lookup ` fn,
91+ // The `skip_search` function is always inlined into the parent `lookup_slow ` fn,
9292 // thus the compiler can generate optimal code based on the referenced `static`s.
9393 //
94- // In the case of ASCII optimization, the lower-bounds check is inlined into
95- // the caller, and slower-path `skip_search` is outlined into a separate `lookup_slow` fn.
96- //
97- // Thus, in both cases, the `skip_search` function is specialized for the `static`s,
98- // and outlined into the prebuilt `std`.
99- if first_code_point > 0x7f {
100- writeln ! ( & mut self . file, "#[inline]" ) . unwrap ( ) ;
101- writeln ! ( & mut self . file, "pub fn lookup(c: char) -> bool {{" ) . unwrap ( ) ;
102- writeln ! ( & mut self . file, " debug_assert!(!c.is_ascii());" ) . unwrap ( ) ;
103- writeln ! ( & mut self . file, " (c as u32) >= {first_code_point:#04x} && lookup_slow(c)" )
104- . unwrap ( ) ;
105- writeln ! ( & mut self . file, "}}" ) . unwrap ( ) ;
106- writeln ! ( & mut self . file) . unwrap ( ) ;
107- writeln ! ( & mut self . file, "#[inline(never)]" ) . unwrap ( ) ;
108- writeln ! ( & mut self . file, "fn lookup_slow(c: char) -> bool {{" ) . unwrap ( ) ;
109- } else {
110- writeln ! ( & mut self . file, "pub fn lookup(c: char) -> bool {{" ) . unwrap ( ) ;
111- writeln ! ( & mut self . file, " debug_assert!(!c.is_ascii());" ) . unwrap ( ) ;
112- }
94+ // The lower-bounds check is inlined into the caller, and slower-path
95+ // `skip_search` is outlined into a separate `lookup_slow` fn.
96+ assert ! ( first_code_point > 0x7f ) ;
97+ writeln ! ( & mut self . file, "#[inline]" ) . unwrap ( ) ;
98+ writeln ! ( & mut self . file, "pub fn lookup(c: char) -> bool {{" ) . unwrap ( ) ;
99+ writeln ! ( & mut self . file, " debug_assert!(!c.is_ascii());" ) . unwrap ( ) ;
100+ writeln ! ( & mut self . file, " (c as u32) >= {first_code_point:#04x} && lookup_slow(c)" )
101+ . unwrap ( ) ;
102+ writeln ! ( & mut self . file, "}}" ) . unwrap ( ) ;
103+ writeln ! ( & mut self . file) . unwrap ( ) ;
104+ writeln ! ( & mut self . file, "#[inline(never)]" ) . unwrap ( ) ;
105+ writeln ! ( & mut self . file, "fn lookup_slow(c: char) -> bool {{" ) . unwrap ( ) ;
113106 writeln ! ( & mut self . file, " const {{" ) . unwrap ( ) ;
114107 writeln ! (
115108 & mut self . file,
0 commit comments