Files
sdk/pkg/front_end/testcases/offsets/pattern_switch.dart.weak.expect
T
Johnni Winther 85cb56dd20 [cfe] Don't use late final for pattern caching
This changes the pattern matching lowering to avoid using late final variables (or lowerings thereof) and instead inline the initializer where used. This avoids generating closures that are hard for backends to reason about and optimize.

Closes #52805
Closes #53804

Change-Id: Ia887446dd4d4475d05cf852c812bfe4b851de261
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/338860
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2023-12-06 12:01:38 +00:00

29 lines
2.3 KiB
Plaintext

library;
import self as self;
import "dart:core" as core;
[217]static method method([224] dynamic o) → dynamic {
[231] #L1:
[231] {
[239] [239] final synthesized dynamic #0#0 = [239] [239] o;
[-1] [-1] synthesized core::int #0#2;
[-1] [-1] synthesized core::bool #0#2#isSet = [253] [253] false;
[-1] [-1] dynamic #t1;
[248] {
[258] [258] lowered hoisted dynamic a#case#0;
[290] [290] lowered hoisted dynamic a#case#1;
[248] if([231] [231] [258] [258] [-1] [-1] [253] [253] [253] [253] [253] [253] [-1] [-1] #0#0 is core::List<dynamic> && [253] [253] [253]([253] [-1] [-1] #0#2#isSet ?{core::int} [-1] [-1] #0#2{core::int} : [253] [253] let [253] final dynamic #t2 = [253] [253] #0#2#isSet = [253] [253] true in [253] [253] #0#2 = [253] [253] [-1] [-1] #0#0{core::List<dynamic>}.{core::List::length}{core::int}) =={core::num::==}{(core::Object) → core::bool} [-1] [-1] #C1 && [258]([258] let [258] final dynamic #t3 = [258] [258] a#case#0 = [253] [253] [-1] [-1] #0#0{core::List<dynamic>}.{core::List::[]}[253]([253] 0){(core::int) → dynamic} in [-1] [-1] true) && [268] [268] [268] [268] [266] [266] a#case#0{dynamic}.> [268]([270] 5) as{TypeError} core::bool && [231]([231] let [231] final dynamic #t4 = [231] [231] #t1 = [258] [258] a#case#0 in [258] [258] true) || [290] [290] [-1] [-1] [282] [282] [282] [282] [282] [282] [-1] [-1] #0#0 is core::List<dynamic> && [282] [282] [253]([253] [-1] [-1] #0#2#isSet ?{core::int} [-1] [-1] #0#2{core::int} : [253] [253] let [253] final dynamic #t5 = [253] [253] #0#2#isSet = [253] [253] true in [253] [253] #0#2 = [253] [253] [-1] [-1] #0#0{core::List<dynamic>}.{core::List::length}{core::int}) =={core::num::==}{(core::Object) → core::bool} [-1] [-1] #C2 && [290]([290] let [290] final dynamic #t6 = [290] [290] a#case#1 = [282] [282] [-1] [-1] #0#0{core::List<dynamic>}.{core::List::[]}[282]([282] 1){(core::int) → dynamic} in [-1] [-1] true) && [300] [300] [300] [300] [298] [298] a#case#1{dynamic}.< [300]([302] 5) as{TypeError} core::bool && [231]([231] let [231] final dynamic #t7 = [231] [231] #t1 = [290] [290] a#case#1 in [290] [290] true)) {
[258] [258] dynamic a = [-1] [-1] #t1{dynamic};
[248] {
[311] [311] [311] core::print [316]([317] a);
}
}
}
}
}
constants {
#C1 = 1
#C2 = 2
}