Commit graph

64274 commits

Author SHA1 Message Date
Nicholas Shahan 35519bb13a Add DDC CHANGELOG entry intended for D24 release
Change-Id: I4420abd857b17f0135e7e879e9188843bb54f2b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106022
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-06-13 22:48:57 +00:00
Brian Wilkerson a19611b079 Improve test coverage for constructor parameters
Change-Id: Ia1a803bd52e94e15696c60c77938fd2f5c08bdaf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105981
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-13 22:20:26 +00:00
Nicholas Shahan 611ed823f0 [dartdevc] Add packages arg for creating the DDC SDK from kernel
Copied from a change by keertip@ from internal repo.
Original change ID: 253076358

Change-Id: I997ffe7c4fa0588689a2562b7b1dcd5c01837919
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106002
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-06-13 21:58:16 +00:00
danrubel 1a9801e9fa mark ExperimentalFeature bogus_enabled and bogus_disabled as deprecated
... and update comment and test output to indicate how files should be
regenerated from tools/experimental_features.yaml

Change-Id: I369b93c35b91f7a93c915f0abf9cebdd00c13f8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106003
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Dan Rubel <danrubel@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-06-13 21:30:05 +00:00
Stephen Adams fa0fe94b57 [dart2js] Generate new-rti SSA instructions for checks
There is no codegen yet so almost all code compiled with
--experiment-new-rti will crash the compiler.

Change-Id: Idf542646ac3629cb02a50d44c2a98abd156047ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106001
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-06-13 21:21:20 +00:00
Mark Zhou 60c04b8f44 [dartdevc] DDK now outputs relative paths in source maps
Bug: https://buganizer.corp.google.com/issues/133784498
Change-Id: Ifbaae661ac401d0a935a100fbbb7fa2e42325abc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105703
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2019-06-13 21:16:45 +00:00
Ryan Macnak 112dbabc10 [vm] Update Megamorphic::filled_entry_count_ under the megamorphic lock.
Otherwise the background compiler may see 0 when the mutator grows the megamorphic cache.

Bug: https://github.com/dart-lang/sdk/issues/37257
Change-Id: I64a31937391ad6c0f086f8f175501ca4ef06c305
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105969
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-06-13 21:13:15 +00:00
Liam Appelbe 0f91731f98 Add Thread::optimize_(stub|entry) to runtime_api.h
Bug: https://github.com/dart-lang/sdk/issues/36839
Change-Id: Iab35c6bb322492872577545aaacc5147a76f2708
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105920
Auto-Submit: Liam Appelbe <liama@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-06-13 19:57:35 +00:00
Ryan Macnak d6eac664ee [vm] Hoist zone access in function name printing.
Change-Id: I97166486514044d0a8396cbc6bf92ae391ac4437
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97276
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-06-13 19:24:16 +00:00
Aart Bik fa7fc5fb25 [dart/fuzzer] added another ignored parameter
Rationale:
Avoids rejecting extra parameter when running
on cluster for nightly testing.
Change-Id: I34a5e02638ec93f602609e32f5e460e774656f35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105968
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-06-13 19:05:04 +00:00
Brian Wilkerson e9f17ae8e8 Convert some NPEs into explicit throws and add the missing visit methods discovered by doing so
Change-Id: I0613614168a7373a460d05cf8470f9b59264de0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105970
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-13 18:51:44 +00:00
Aadil Maan 9b55e3027a Update CHANGELOG.md for Dart 2.4.0 stable
Closes #37239
https://github.com/dart-lang/sdk/pull/37239

GitOrigin-RevId: 534651bc9dcf23672d829b92b07f985a3ccd529d
Change-Id: I7d53f304ebbb73ac09d3cb0157ffc2aa4e66471e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105727
Commit-Queue: Aadil Maan <aadilmaan@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2019-06-13 18:31:05 +00:00
Brian Wilkerson 9676ca0ff9 Support constructor invocations with arguments
Change-Id: I2d537121efd29f051d8f533c6f58e0ad10835301
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105964
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-13 18:29:10 +00:00
Régis Crelier 24c6c6f996 [vm/fuchsia] Make use of the new alignment flags when allocating memory.
Change-Id: I05994746156b35ad29d311461933359922de9959
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105545
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2019-06-13 18:25:40 +00:00
Konstantin Shcheglov 41a23711d9 Support for LinkedElementFactory in getLibraryElement().
R=brianwilkerson@google.com

Change-Id: I82d613d33beaaa8c46a718996993fd4c8e584d3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105966
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-13 17:50:30 +00:00
Konstantin Shcheglov f9c2e3856b Store exactly GenericTypeAliasElement with FunctionType(s).
R=brianwilkerson@google.com

Change-Id: I128eaf7852eb23031d843e1d970cf62b6c975fc8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105967
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-13 17:50:17 +00:00
Nicholas Shahan 1e92103181 [dartdevc] Fix violations of avoid_relative_lib_imports lint
Issue: #37218
Change-Id: Id248e378d6fbe832952b8e61102da7f68536f81b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105861
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2019-06-13 17:30:17 +00:00
Paul Berry 9d3afa537e Compute parameters before calling DecoratedType constructors.
This will allow me to put stronger assertions in the DecoratedType
constructor in a follow-up CL.

Change-Id: I375ae2b33c2f14948d9fedbdfbc000b8a1057b00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105963
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-13 17:06:16 +00:00
Mike Fairhurst 8a5495700a Clean up null aware access test
Change-Id: I893b4cea44278d114160331b69d06d92d0e56cf1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105735
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-06-13 17:04:06 +00:00
Dan Rubel c530c333bb Update null-aware nnbd "?.[" operator recovery
This sets the "?.[" endGroup to "]" for proper token stream structure
and parser recovery.

Change-Id: Ie4147ac5dedcc273ea6cfda6dafc5d91e892b1a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105980
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-06-13 16:53:26 +00:00
Dan Rubel 45f39fe70d update scanner/parser to handle null-aware index operator
This adds support for the nnbd `?.[` operator as specified in
https://github.com/dart-lang/language/pull/293/files#diff-dbeaf678924df9f8a2ca9f5d12e26d3eR11513

Change-Id: I11547cf875439fef9fe22d4f4ac5ab912b3759d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105902
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-13 16:53:26 +00:00
Brian Wilkerson 90b55959a4 The name of an extension is optional
Change-Id: I6d73538e2ae2d90b0347c4ee03df4422a442ab75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105965
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-13 16:28:21 +00:00
Daco Harkes 04c1a2886f [vm/ffi] SimDBC64 align stack frame
And regression test for dartbug.com/37069

Fixes: https://github.com/dart-lang/sdk/issues/37176
Follow up of: https://dart-review.googlesource.com/c/sdk/+/103814
Bug: https://github.com/dart-lang/sdk/issues/37069
Change-Id: I066561b487c691952496e2ca6878ac82cee0e02e
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try, app-kernel-linux-debug-x64-try, vm-kernel-linux-debug-simdbc64-try,vm-kernel-mac-debug-simdbc64-try,vm-kernel-reload-mac-debug-simdbc64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105941
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2019-06-13 16:26:40 +00:00
Zichang Guo ce9a582b05 [vm] RFC6874 support zoneID in uri parser
An implementation of https://tools.ietf.org/html/rfc6874.

IP-literal = "[" ( IPv6address / IPvFuture  ) "]"

will be updated to:

IP-literal = "[" ( IPv6address / IPv6addrz / IPvFuture  ) "]"
ZoneID = 1*( unreserved / pct-encoded )
IPv6addrz = IPv6address "%25" ZoneID

Bug: https://github.com/dart-lang/sdk/issues/29456
Change-Id: Ieac7b00e97d3ceff794f3b56ed4b6e4d9d6bbb47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103544
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-06-13 16:19:35 +00:00
Brian Wilkerson 39c629f4aa Clean up uses of deprecated methods in legacy type asserter
Change-Id: I7f7288d57e69a488728dc81e5af5476a27d3dbc0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105860
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-13 16:12:00 +00:00
Paul Berry dad07f8156 Migration: Fix return value of GraphBuilder.visitTypeName.
The return value of the GraphBuilder visit methods should always be
the type of the AST node assuming it's used as an expression.  When a
type name is used as an expression, its type is always a non-null
reference to the built-in type `Type`.

(Note: this wasn't causing any failures, but fixing it will allow me
to add stronger assertions in a follow-up CL.)

Change-Id: I62c72dcfc6c0f12f8d8a1a7de34a1d3f94c5e4f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105962
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-13 16:11:30 +00:00
Paul Berry cba75a1d1d Migration: fix accidental hardcoded 0 in GraphBuilder.visitTypeName
Change-Id: I4d75bc286fe8d5dfe063b30525a99dacc96b4ec6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105961
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-13 15:21:50 +00:00
Paul Berry e5f069b5dd Migration: add missing type annotation
Change-Id: Ie219297a4ffe203e0b15157471a2a59f1b1029a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105960
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-13 15:21:50 +00:00
danrubel d6f5a245b2 parser error token cleanup
This removes one location where ErrorToken processing is no longer needed
in the parser, and updates the analyzer parser tests to use scanString
rather than instantiating the scanner directly.

Change-Id: I399d771004af7f9fe25d19c1065fbfd425416edc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105901
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-06-13 14:30:10 +00:00
danrubel 8adde6b603 make extension declaration name optional
This CL updates the parser to parse extension declarations where
the extension name is omitted. For more details, see
https://github.com/dart-lang/language/pull/303/files#diff-9b84d2e3c88265bde2eb43544ddb757dR66

This change explicitly does not handle the case `extension on on on { … }`.
A subsequent CL should either make `on` a builtin
or add more lookahead in the parser to allow this edge case.

Change-Id: Ided821192770f88a51a3300fed8cb0fdef9eea3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105900
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-06-13 14:29:40 +00:00
Alexander Thomas 9e2aaad7a5 [infra] Fix detection of output directory for core dump archiver
The recipe switched from --output_directory to --output-directory in
https://crrev.com/c/1643427 but the core dump archiver was still
attempting to detect the old property. This caused it to attempt to
upload dumps with gsutil rather than moving the dumps to the output
directory.

Change-Id: Ia73b294eae280ba45b5acf40ec495aba51732694
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105942
Auto-Submit: Alexander Thomas <athom@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2019-06-13 14:16:00 +00:00
Johnni Winther f889bd7067 Delete JavaScriptBackend
* move names to Identifiers
* move resolution parts to front end strategy
* move codegen parts to backend strategy
* remove now unneeded methods from FrontendStrategy and BackendStrategy

Change-Id: I0675d56045dd212ad195177ecd23b27b0d849a80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105742
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-06-13 10:09:46 +00:00
Aske Simon Christensen 50efd7f187 [Kernel] Add list of unused arguments to InstanceCreation nodes.
During constant evaluation, unused arguments to a const constructor are
thrown away after evaluation, since their values do not affect the
resulting instance constant. If such an unused argument ends up
unevaluated, any errors that would arise in the final evaluation are
not reported.

This CL adds space in the Kernel AST for saving these unevaluated
expressions so they can be checked during final constant evaluation.

Even though this is an incompatible change, no update is needed to the
VM code (except for the version bump), since the VM does not support
InstanceCreation nodes in the first place.

Change-Id: I4752562c1164efbba79eb018c15b07ed8354ce5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105761
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2019-06-13 09:42:26 +00:00
Danny Tuppeny 06b28fc60f Filter TODOs out of LSP diagnostics
Change-Id: I4a089be3919e0a2ed6c1e54e712ba7f1c9d835aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105762
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-06-13 07:31:36 +00:00
Stephen Adams 68dadda21c Add other terminal Rtis
Change-Id: If70dc283a5fb06fa0d037fb0d30e4ba19352f8d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105736
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-06-13 00:22:28 +00:00
Mike Fairhurst 23d3e8a25f Land new subtyping algorithm; more tests but still not comprehensive.
Includes changes to implicit covariance test.

To redescribe this, for some tear-off C<T>.f, the member type may be
contravariant if T is referenced by a parameter of C<T>.f (such as if it
is of type void Function(T)). This must be a runtime failure if C<T> is
a reference which has been covariantly upcast at runtime. For example,
List<Object>.add, where the list is at runtime an instance of List<int>,
results in a static type of void Function(Object), but a runtime type of
void Function(int), which is unsound.

We omit these checks, however, when it is trivially sound for all cases
Previously, this was the case for tearing off `List<Null>.add`. This is
no longer a valid test case for NNBD where the runtime type of that list
could actually be `List<Never>`.

Therefore the test has been changed to expect `List<Null>.add` to result
in a cast, and a new NNBD test case has been added to test `List<Never>`
cases don't get a cast.

Change-Id: I61d024a249e2c2a249ad5a8037cbe3d103e3ea8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104361
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-06-12 23:48:48 +00:00
Brian Wilkerson 52ae429a9e Add some minimal support for instance creation expressions
Change-Id: I7184b8b5955d61e0d1452a8ff071aaab8ceb5dce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105728
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-06-12 23:47:39 +00:00
Nicholas Shahan aaf7d2023f [dartdevc] Fix violations of unawaited_futures lint
Issue: #37218
Change-Id: I736afd1a339be0573126ed2184b9a04e0ab73f8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105781
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-06-12 23:27:17 +00:00
Paul Berry eec587e97d Migration: address a more complex case of instantiate-to-bounds.
Change-Id: I8a7d5e2e4189c3d910077ad4ec88e6c4e384dc25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105731
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-12 23:03:57 +00:00
Paul Berry f2cc27ffbf Migration: preliminary support for interface types without type parameters.
I'll build on this in future CLs to address more complex cases, where
the type is instantiated to a bound.

Fixes #37213.

Change-Id: I1e23c5599557ef17177483222f15b1a7985b9ca8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105726
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-12 23:03:57 +00:00
Samir Jindel 68b2d53da5 Revert "[vm/ffi] SimDBC64 align stack frame"
This reverts commit f1038ee771.

Reason for revert: breaks function_gc_test on ARM64

Original change's description:
> [vm/ffi] SimDBC64 align stack frame
> 
> And regression test for dartbug.com/37069
> 
> Fixes: https://github.com/dart-lang/sdk/issues/37176
> Follow up of: https://dart-review.googlesource.com/c/sdk/+/103814
> Bug: https://github.com/dart-lang/sdk/issues/37069
> Change-Id: I2c791271f936580d66a48485a60ab6cddb1ba4f8
> Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try, app-kernel-linux-debug-x64-try, vm-kernel-linux-debug-simdbc64-try,vm-kernel-mac-debug-simdbc64-try,vm-kernel-reload-mac-debug-simdbc64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104824
> Commit-Queue: Daco Harkes <dacoharkes@google.com>
> Reviewed-by: Samir Jindel <sjindel@google.com>

TBR=sjindel@google.com,dacoharkes@google.com

Change-Id: Ibefa2e854f4a58b41384aca73a3bbbe86d75bf80
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/37069
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try, app-kernel-linux-debug-x64-try, vm-kernel-linux-debug-simdbc64-try, vm-kernel-mac-debug-simdbc64-try, vm-kernel-reload-mac-debug-simdbc64-try, vm-kernel-linux-debug-ia32-try, vm-dartkb-linux-debug-simarm64-try, vm-kernel-win-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105840
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-06-12 22:31:11 +00:00
Ryan Macnak 1e24fe7d69 [vm, compiler] Specialize unoptimized monomorphic and megamorphic calls.
dart-bytecode, arm64:            +4.742% geomean
dart-bytecode-jit-unopt, arm64: +12.73% geomean
dart2js-compile, x64:            +3.635% geomean

In the polymorphic and unlinked cases, call to a stub the does a linear scan against an ICData.

In the monomorphic case, call to a prologue of the expected target function that checks the expected receiver class. There is additional indirection in the JIT version compared to the AOT version to also tick a usage counter so the inliner can make good decisions.

In the megamorphic case, call to a stub that does a hash table lookup against a MegamorphicCache.

Megamorphic call sites face a loss of precision in usage counts. The call site count is not recorded and the usage counter of the target function is used as an approximation.

Monomorphic and megamorphic calls sites are reset to the polymorphic/unlinked state on hot reload.

Monomorphic and megamorphic calls sites do not check the stepping state, so they are reset to the polymorphic/unlinked state when stepping begins and disabled.

Back-edges now increment the usage counter in addition to checking it. This ensures function with loops containing monomorphic calls will eventually cross the optimization threshold.

Fixed backwards use of kMonomorphicEntryOffset and kPolymorphicEntryOffset.

Fixed C stack overflow when bouncing between the KBC interpreter and a simulator.

Bug: https://github.com/dart-lang/sdk/issues/26780
Bug: https://github.com/dart-lang/sdk/issues/36409
Bug: https://github.com/dart-lang/sdk/issues/36731
Change-Id: I78a49cccd962703a459288e71ce246ed845df474
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102820
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-06-12 21:56:53 +00:00
Ryan Macnak f005bd5a3e [vm] Harden access to unchecked natives.
Bug: https://github.com/dart-lang/sdk/issues/37234
Change-Id: I567b3fa177e89db50345e174a07c98b10c53f102
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105721
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-06-12 21:32:33 +00:00
Alexander Markov fa28d5b912 [tests] Update failing standalone_2/io/http_* tests for Dart 2
Change-Id: I80cff0d2f864828386f1b8711810e960bbe00f3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105729
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-06-12 21:17:12 +00:00
Stephen Adams b981798e3a Add environment.bind operation.
Change-Id: I2fd5d4b87e7fdd1fe75f064ec82c43a8334c2138
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105722
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-06-12 21:15:22 +00:00
Mike Fairhurst 2f65830aeb Add null checks for spread operator
Change-Id: Ib3b0f46643a24e22e0344a4505743518f885e9e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102501
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-06-12 20:58:03 +00:00
Ryan Macnak 31d5ba8790 Reapply "[vm, interpreter] Bytecode support for dynamic invocation forwarders."
Add missing entries to RAW_CLASSES_AND_FIELDS.

Change-Id: Ib90f4878d3eff81a6a059f7e38f1d6593cd85cfc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105820
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-06-12 20:51:44 +00:00
Paul Berry 3f83aeb493 Migration: add the ability to "union" nullability nodes.
This will simplify some situations where nullability migration would
otherwise have to visit the source code in a very careful order.  For
example, when analyzing top level fields undergoing type inference, we
can simply create a node for the nullability of each top level field,
and then later use the "union" operation to hook up those nodes to the
nodes resulting from analyzing their initializers.  Without the union
operation, we would have to be careful to visit the top level fields
in dependency order.

Change-Id: I3b07e1abccc5b1c9f1c7c9fa7b13fb6af60c07d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105800
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-12 20:10:24 +00:00
Paul Berry 0b5e37a429 Migration: Make always/never instance fields of the nullability graph.
Previously, they were static, which made them easier to access, but
made it difficult to track their edges (because we couldn't safely
mutate them, so we had to store their edges in special fields of
NullabilityGraph).  Now that we're passing NullabilityGraph all over
the place anyhow, there's no benefit to making them static anymore.

Change-Id: Ia3e7d32ae479f40f505621e5d6df04060e39b1c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105723
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-12 20:10:24 +00:00
Aart Bik fa6fce61fa [dart/vm] Improved inlining methods and heuristics
Rationale:
Previous method cached graph information (instruction and call site
counts) on a per-function level, not accounting for potential
specializations. The improved method runs an extra constant folding
pass, and only caches per-function information for non-specialized
cases. As a result, we inling much better, see for example, the
added test as illustration.

Since we no longer cache for constants, compile-time may be increased
a bit due to the extra scan. In the long run we should consider
for common constant "situations" as the call site.

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

Change-Id: I19f007c7f1860ad0ea88fafb38695dc154189ad5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105460
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-06-12 19:39:10 +00:00