Commit graph

70152 commits

Author SHA1 Message Date
Jaime Wren
d772141960 Initial RelevanceAnalyzer support in the completion_metrics.dart algorithm with an initial example implementation of RHSOfAsExpression
Change-Id: Icaf3e80cb4d634f5871d576d3344210d631641c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134092
Commit-Queue: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-01-31 21:41:47 +00:00
Martin Kustermann
7a6233ad51 [vm] Set Class::is_const() based on final fields instead of generative constructors (which can be shaken by TFA)
This fixes debug assertions in AOT.

Change-Id: Ib688164498ad98d2b7bb4ce574cf6859922df3a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133999
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-01-31 21:38:37 +00:00
Sigmund Cherem
1349a64d6a Update check_nnbd_sdk to diff expectations directly in dart.
This makes the script properly produce an error message when
it detects a mismatch on windows (there `diff` is not available.)

Change-Id: Ibefe8c69023b42e8710e744f88257ff967d34bd2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134094
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2020-01-31 21:33:42 +00:00
Vijay Menon
18f41ce9e5 [dartdevc] use var for top-level
This is a potential workaround for:

https://bugs.webkit.org/show_bug.cgi?id=199866

until a proper fix lands in Safari.  See:

https://github.com/dart-lang/sdk/issues/40380

Change-Id: I66f5aefefcc6c8f12fd3b747fcee587fc16d437d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133542
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-01-31 21:30:32 +00:00
Mayank Patke
a5cfdf6586 [dart2js] Use flags to choose between legacy/NNBD in RTI.
Change-Id: I42705320aabcdfecc12098f40ca16a2c623a1033
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134091
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-01-31 20:04:52 +00:00
Nicholas Shahan
55b81b08bf [dartdevc] Add dart:io back to the sdk
Revert the changes made to DevCompilerTarget that allowed for optionally
excluding libraries when building the null safe SDK.

Fixes: #39698
Change-Id: I0ae3160e17ca60b7a078a905ea12c8538d2aa045
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134081
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-01-31 20:00:32 +00:00
Johnni Winther
54c8066f6f [cfe] Add new flags to AsExpression and IsExpression
Change-Id: I31eba9b4ced051a1067945fd68e60a09b1fa6ed7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133100
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-01-31 19:55:22 +00:00
Konstantin Shcheglov
bb6cab29b9 Check for correct overrides as the specification requires.
Specifically, we replace types of covariant parameters with `Object?`
or `Object` and use subtype check. Then we check types of covariant
formal parameters and corresponding overridden formal parameters.

It looks that NNBD related changes that are coming now require
such more precise following to the specification rules.

Change-Id: Idfa4e3a118050a1be79acce8c708b3aac07b5051
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134043
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-01-31 19:35:23 +00:00
Sigmund Cherem
f07c805656 Fix based64 decoder.
The non-nnbd code doesn't have this extra `if`. It appears
that this conditional was added during the migration but
it is accidentally hiding the update to the _state.

This change restores the algorithm to how it was before
the migration and fixes lib_2/convert/base64_test/none

Change-Id: I72dd2e870056bb55158bbd053d8a3c8825a1d144
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134090
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2020-01-31 19:00:32 +00:00
Mayank Patke
023f286772 [dart2js] Update generic function subtyping.
We now test bounds for mutual subtyping rather than structural equality
up to renaming of bound type variables and equating all top types.

Change-Id: I7dd23a3211a1631e463ea90c3173f3deae46ca23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134042
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-01-31 18:33:02 +00:00
Sam Rawlins
8d874bbb1e NNBD preview: Add 'view' links to Edit List; #40115
Change-Id: Ia365fb43c6efc12c78a82841bcecffceefb501f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134086
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-01-31 18:06:52 +00:00
Brian Wilkerson
bff11ba6ec Enable always_declare_return_types in analysis_server
Change-Id: I9b06753cf552c9f50ea2abd7f3fa5ba9adecb526
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134085
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-31 17:45:24 +00:00
Brian Wilkerson
d1ca36aa83 Enable empty_catches in analysis_server
Change-Id: Ic21556e8118a5b5d3b4a06ed6d3a7002f606f2ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134084
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-31 17:38:02 +00:00
Brian Wilkerson
9517c22b39 Improve the fix for empty_catch
The fix for empty_catch should not remove the catch clause if doing so
would leave the try statement invalid. It could remove the whole try
statement in such a case, but it isn't clear that that's a good solution
in general. This at least patches the issue until we can decide whether
additional work should be done.

Change-Id: I7c5190faba9fd5632c04708007bc65bb18d3db6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134087
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-31 17:37:22 +00:00
Zichang Guo
b2b7337ad4 [dart:io] Stop forcing lower case on HttpHeaders
This is a breaking change. Request: https://github.com/dart-lang/sdk/issues/33501

HttpHeaders use lowercase by default for all headers, since it is supposed to be case insensitive. Some servers incorrectly treat case as significant, however, and expect headers with capitalization or in uppercase. The current implementation forces headers to be lower cases when adding values. Users cannot even manually modify the headers.

This change removes this restriction here so that users can modify the headers to whatever form they want. The new behavior is backwards compatible except if class was implemented. All headers inside http.dart are written as lower cases, adding values to HttpHeaders is still receiving lower cases input.

The other cl (https://dart-review.googlesource.com/c/http_multi_server/+/121411) migrates multi_headers.dart to be compatible with this change.

Bug: https://github.com/dart-lang/sdk/issues/33501
Change-Id: I6f7f2ef907b229773c283140c07f2de4cd500981
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119100
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-01-31 17:08:52 +00:00
Zichang Guo
0ed9f7179d [vm] seperate error and unknown types for getStdioHandletype
Infer other types as kPipe which is sync with Win platform.

Bug: https://github.com/dart-lang/sdk/issues/40354
Change-Id: I8bf40a143573685833a689ff2c724a421b308234
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133623
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2020-01-31 17:07:22 +00:00
Martin Kustermann
bada62ba7b [vm/reload] Fix crash in scavneger / GC after reload on ia32
If generated code refers to a constant object (which are old and canonical), a pointer
to it will be embedded in the instruction stream on ia32.

If we now reload and morph this constant object and allocate the
morph'ed copy in new space, the become operation will make RX writable
and the slot in the instruction stream gets updated to point to a new
space object and the code gets added to the remembered set.

The next scavenge operation will scan the remembered set as roots, see
the poitner to a new object, move the object and updates the pointer in
the instruction stream.
  => We hit a SEGV trying to write the RX memory

We can avoid this problem by ensuring to morph old+canonical instances
always into old space on ia32.

Change-Id: Id63eb6ee1735bbb661dbeceb1e8d0c6ac92225ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133228
Auto-Submit: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-01-31 16:42:42 +00:00
Martin Kustermann
5ae5aff640 [vm/embedder] Add documentation to Dart_CompileToKernel
Change-Id: Ic858a010f77a05c47430ce13d2bd7ef80535a538
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133990
Commit-Queue: Martin Kustermann <kustermann@google.com>
Auto-Submit: Martin Kustermann <kustermann@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2020-01-31 15:03:42 +00:00
William Hesse
4e38df4255 [infra] Print correct configuration groups in failures link
We were printing groups of builder names, not configurations

Change-Id: Ia9a6791fbd25939f71a1aa227bc288197c838bd6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133991
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-31 14:19:00 +00:00
Johnni Winther
42246f7f96 [cfe,analyzer] Disallow type parameters on operator methods
This was never supported by the grammar but unfortunately allowed by
both the analyzer and the CFE.

Change-Id: Id669c934fe08eda41973d6d2cef8340da2e7d72c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133591
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-01-31 14:05:02 +00:00
Jens Johansen
dac412d545 [CFE] Don't issue export errors twice in incremental compiler
When loading from dill a library with export errors in it, the errors
would be reported when setting up that scope. There it would be reported
without a location.
Then - if not recompiling it and fixing it - it would be reported again
because of problemsAsJson (with a location).
It would thus be reported twice, one better than the other.

This CL updates the scope building for dill builders to have the option
to supress such errors and then use that option in the incremental
compiler where we use problemsAsJson to reissue problems.

Change-Id: I03430bf8b9996b6e8b7571b8e4e33f3f89f832a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133235
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-01-31 13:57:32 +00:00
Jens Johansen
94c21123a8 [CFE] Fix memory leak in incremental compiler
Change-Id: I5541707a4a4c7537a947d2b08cb6d3ee4ad6075d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133230
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-01-31 13:56:41 +00:00
Johnni Winther
e0d8aa825a [cfe] Use fileUri in error reporting
+ add support for expectation testing of custom platform libraries

Change-Id: I1dfae23963ec25f2be11fad06c218e1c59fe181a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133920
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-01-31 13:46:22 +00:00
Jens Johansen
3d5530ff22 [CFE] Transformations can now tell of they changed the structure of a class
By allowing a transformation to tell if it change dthe structure of a
class we can make sure to update the class hierarchy accordingly,
making sure it's up to date for the next computeDelta call in the
incremental compiler.

Change-Id: Iefed3bb1ecbd17b142266ce4a9e1e477f9d2fc87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133222
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-01-31 13:45:12 +00:00
Victor Lima
b68d95ec9e [vm] Reland support for real unboxed floating point fields in AOT
Issue https://github.com/dart-lang/sdk/issues/40404

Change-Id: Icfa801ff0640a6b27bb3c13d0b737c40452cbf7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133983
Commit-Queue: Victor Agnez Lima <victoragnez@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-31 12:56:31 +00:00
Johnni Winther
906c6ea21c Avoid implicit downcast in nnbd sdk
The least upper bound of _SyncBroadcastStreamController and
_SyncStreamController is StreamController (according to the CFE) leading
to an implicit downcast from StreamController to _StreamControllerBase.

The analyzer and CFE sometimes disagree on the hierarchy depth
computation (see https://github.com/dart-lang/sdk/issues/38377)
which is probably the root cause of this.

Change-Id: I276bdc894d3926eae603b023b29462571c620c52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133980
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-01-31 11:58:31 +00:00
Karl Klose
77d50308dd [infra] Use pkg/smith's test matrix support in test.dart
Change-Id: I193651bc471191b9d45345dead9af1b428ceb3a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133239
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Karl Klose <karlklose@google.com>
2020-01-31 11:47:31 +00:00
Clement Skau
26ada4363a [SDK] Fixes remaining issues with --lazy-async-stacks on.
- Handle bytecode for e.g. dartkb-simarm64 does not have source position.
- Use existing GetCallerSp() instead of working across frames.
- Nit: Adds clarifying comments to test.
- Nit: Updates name of non-async-stack test to clarify flags used.

Tested:
- CQ with --lazy-async-stacks on by default.
- vm/dart/causal_stacks and language_2/vm/causal_async_exception_stack_test with current flags.

Bug: https://github.com/dart-lang/sdk/issues/39525
Change-Id: Ie6581a734cdcafbd4fb641bd86bffc03ed241532
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133063
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-31 10:45:21 +00:00
Jens Johansen
3f3d3dfa12 [CFE] Check class hierarchy in incremental compiler test
Change-Id: I963716d36bec213739bbc266f9494885edd0aa08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133104
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-01-31 10:38:41 +00:00
Dmitry Stefantsov
5e38b59740 [cfe] Don't allow implicit tear-offs of .call on nullable receivers
Closes #39710.

Bug: http://dartbug.com/39710
Change-Id: I3556fac1de1bd6874bbb052e05accebac9619c8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133982
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-01-31 09:39:21 +00:00
Johnni Winther
178384832c [cfe] Handle unresolved superclass on opt-out class with opt-in platform
Closes #40366

Change-Id: I3452cc825df52009cb294102d99de06c168413f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133782
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-01-31 08:27:21 +00:00
Karl Klose
3ab2112b06 [infra] Add support for branches to pkg/smith
Change-Id: Id2562a7dd2a4180aef7d7623ac937d7abae8ff74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133237
Commit-Queue: Karl Klose <karlklose@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-01-31 06:37:41 +00:00
Nicholas Shahan
eafa17ccfb [dartdevc] Update subtype check to allow mutual subtypes in bounds
Generic functions with bounds on the type parameters should be allowed
to differ in that legacy type bound should be considered equivalent to
a nullable or non-nullable version of the same type bound.

Fixes test failures:
lib_2/async/async_await_zones_test
lib_2/async/stream_listen_zone_test
lib_2/async/zone_bind_callback_test
lib_2/async/zone_bind_callback_unary_test
lib_2/async/zone_debug_test
lib_2/async/zone_fork_test
lib_2/async/zone_register_callback_test
lib_2/async/zone_register_callback_unary_test
lib_2/async/zone_run_guarded_test
lib_2/async/zone_run_test
lib_2/async/zone_run_unary_test


Change-Id: I8bbb2ebae20f4e67bdaf8f321609b3307d92c6d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133245
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-01-31 06:37:02 +00:00
Stephen Adams
5b2da85e25 [dart2js] Make 'return null;' more reliable
The reduction 'return null;' --> 'return;' now happens only at return
statements that do not have an expression.

There is a slight increase in code size, 0.11% for flutter gallery
minified, 0.105% for acx gallery minified, 0.04% CM.

Change-Id: I0723a398267aede5e8dd04d7d45beae2f306c1be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133863
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-01-31 03:06:36 +00:00
Ryan Macnak
38eed7f6d5 [vm, service] Create a treemap from very large heap snapshots outside of the browser.
Usage:
$ dart runtime/observatory/bin/heap_snapshot.dart http://127.0.0.1:8181/q8Zq2o7rEJc=/
...
Wrote file:///tmp/heap-snapshotZWSNFF/merged-dominator.html

Change-Id: I187296b643cdad884209e459f639cfe8bcae6fe4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133861
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-01-31 02:09:17 +00:00
Nicholas Shahan
40e816b456 [dartdevc] Apply lints and cleanup violations
- always_require_non_null_named_parameters
- prefer_final_fields

Change-Id: I21dc5a9514fe2a7bb09c91fe28b2d4b79d7991e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133840
Auto-Submit: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2020-01-31 00:47:26 +00:00
Brian Wilkerson
26fec2ef66 Add return types to methods in analysis_server
Change-Id: I6149cd21df4df44aee0374db32e47e849aa9a960
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134047
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-31 00:26:49 +00:00
Liam Appelbe
00e481aab0 [vm] Reland the flag flip behind the --nnbd build flag
Bug: https://github.com/dart-lang/sdk/issues/40409
Bug: https://github.com/dart-lang/sdk/issues/40179
Change-Id: Ib84926ef15068d23dcac7b89843c454b8446b28e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134062
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2020-01-30 23:41:19 +00:00
Konstantin Shcheglov
d550879d9d Implement runtime type equality.
Change-Id: I603b5147d7d7e6d8e7267be9c861324b575f259d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134041
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-30 22:59:43 +00:00
Brian Wilkerson
5d7f3093fd Update the lsp generator to generate return types for all methods
Change-Id: Id1a90d770aa772327011ee8ccc7a13f0ca6f8de4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133961
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-30 21:43:43 +00:00
Brian Wilkerson
58a9c22f80 Add return types to more methods in analysis_server
Change-Id: I65bed353bcff4f991faf8c3bdde979789a8d962b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134000
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-30 21:43:34 +00:00
Paul Berry
aa5a5ff5a8 Migration: Improvements to graph debug output.
Two minor fixes:

- Ensure that the immutable nodes `always` and `never` are always
  drawn with the `shape=none` attribute.  (Previously, the first time
  we encountered an immutable node we would draw it in the style of a
  mutable node, which made things very confusing).

- Add a space before `style=filled` in the graphviz output.
  Previously we would output things like
  `n21 [label="type(13) (ordinary nullable)"style=filled]`,
  which graphviz seems to do ok with but seems inadvisable.

Change-Id: Iefcb4005c9bb2e24ae8d80552e5e4a23ec062c56
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133868
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-30 21:33:12 +00:00
Paul Berry
ab6d0ef178 Migration: change implicit downcasts to explicit ones when necessary.
Note that downcasts from dynamic may still be implicit.

Fixes #38481.

Change-Id: I35558ed3578707cc640108b85790adb042e88ee2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133865
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-30 21:33:12 +00:00
Liam Appelbe
bf5278bdd4 Revert "[vm] Set non_nullable_flag() to true"
This reverts commit 61b4bbcb6b.

Reason for revert: Performance regressions

Original change's description:
> [vm] Set non_nullable_flag() to true
> 
> We'll leave the deletion and cleanup of this function until later, so
> that this CL is as easy to rollback as possible.
> 
> Bug: https://github.com/dart-lang/sdk/issues/40179
> Change-Id: Ie583aaabd117ae06ea27a539c3bc904240a0e6bc
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133429
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Commit-Queue: Liam Appelbe <liama@google.com>

TBR=asiva@google.com,liama@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: https://github.com/dart-lang/sdk/issues/40179
Change-Id: I7e1d81286d769faeacec7dc17612ff18d157f114
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134060
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2020-01-30 20:51:23 +00:00
Sigmund Cherem
13e3189a2c re-add web libraries as part of the sdk
This undoes what we did to get the sdk building earlier. Most tests in lib_2
had runtime failures because native elements were not tagged as such.

Besides re-adding dart:html et al to the list of compiled libraries, this ensures
we handle native/extension types properly.

(See #39698)

Change-Id: Ib8516c6d92d12d0f5dccdb5a6cf66e0990b52aff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133869
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-01-30 19:00:07 +00:00
Zichang Guo
162d6c5634 Revert "[vm] Add support for real unboxed floating point fields in AOT"
This reverts commit 9eb531bde4.

Reason for revert: Bots are red. Some tests are failing.

https://ci.chromium.org/p/dart/builders/ci.sandbox/vm-kernel-precomp-obfuscate-linux-release-x64/6039

https://ci.chromium.org/p/dart/builders/ci.sandbox/vm-kernel-precomp-android-release-arm_x64/957

Original change's description:
> [vm] Add support for real unboxed floating point fields in AOT
> 
> Non-nullable floating point fields (double, Float32x4, Float64x2)
> are fully unboxed in their classes.
> 
> A bitmap for each class was added to the shared class table in order to keep
> track of the pointers of the classes. Since all classes in Flutter Gallery
> have less than 64 fields, the bitmap is represented by a 64 bit integer and
> fields whose offset is more than 64 words are not unboxed.
> 
> The instance sizes and field offsets might change between target and host
> in cross-compilation, since the number of words used to store unboxed fields
> may differ.
> 
> dart-aot Xeon
> 
>   SplayLatency               -4.62%
>   SplayHarderLatency         -4.17%
>   NavierStokes               -2.20%
>   Tracer                      8.72%
>   ParticleSystemPaint         2.90%
>   NBodySIMD                   8.35%
>   NBody                      25.59%
> 
> With hack TFA to make doubles in Rect/Offset/Size classes in flutter non-nullable:
> 
> flutter arm-v8:
> 
>   gallery total size: -1%
> 
>   matrix_utils_transform_rect_perspective   -16.70% (less is better)
>   matrix_utils_transform_rect_affine        -31.82% (less is better)
>   matrix_utils_transform_point_perspective  -24.90% (less is better)
>   matrix_utils_transform_point_affine)      -27.26% (less is better)
>   rrect_contains_bench                      -4.719% (less is better)
> 
> Change-Id: I9ae09c9c3167d99f9efd071a92937aa51093fd1d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131824
> Commit-Queue: Victor Agnez Lima <victoragnez@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Samir Jindel <sjindel@google.com>

TBR=kustermann@google.com,rmacnak@google.com,sjindel@google.com,victoragnez@google.com

Change-Id: Ic73858f6adb7f55c4129d4f46ff4731b378cb634
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134020
Reviewed-by: Zichang Guo <zichangguo@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2020-01-30 18:13:28 +00:00
Ryan Macnak
d67fbe525b [vm, gc] Base the growth policy on usage instead of capacity.
With concurrent sweeping, the amount of capacity freed by a major GC is not known at the time growth is evaluated. This consistently biases the policy into growing more than it would with an accurate capacity from stop-the-world sweeping.

This is more interesting for larger heaps and when there is a tighter memory limit.

For a very large dart2js compile
Max Heap Capacity: 13.057 -> 11.861 GB
     Compile Time:    545 -> 472 seconds

For dart2js self-compile
Max Heap Capacity: 1.343 -> 1.385 GB
     Compile Time:  43.4 -> 43.5 seconds

Bug: https://github.com/dart-lang/sdk/issues/21364
Change-Id: If047e22a9cd9da6b34c8e499a39fde97427a69b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133660
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-01-30 17:54:08 +00:00
pq
fccae66fa6 require type for dynamic var decl splits
Fixes: https://github.com/dart-lang/sdk/issues/40239

Change-Id: I67da61874bdba2f27381436b009687ed2f3810e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133960
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-01-30 17:50:28 +00:00
pq
9a572c70fa call() suggestions for FunctionTypes
Fixes: https://github.com/dart-lang/sdk/issues/40270

Change-Id: Ic6f882391d1450b43cc224d5ec908589239c590e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133941
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-01-30 17:43:40 +00:00
Sam Rawlins
bad477ded3 NNBD preview: properly render deleted regions
Fixes #40295; fixes #40314

Change-Id: I28d60754d601cbf8cd3403cc576d55e7a0c12e9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133870
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-01-30 17:33:28 +00:00