Terry is landing the test for this. We were throwing on this:
const u4 = const String.fromEnvironment("XXXXX");
void main() {
print(u4.toString());
}
Change-Id: I5ad158978ce9a19c2d5a3b65a39beae1676fe7b1
Reviewed-on: https://dart-review.googlesource.com/5042
Reviewed-by: Jennifer Messerly <jmesserly@google.com>
Commit-Queue: Terry Lucas <terry@google.com>
Two different optimizations conflicted (in the SDK, == methods must take care to consider a null value, but at the same time tearoff == was optimized), so it fixes that. Also adds a test for this.
Change-Id: I3d6fef7cae9df2fcbb9c276ae4e48490fd62eabb
Reviewed-on: https://dart-review.googlesource.com/4180
Commit-Queue: Jennifer Messerly <jmesserly@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
This should improve performance of these members in most cases:
- toString
- operator ==
- hashCode
- runtimeType
- noSuchMethod
The helpers for checking `null` and then dispatching to the method are now very small again. Also, because we can lookup symbolized names always, we can start taking advantage of this in our Map/Set implementations (for a follow up CL).
This also improves correctness of these helpers given JavaScript objects; we were previously falling back to calling a Dart method name like `.hashCode`, which is incorrect (except for `toString` where fallback is probably the correct behavior).
Change-Id: I39cbc80ca3e93ca7672652610b02bce899894da1
Reviewed-on: https://dart-review.googlesource.com/3427
Commit-Queue: Jennifer Messerly <jmesserly@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
This has a few related fixes:
fix#30461, DDC now generates covariant checks for superclasses with the correct substitution.
fix#29483, Analyzer can resolve the function type literal syntax correctly when used in type bounds and type arguments.
fix#30095, replace use of DDC's StrongModeError private type with TypeError.
It also has some refactoring to simplify how DDC emits the initialization code at the start of function/method bodies. We no longer jump through AST parent pointers.
Change-Id: I7001f98cd0e00299d77bace49e19aca305abf224
Reviewed-on: https://dart-review.googlesource.com/3100
Reviewed-by: Leaf Petersen <leafp@google.com>
fixes#30495 - optimize subtype cache
fixes#30464 - optimize `is List`
Additional changes:
- optimize double type checks
- optimize Object type checks
- optimize FutureOr<T> checks
- optimize interface checks for some dart:core and dart:async types (List, Map, Iterable, Future, Stream, and StreamSubscription )
- optimize checks for generic class default instantiations and exact instantiation (e.g. `C<dynamic>` on any instance `C<T>`, and `C<T> on an instance of C<T>`
- optimize checks for native types
- optimize getReifiedType
- optimize dcall/dsend/dput checks to use faster Type._check pattern
- optimize instanceOf/cast functions by moving special cases to appropriate types
- optimize Object.runtimeType
- optimize JS interop type checks
- optimize all function type checks
There's more we can do (especially for class/interface types) but this should cover a lot of cases.
R=leafp@google.com
Review-Url: https://codereview.chromium.org/3003613002 .
Eliminate numerous type checks not needed in strong mode. Use
private nullability annotations instead of inline JS to mark known
non-null variables, and to make the compiler generate null checks
for null checked variables. Use nullability annotations and code refactoring to
remove redundant null checks and to move checks out of loops.
BUG=
R=jmesserly@google.com
Review-Url: https://codereview.chromium.org/2994203002 .
This is the original CL plus status file fixes.
Disables auto-generated function_type tests that are not working for the Dart 2 runtime behavior, and filed #30462 to track. Also removes the separate status that was skipping these tests in DDC when $checked was unset. $checked is not a thing for Dart 2, and DDC test status should never depend on it.
This reverts commit 1b0b1a4913.
R=leafp@google.com
Review-Url: https://codereview.chromium.org/3001053002 .
A few more passes, but perhaps one regression:
Chrome 59.0.3071 (Mac OS X 10.12.5) corelib/date_time10_test FAILED
Error: Expect.equals(at index 1: Expected <0100-01-01 00:00:00.000Z...>, Found: <0099-01-01 00:00:00.000Z...>) fails.
at finish (test/browser/language_tests.js:807:59)
TBR=rnystrom@google.com,jmesserly@google.com
Review-Url: https://codereview.chromium.org/2983403003 .
also fixes various bugs:
* setters now use the correct memberName symbol, fixes#30223
* object members work for callable classes, fixes#30213
* some test fixes to work in strong mode
* a few other small cleanups (e.g. obsolete `dart.list` is removed)
R=vsm@google.com
Review-Url: https://codereview.chromium.org/2979353002 .