Commit graph

69938 commits

Author SHA1 Message Date
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
Mayank Patke
a52d6ea9b9 [dart2js] Fork backend subtyping into legacy and null-safe variants.
Change-Id: I64a20b5c64d700b873ac6210e5845c8d59192991
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133331
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-01-30 17:02:38 +00:00
Sam Rawlins
637a801e64 Use 'enum' and 'mixin' with undefined getters, methods, operators, setters
Fixes #40177

Change-Id: I0b416a4e77d3d1c5afc1712301c5cf1ea4cfc8d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133043
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-01-30 17:01:58 +00:00
pq
ca3c83b654 remove unneeded <Widget> assist/fix annotations
See: https://github.com/dart-lang/sdk/issues/40378

Change-Id: If404a3c248ee671f6f3ac9e07848ad71faf45e67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-01-30 16:50:28 +00:00
Martin Kustermann
62835950d1 [vm/nnbd] Disable usage of specialized type testing stubs for NonNullable/NNBD types
The following issue can happen:

  When we performa a type-test against a type parameter the TTS stub for
  the type parameter will call the TTS stub for the type argument of the
  parameter (by loading it from the instantiator type arguments).

  The (instantiated) type argument does not yet have a specialized TTS but
  rather the lazy TTS stub, which will got to the runtime.

  The runtime will instantiate the type parameter using the instantiator tav,
  which will give it a non-nullable 'String!'. Though the NNBD mode used
  for instnatiation is kLegacy, which means the instantiation will
  actually return 'String*'.

  Now we generate a specialized TTS and install it on 'String*'.

  => The original 'String!' will still have the lazy TTS installed and we
     will therefore always go to runtime.

Example:

  This code is massively slowed down after 61b4bbcb6b "[vm] Set non_nullable_flag() to true"

    main(List<String> args) {
      args = args.toList();
      while (args.isNotEmpty) {
        args.removeAt(0);
      }
    }

  The embedder creates the List<String> when calling main. The embedder
  API uses effectively `ObjectStore::string_type`, which is initialized,
  after 61b4bbcb6b to 'String!' (which might be a bug because we do
  have a specific `ObjectStore::non_nullablestring_type`).

=> For now we disable lazy specialization of non-nullable types - which
   makes us fall back to subtype test cache searches in this case (which is
   significantly slower).

See b/148528639

Issue https://github.com/dart-lang/sdk/issues/39755

Change-Id: I715fe2a9ee22932ae2d949b5cef93d6afb3176d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133981
Reviewed-by: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-01-30 16:41:58 +00:00
Alexander Markov
c307d38af8 [vm/nnbd] Draft support for TypeRefs in CheckInstantiatedNullability
TypeRefs which are used to represent recursive types are now skipped
and removed when we need to change nullability of  type after
instantiation. This change assumes that we only need to change
nullability of a top-level type and not inner types.

Change-Id: I5e92493991f0e2a1ebeb16535ef9d507054017b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133841
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-01-30 16:38:58 +00:00
Jonas Termansen
f6e0200523 [nnbd] Migrate dart:io to NNBD.
The Process class will now throw a StateError if the process is detached
upon accessing the stdin, stdout, stderr, and exitCode getters.

The Socket class will now throw a SocketException if the socket has been
destroyed or upgraded to a secure socket upon setting or getting socket
options.

Bug: https://github.com/dart-lang/sdk/issues/40040
Change-Id: I68e22873932c68a3fac549c0f742dd49d0a60dfb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133060
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-01-30 15:46:08 +00:00
Janice Collins
1a6a5b997d Implement FantasyRepo.
Clone and update repositories.  Basic end to end test and a primitive
mocking setup using dependency injection for testing.

Change-Id: I3a61f6fd86da6d5b8d79c0124a756dbfc70c4614
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133744
Commit-Queue: Janice Collins <jcollins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-30 15:43:18 +00:00
Brian Wilkerson
d6206fbbc7 Add return types to more tests in analysis_server
Change-Id: Ib85d299a34cfda6bc4772d53f16d9ba44251bfbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133900
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-30 14:30:18 +00:00
Johnni Winther
5fb7223b9a [cfe] Handle parameter type inference for mixed inheritance
Closes #39207

Change-Id: Idaac1dcf6980fdebff326002adc466cb06fd0c91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133781
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-01-30 14:26:38 +00:00
Victor Lima
9eb531bde4 [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>
2020-01-30 13:45:08 +00:00
Johnni Winther
7248e98023 [cfe] Support nnbd platform without experiment enabled
All handling of the opt-out features were guarded by the experimental flag.
With this CL the opt-out semantics is used irregardless of the
the experimental flag. This supports compiling with opt-out semantics
against libraries which have been compiled with the flag enabled, as will
be the case when the nnbd sdk is unforked.

Closes #40334

Change-Id: I2df5c700f97844bdd3e33bccba7e72013f0c831e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133780
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-01-30 12:56:26 +00:00
Johnni Winther
e1e0ae5898 [cfe] Demote inferred declaration types
Change-Id: Ibe6709219bd8d9dff80ad260ff8f6025cd74111a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133588
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-01-30 10:03:25 +00:00
Teagan Strickland
5d5ebb58e9 [vm] Add VM and isolate instructions start to DumpStackTrace.
Change-Id: Iba1f5948f5de9d22e7276fdc08a4f4fda59285bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133582
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Teagan Strickland <sstrickl@google.com>
2020-01-30 09:18:25 +00:00
Sam Rawlins
7a3e1e7384 NNBD Preview: Fix region detail links to _not_ be POST links
Additionally fix un-highlighting upon new highlight.

Change-Id: I4ee85371bec11ed70cc31798519cdea3061474d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133864
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-01-30 05:02:30 +00:00