85cb56dd20
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>
32 lines
1.2 KiB
Plaintext
32 lines
1.2 KiB
Plaintext
library;
|
|
import self as self;
|
|
import "dart:core" as core;
|
|
|
|
class A extends core::Object {
|
|
synthetic constructor •() → self::A
|
|
: super core::Object::•()
|
|
;
|
|
get foo() → core::String
|
|
return "foo";
|
|
get bar() → core::Object?
|
|
return null;
|
|
}
|
|
static method test(dynamic x) → dynamic {
|
|
{
|
|
hoisted core::String y;
|
|
final synthesized dynamic #0#0 = x;
|
|
synthesized core::Object? #0#5;
|
|
synthesized core::bool #0#5#isSet = false;
|
|
if(#0#0 is self::A && #C1 =={core::String::==}{(core::Object) → core::bool} #0#0{self::A}.{self::A::foo}{core::String} && (let final dynamic #t1 = (#0#5#isSet ?{core::Object?} #0#5{core::Object?} : let final dynamic #t2 = #0#5#isSet = true in #0#5 = #0#0{self::A}.{self::A::bar}{core::Object?}) as core::String in ((#0#5#isSet ?{core::Object?} #0#5{core::Object?} : let final dynamic #t3 = #0#5#isSet = true in #0#5 = #0#0{self::A}.{self::A::bar}{core::Object?}) as core::String) is core::String && (let final dynamic #t4 = y = (#0#5#isSet ?{core::Object?} #0#5{core::Object?} : let final dynamic #t5 = #0#5#isSet = true in #0#5 = #0#0{self::A}.{self::A::bar}{core::Object?}) as core::String in true))) {
|
|
return y;
|
|
}
|
|
else {
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
|
|
constants {
|
|
#C1 = ""
|
|
}
|