Commit graph

67290 commits

Author SHA1 Message Date
Ryan Macnak
71ecb73a2b [vm] Fix one MSAN failure; add UBSAN configuration.
Change-Id: I5b1d43836f3eb09983195fc3792f369aa3f8079f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120750
Reviewed-by: Chinmay Garde <chinmaygarde@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-10-09 23:38:30 +00:00
Nicholas Shahan
50d972bba0 Build DDC targets with forked SDK sources when building with --nnbd flag
Issue: #38665

Change-Id: I42eb4e97f3269f7d1a53abeac62f9293a003ae60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120400
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2019-10-09 23:24:21 +00:00
pq
795949de00 fix loopVariable null access
See: https://github.com/dart-lang/linter/issues/1759

Addresses Object.noSuchMethod:

00:53 +313 -3: rule dart (config: nnbd) omit_local_variable_types [E]
  NoSuchMethodError: The getter 'declaredElement' was called on null.
  Receiver: null
  Tried calling: declaredElement
  #0      Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
  #1      ResolverVisitor.visitForStatementInScope (package:analyzer/src/generated/resolver.dart:3993:30)
  #2      ScopedVisitor.visitForStatement (package:analyzer/src/generated/resolver.dart:5477:7)
  #3      ForStatementImpl.accept (package:analyzer/src/dart/ast/ast.dart:4772:49)
  #4      NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:7682:20)
  #5      BlockImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:1115:17)
  #6      ResolverVisitor.visitNode (package:analyzer/src/generated/resolver.dart:4286:10)
  #7      UnifyingAstVisitor.visitBlock (package:analyzer/dart/ast/visitor.dart:3128:31)
  #8      ScopedVisitor.visitBlock (package:analyzer/src/generated/resolver.dart:5187:13)
  #9      BlockImpl.accept (package:analyzer/src/dart/ast/ast.dart:1111:49)
  #10     BlockFunctionBodyImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:1070:13)
  #11     ResolverVisitor.visitNode (package:analyzer/src/generated/resolver.dart:4286:10)
  #12     UnifyingAstVisitor.visitBlockFunctionBody (package:analyzer/dart/ast/visitor.dart:3131:55)
  #13     ScopedVisitor.visitBlockFunctionBody (package:analyzer/src/generated/resolver.dart:5198:13)
  #14     ResolverVisitor.visitBlockFunctionBody (package:analyzer/src/generated/resolver.dart:3522:13)
  #15     BlockFunctionBodyImpl.accept (package:analyzer/src/dart/ast/ast.dart:1066:49)
  #16     FunctionExpressionImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:5088:12)
  #17     ResolverVisitor.visitNode (package:analyzer/src/generated/resolver.dart:4286:10)
  #18     UnifyingAstVisitor.visitFunctionExpression (package:analyzer/dart/ast/visitor.dart:3263:57)
  #19     ScopedVisitor.visitFunctionExpression (package:analyzer/src/generated/resolver.dart:5524:13)
  #20     ResolverVisitor.visitFunctionExpression (package:analyzer/src/generated/resolver.dart:4050:13)
  #21     FunctionExpressionImpl.accept (package:analyzer/src/dart/ast/ast.dart:5082:49)
  #22     FunctionDeclarationImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:4941:26)
  #23     ResolverVisitor.visitNode (package:analyzer/src/generated/resolver.dart:4286:10)
  #24     UnifyingAstVisitor.visitFunctionDeclaration (package:analyzer/dart/ast/visitor.dart:3256:59)
  #25     ScopedVisitor.visitFunctionDeclarationInScope (package:analyzer/src/generated/resolver.dart:5517:11)
  #26     ResolverVisitor.visitFunctionDeclarationInScope (package:analyzer/src/generated/resolver.dart:4025:11)
  #27     ScopedVisitor.visitFunctionDeclaration (package:analyzer/src/generated/resolver.dart:5510:7)
  #28     ResolverVisitor.visitFunctionDeclaration (package:analyzer/src/generated/resolver.dart:4016:13)
  #29     FunctionDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:4934:49)
  #30     ResolverVisitor.visitCompilationUnit (package:analyzer/src/generated/resolver.dart:3608:23)
  #31     CompilationUnitImpl.accept (package:analyzer/src/dart/ast/ast.dart:2140:49)
  #32     LibraryAnalyzer._resolveFile (package:analyzer/src/dart/analysis/library_analyzer.dart:680:10)
  #33     LibraryAnalyzer.analyzeSync.<anonymous closure> (package:analyzer/src/dart/analysis/library_analyzer.dart:151:7)
  #34     _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:377:8)
  #35     LibraryAnalyzer.analyzeSync (package:analyzer/src/dart/analysis/library_analyzer.dart:150:11)
  #36     LibraryAnalyzer.analyze.<anonymous closure> (package:analyzer/src/dart/analysis/library_analyzer.dart:113:14)
  #37     _PerformanceTagImpl.makeCurrentWhile (package:analyzer/src/generated/utilities_general.dart:258:15)
  #38     LibraryAnalyzer.analyze (package:analyzer/src/dart/analysis/library_analyzer.dart:112:43)
  #39     AnalysisDriver._computeAnalysisResult.<anonymous closure> (package:analyzer/src/dart/analysis/driver.dart:1261:63)
  #40     PerformanceLog.run (package:analyzer/src/dart/analysis/performance_logger.dart:34:15)
  #41     AnalysisDriver._computeAnalysisResult (package:analyzer/src/dart/analysis/driver.dart:1237:20)
  #42     AnalysisDriver.getErrors (package:analyzer/src/dart/analysis/driver.dart:548:41)
  <asynchronous suspension>
  #43     LintDriver.analyze (package:analyzer/src/lint/analysis.dart:220:32)
  <asynchronous suspension>
  #44     DartLinter.lintFiles (package:analyzer/src/lint/linter.dart:87:36)
  <asynchronous suspension>
  #45     testRule.<anonymous closure> (file:///Users/pquitslund/src/repos/linter/test/rule_test.dart:262:54)
  <asynchronous suspension>
  #46     Declarer.test.<anonymous closure>.<anonymous closure>.<anonymous closure> (package:test_api/src/backend/declarer.dart:168:27)
  <asynchronous suspension>
  #47     Invoker.waitForOutstandingCallbacks.<anonymous closure> (package:test_api/src/backend/invoker.dart:242:15)
  <asynchronous suspension>
  #48     _rootRun (dart:async/zone.dart:1124:13)
  #49     _CustomZone.run (dart:async/zone.dart:1021:19)
  #50     _runZoned (dart:async/zone.dart:1516:10)
  #51     runZoned (dart:async/zone.dart:1463:12)
  #52     Invoker.waitForOutstandingCallbacks (package:test_api/src/backend/invoker.dart:239:5)
  #53     Declarer.test.<anonymous closure>.<anonymous closure> (package:test_api/src/backend/declarer.dart:166:33)
  #54     _rootRun (dart:async/zone.dart:1124:13)
  #55     _CustomZone.run (dart:async/zone.dart:1021:19)
  #56     _runZoned (dart:async/zone.dart:1516:10)
  #57     runZoned (dart:async/zone.dart:1463:12)
  #58     Declarer.test.<anonymous closure> (package:test_api/src/backend/declarer.dart:165:13)
  <asynchronous suspension>
  #59     Invoker._onRun.<anonymous closure>.<anonymous closure>.<anonymous closure>.<anonymous closure> (package:test_api/src/backend/invoker.dart:392:25)
  <asynchronous suspension>
  #60     new Future.<anonymous closure> (dart:async/future.dart:176:37)
  #61     StackZoneSpecification._run (package:stack_trace/src/stack_zone_specification.dart:209:15)
  #62     StackZoneSpecification._registerCallback.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:119:48)
  #63     _rootRun (dart:async/zone.dart:1120:38)
  #64     _CustomZone.run (dart:async/zone.dart:1021:19)
  #65     _CustomZone.runGuarded (dart:async/zone.dart:923:7)
  #66     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
  #67     StackZoneSpecification._run (package:stack_trace/src/stack_zone_specification.dart:209:15)
  #68     StackZoneSpecification._registerCallback.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:119:48)
  #69     _rootRun (dart:async/zone.dart:1124:13)
  #70     _CustomZone.run (dart:async/zone.dart:1021:19)
  #71     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:947:23)
  #72     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:21:15)
  #73     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:382:19)
  #74     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:416:5)
  #75     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)




Change-Id: I15b2298f88ee986475736807ef8fd15133e18472
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120928
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2019-10-09 23:02:40 +00:00
Alexander Markov
62ee78eeec [vm,bytecode] Generate calls for causal-async-stacks more consistently
In order to support causal-async-stacks, the following synthetic calls
are inserted: _asyncStackTraceHelper, _setAsyncThreadStackTrace and
_clearAsyncThreadStackTrace.

_asyncStackTraceHelper is always generated in the async transformation.
_setAsyncThreadStackTrace and _clearAsyncThreadStackTrace are inserted
during bytecode generation (or in the flow graph builder in case of AST
pipeline). If bytecode generation options are set inconsistently with
--causal-async-stacks VM option, then it was possible that
_asyncStackTraceHelper was generated but other calls were not generated,
causing incorrect (full, non-truncated) async stack traces. This also
causes performance regression as collecting full stack traces takes
much more time.

This change makes generation of all these calls more consistent: if
causal async stacks are disabled during bytecode generation, then all
three calls are omitted. Also, in case these calls were generated and
present in bytecode, but VM option --causal-async-stacks is disabled,
then bytecode flow graph builder turns all these three calls into no-ops.

Change-Id: I93eb1d83c675ee093799bb8e37ca3d60a3c5c19d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120927
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2019-10-09 22:10:21 +00:00
Ryan Macnak
f4f0831c69 [vm] Fix TSAN failures related to object headers and GC task phases.
Change-Id: I15078e845712e8e712e2cb0a044fc7550127ea36
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120629
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-10-09 21:48:20 +00:00
Paul Berry
164e11b542 Prepare to publish analyzer_plugin version 0.2.1.
Change-Id: If363a80390fdde940cf4421f992c28ae0861a82a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120931
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-10-09 21:48:10 +00:00
jonahwilliams
cc3e22f724 [flutter] expose dartdevc target to incremental compiler
Doesn't do anything with the new target, but establishes a public API for dev_compiler (at least within the SDK)

Change-Id: I4c86b890d3993f96cf32ed0f749608a72a173da6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119526
Commit-Queue: Jonah Williams <jonahwilliams@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2019-10-09 20:02:42 +00:00
Zichang Guo
8866cdb8be [vm] throw exception if directory buffer overflows on Windows
According to https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-readdirectorychangesw,
When using ReadDirectoryChangesW, buffer overflows will still return true. It ends up closing the stream without any notification.
Throw an exception to notify users.

Bug: https://github.com/dart-lang/sdk/issues/37233
Change-Id: I9aebed8b1f30b5e843ad37a51b87d234aa1d8ce6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119524
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2019-10-09 19:59:52 +00:00
Johnni Winther
72bae7be70 [cfe] Handle all bounds checks on extension methods.
Closes #38755

Change-Id: I3d5449950ecb3268436a3033ae16bac590a1e4b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120790
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2019-10-09 19:50:02 +00:00
Martin Kustermann
55d1c95e08 [vm] Fix instruction deduplication for bare-AOT mode
Though we disable deduplication for instance methods because switchable
calls rely on a unique PC -> Code mapping atm.

Change-Id: I80915e97f5e06c3f1251ea3176d5c4f8413a81ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120041
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-10-09 19:45:42 +00:00
Alexander Markov
3bb32f6778 [vm/bytecode] Generate complex conditions more efficiently in bytecode
Change-Id: I7cbf3a91dc96843f10af9560a58269badbe31bac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109729
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-10-09 19:32:54 +00:00
Devon Carew
50d6a3d022 [analyzer] move the ml model from sdk/model to sdk/bin/model
Change-Id: I64aad93770c5c0870c1a5052bb5a1192738f1cf3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120901
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Ari Aye <ariaye@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2019-10-09 19:26:34 +00:00
Nate Bosch
2ffdc54d24 Handle exported extensions in dill library builder
- Add a modular test to demonstrate the bug.
- Handle `Extension` nodes in `finalizeExports`.

Change-Id: Ie16f0c97059d24a122150a607e26fba258d80cfb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120926
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-10-09 18:48:54 +00:00
Paul Berry
89301c3732 Flow analysis: fix tests to pass the correct value to ifStatement_end.
The tests were passing by luck.

Change-Id: I1b44c6d675b59c84e6a6bd70741462d6f29c51e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120922
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-09 18:24:08 +00:00
Paul Berry
88b76997c4 Flow analysis: rework handling of closures.
Rather than suppress all promotions for variables written to in
closures, we track whether a closure might exist that captures a write
to a variable, and only suppress promotions once such a closure
exists.  This is consistent with what is proposed in
https://github.com/dart-lang/language/pull/473.

Contains a repro of #38791.

Change-Id: I4683581908703b510a3231b8fa8ed697121b09da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120680
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-09 18:24:08 +00:00
Ari Aye
4227933c3a Disallow model-only suggestions if static analysis suggests a named argument
Bug: https://github.com/dart-lang/sdk/issues/38404
Change-Id: I72b505cb5bee1f463c0ec6b0a1e9e60c5b7ea518
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117767
Commit-Queue: Ari Aye <ariaye@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-10-09 18:13:48 +00:00
Ryan Macnak
4f752e6598 Reapply "[vm, bytecode] Use CoreTypes and ClassHierarchy from non-incremental front end results when generating bytecode."
Account for null result from kernelForProgram.

Change-Id: Ia4349c68ce023a5714752bf3294ab1e293b1d409
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120749
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-10-09 18:09:58 +00:00
Paul Berry
144b8eda81 Flow analysis: track variables captured in closures more accurately.
Previously, we considered a variable to be captured by a closure if a
write to that variable occurred anywhere inside a local function.  But
that was overly broad; it meant that we incorrectly classified all
written-to local variables of a local function to be captured.

This CL makes the AssignedVariables logic aware of variable
declaration sites, so that it only considers a variable to be captured
if it is written to at a lower level of local function nesting than
its declaration.  As a side bonus, it means that it can now exclude
out-of-scope variables from all sets of closed-upon and written-to
variables, which should make flow analysis faster by preventing it
from spending a lot of time accounting for variables that aren't
visible.

It also adds tracking of the set of all variables written to and
captured within each top level function.

This partially reverts commit 55466fd3cc.

Change-Id: Ibcd6476445addebed13cfc5ecc470d644e519148
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120800
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-10-09 17:34:51 +00:00
Paul Berry
63b93685e9 Migration: change EdgeBuilder to create flow analysis for each variable declaration.
There's no good reason to unify the flow analysis for several
variables declared together, and it would break some assertions I'm
going to add to flow analysis in future CLs.

Change-Id: I4dafb7b5e9b078cb741d506cd0bbfab1bcab5ebb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120840
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-09 17:34:51 +00:00
Paul Berry
2f1e430646 Flow analysis: track assigned variables separately for each top level declaration.
In a follow-up CL, I'm going to add logic to track the complete set of
assigned and captured variables seen so far.  We will need these sets
in order to properly cancel promotions on entry to a closure or nested
function.  But for performance reasons we don't want these sets to
include all variables seen in the entire file; just the local function
is sufficient.

Change-Id: I32a42075916be791f2fb7798814cec4c020e8b3b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120751
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-09 17:34:51 +00:00
Ben Konyi
f5ce3a6e7f [ VM / Compiler ] Fixed issue where TMP was being used as source for store with large offset on ARM
While emitting code for a ParallelMove on ARM32, the TMP register was
being used as a dest/src. When the stack slot offset is large,
StoreToOffset creates a new base in TMP in order to use a smaller
offset. Since the ParallelMove implementation was hardcoding TMP as the
dest/src register, the assert that the register != TMP failed with large
offsets. Now we instead perform a check to see if the offset will fit to
determine whether or not we can use TMP or if we need to fall back and
use LR as our temporary (we can do this since we're in the middle of a
ParallelMove).

Fixes https://github.com/dart-lang/sdk/issues/38654

Change-Id: I4d8cc8b54f6090d86992aabb8ff44d088bc02d3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119584
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-10-09 17:06:00 +00:00
Brian Wilkerson
091568dcc9 Rework the way tag insertion works to allow nested tags and multiple tags for the same region
Change-Id: I8f014fe7bdae72c21d5df4f5e45169c610df632e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120921
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-10-09 16:25:30 +00:00
Jens Johansen
41d13f0ffe [CFE] Cleanup unused parts in uriToSource
Change-Id: Ie26fb25a0394999df1c681296ef96a90d51d8c13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120789
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-10-09 13:28:12 +00:00
Jens Johansen
f09edd1d32 [CFE] Add incremental serializer
Add an incremental serializer that can be used to avoid re-serializing
the same thing again and again.
It does this by grouping libraries into Components / bundles,
serializing them individually and using the concatenated dill feature to
output the wanted data --- just potentially faster if we had the data
in cache.

Note that the serialized output might contain *more* than the input given
if we cached the wanted data into a bigger bundle.
The output will always be "closed" though, i.e. if the stuff that is
included that is too much added a new dependency, that dependency will be
included as well.
This should generally make it safe, although one can imagine situations
where it could pull in lots of dependencies that it wouldn't otherwise
have.

It is being driven by the incremental compiler which makes sure to
invalidate the cache when the data changes.

Except for situations where the libraries are changed externally after
being serialized, but before being serialized again, where one then wants
the updated library serialized, the feature should be safe.

Change-Id: I2a504abe6dbb68434c3b04abff13480ef72a6a6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120786
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-10-09 13:28:12 +00:00
Daco Harkes
ff23f546db [vm/ffi] Work around dartdoc crash to fix API doc generation
Issue: https://github.com/dart-lang/sdk/issues/38786

Change-Id: Ida4bb78da1aabdf6da259e0d66840d9db4b1428d
Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120788
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-09 12:37:52 +00:00
Alexander Thomas
7a6e62332f [co19] Prepare to roll from pre-nnbd branch
The master branch in the co19 repository is now the NNBD fork. For the
time being, we want to roll the legacy variant into co19_2. At a later
stage, we will also depend on the NNBD fork, but it will likely be a
different suite.

Change the script to use dart/try rather than the legacy bucket format.

TBR=whesse@google.com

Change-Id: I9b43d9d4a49f2cfd16b8be9cca025c6d750cf2bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120781
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2019-10-09 10:36:57 +00:00
Alexander Thomas
8e33090fd0 [co19] Roll co19 to a8f7aa15ab860a309667168243bda01fda0794df
From this roll on forward, co19_2 is tracking the pre-nnbd branch rather than the master branch in
the co19 repo. The master branch (the NNBD fork of co19) will be re-introduced as a different suite
later.

Issues reported:
https://github.com/dart-lang/co19/issues/492 (ShortCircuitOperators_A01_t12 test is wrong)
https://github.com/dart-lang/co19/issues/493 (ShortCircuitOperators_A04_t27 has a syntax error)
https://github.com/dart-lang/co19/issues/494 (ShortCircuitOperators_A03_t12 is an invalid test)

2019-10-04 irina.arkhipets@gmail.com Issue 490: useless constant-update-2018 option removed from the tests.
2019-10-04 irina.arkhipets@gmail.com Issue 490: useless constant-update-2018 option removed from the tests.
2019-10-04 sgrekhov@unipro.ru Fixes 484. Use floating point value which decimal part
2019-10-04 sgrekhov@unipro.ru Fixes 486. Fix test expectations (method call has higher priority than unary minus)
2019-10-04 sgrekhov@unipro.ru Fixes 483. Use List instead of Iterable
2019-10-04 irina.arkhipets@gmail.com Issue 485, 488: test expectations corrected.
2019-09-30 irina.arkhipets@gmail.com Issue 477: More tests for constant short circuit operations added.
2019-09-30 irina.arkhipets@gmail.com Issue 477: More tests for constant short circuit operations added.
2019-09-25 irina.arkhipets@gmail.com Issue 481: Test expanded into A Function(Null) instead of A Function(A) by the instantiate-to-bound algorithm.
2019-09-23 irina.arkhipets@gmail.com Issue 477: tests for Constant-2019-update added.
2019-09-19 sgrekhov@unipro.ru Fixes 480. Use '==' for checking actual type
2019-09-17 irina.arkhipets@gmail.com Issue 477: tests for Constant-2019-update added.
2019-09-17 irina.arkhipets@gmail.com Issue 477: tests for Constant-2019-update added.
2019-09-17 sgrekhov@unipro.ru NNBD tests removed from this legacy branch
2019-09-16 irina.arkhipets@gmail.com Issue 477: tests for short circuit operators added.
2019-09-13 sgrekhov@unipro.ru 466. Subtyping tests for NNBD added.
2019-09-12 sgrekhov@unipro.ru 466. Subtyping tests for NNBDc. Copyright year updated
2019-09-12 sgrekhov@unipro.ru 466. Subtyping tests for NNBDc. Right Object tests added
2019-09-11 sgrekhov@unipro.ru 464. Added tests for legacy type fields
2019-09-11 irina.arkhipets@gmail.com Issue 465: tests for Generics in NNBD added.
2019-09-10 irina.arkhipets@gmail.com Issue 465: test for Generics in NNBD added.
2019-09-10 sgrekhov@unipro.ru 466. Subtyping tests changed according to NNBD spec
2019-09-09 sgrekhov@unipro.ru 466. Subtyping tests changed according to NNBD spec
2019-09-06 irina.arkhipets@gmail.com Issue 465: tests for Generics in NNBD added.
2019-09-06 sgrekhov@unipro.ru More tests for type Never
2019-09-05 irina.arkhipets@gmail.com Issue 465: tests for Generics in NNBD added.
2019-09-05 sgrekhov@unipro.ru Fix using and checking of Never
2019-09-04 sgrekhov@unipro.ru Fixes 464. Legacy-libraries tests added
2019-09-04 irina.arkhipets@gmail.com Fixed Issue 460: tests for Null promotion added, typos corrected.
2019-09-02 sgrekhov@unipro.ru Fixes 458. More null-aware operators tests
2019-09-02 sgrekhov@unipro.ru Fixes 459. Late fields and variables test added
2019-09-02 sgrekhov@unipro.ru 459. Late fields and variables tests added
2019-08-30 sgrekhov@unipro.ru 459. Late fields and variables tests added
2019-08-29 sgrekhov@unipro.ru 459. Late fields and variables tests added
2019-08-29 sgrekhov@unipro.ru 389. Fixed static warnings processing
2019-08-28 sgrekhov@unipro.ru 458. Null-aware operators tests added
2019-08-27 sgrekhov@unipro.ru 458. Null-aware operators tests added
2019-08-27 sgrekhov@unipro.ru Removed covariant final member
2019-08-27 sgrekhov@unipro.ru Typo and order of modifiers fixed
2019-08-23 sgrekhov@unipro.ru 461. A couple of NNBD nested nullable types tests added
2019-08-23 sgrekhov@unipro.ru 389. NNBD static errors tests. Some tests fixed, several tests added (mainly for legacy libraries)
2019-08-23 sgrekhov@unipro.ru Fixes 389. A couple of legacy types tests added
2019-08-23 sgrekhov@unipro.ru Fixes 461.Conditional expression ambiguities tests added
2019-08-23 sgrekhov@unipro.ru 461. Add nested nullable types tests
2019-08-23 sgrekhov@unipro.ru Fixes 475. Modifier 'late' must be before 'final'
2019-08-22 sgrekhov@unipro.ru 389. NNBD static errors tests. Fixed work with legacy libraries and new tests added
2019-08-22 sgrekhov@unipro.ru 461. NNBD syntax tests added for required and null-aware selector

Change-Id: Icd4d0c536f0091100aa0276ff5b836b16db0ff35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120782
Reviewed-by: William Hesse <whesse@google.com>
2019-10-09 10:36:35 +00:00
Jens Johansen
6ebf3f0889 [kernel] Clear a few lists when loading dill
Prior to this change, loading the sdk dill twice for instance would
result in additional exports as well as parameter counts doubling,
essentially destroying the result.

Change-Id: I4d694bec1926d6df6572e9bb36e8a88ec0822e27
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120785
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-09 10:34:07 +00:00
Aske Simon Christensen
d1124c3b2b [CFE] Fail at runtime when a const constructor redirects to a non-const
If a const constructor redirects to a non-const constructor, report a
compile-time error (no change here).

At runtime, a const instantiation will result in an invalid expression,
whereas a non-const (explicit or implicit new) instantiation will
work normally.

Closes https://github.com/dart-lang/sdk/issues/23622

Change-Id: Ief0e9c62fb8de34203df49fd862f20aba41a3cde
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120042
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-09 10:18:37 +00:00
Jens Johansen
05f56ef160 [kernel] Fix printing of additional exports
Change-Id: I65ee82646555cd31eccad33e3a125f0ef2af3a35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120784
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-10-09 10:10:33 +00:00
Jens Johansen
e7a128ecc2 [CFE] Refactor incremental compiler test(s)
Change-Id: I538d5bb5f50af2409d0c99e8ab15b803b9e10fc1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120783
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-10-09 10:10:32 +00:00
Johnni Winther
46a9273664 [cfe] Opt in to NNBD using experimental flag _and_ version number
+ add testing of nnbd types and opt-out in static_types_test

Closes #38287

Change-Id: I019753a74cdc6980dadb0608f7ac486c127af6f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120666
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-10-09 08:43:03 +00:00
Alexander Aprelev
cee3f71e29 [build] Advise ninja to ignore out-of-date .lib files.
MSVC won't update .lib file if there were no changes, and this restat attribute tells ninja to honor that.

Change-Id: If78184aecf13578617570478cbf158276981e25d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120747
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2019-10-09 03:16:50 +00:00
asiva
b12bed36a8 [VM] Implement isExtensionMember in MethodMirror and VariableMirror
Added ability to recognize a MethodMirror to be a mirror of an extension member
Added ability to recognize a VariableMirror to be a mirror of a static
extension field.

Change-Id: I56715a491bba0d8cafb2796ebb755bd339e147c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120760
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-10-09 00:27:30 +00:00
Ryan Macnak
5092b8ef82 Revert "[vm, bytecode] Use CoreTypes and ClassHierarchy from non-incremental front end results when generating bytecode."
This reverts commit f2c882bd87.

Reason for revert: batch mode failures

Original change's description:
> [vm, bytecode] Use CoreTypes and ClassHierarchy from non-incremental front end results when generating bytecode.
> 
> Change-Id: I9a8b2530009ff6cc6880ee177a6bee4bb9101e82
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120626
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>

TBR=rmacnak@google.com,alexmarkov@google.com

Change-Id: I8ea8e155af0d2a4c4382107d723f7bf8a50dc3d7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120748
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-10-09 00:21:14 +00:00
Brian Wilkerson
9ababcf650 Improve message for overriding methods
Change-Id: I6fed64a852f94f2323972f511be4015a22fb4ebd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120746
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-10-09 00:12:50 +00:00
Alexander Markov
2ca6bc29b3 [vm,bytecode] More efficient bytecode for calls through fields/getters
Previously, calls through field/getter were generated as dynamic calls
because InterfaceCall with field/getter target doesn't correctly
represent what such call should do. This results in a quite inefficient
code in AOT mode.

With this change, calls through fields/getters are decomposed into two
calls, while keeping the same order of evaluation.

Change-Id: Ieb33927c1b39d1b4d8eafb7bd542675820474068
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120628
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2019-10-08 22:27:10 +00:00
Régis Crelier
735d8b7c64 [VM/nnbd] Propagate nnbd flag on Library from kernel to VM and bytecode.
Also fix a few obsolete comments.

Change-Id: Ice4d36abb950575316db02c3dad2b94a505d7e0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120743
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-10-08 22:25:20 +00:00
Ryan Macnak
f2c882bd87 [vm, bytecode] Use CoreTypes and ClassHierarchy from non-incremental front end results when generating bytecode.
Change-Id: I9a8b2530009ff6cc6880ee177a6bee4bb9101e82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120626
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-10-08 21:58:30 +00:00
Nate Bosch
0f1d5fa7e6 Centralize functions to convert Promise
Merge the two copies of a function that convert a JS promise to a Dart
Future. Reuse this function for the specialized case of converting to a
`Future<Map>`.

- Rename `convertNativePromiseToDartFuture` to the shorter and more
  widely used `promiseToFuture`. Update one existing use of the old
  name.
- Make the method generic to match the previous implementation of
  `promiseToFuture`.
- Update the code generator template to not emit the second copy of the
  method.
- Use the existing `promiseToFuture` with a `.then` call to implement
  `promiseToFutureAsMap`. Update the doc comment to follow best
  practices.
- Duplicate all above changes to nnbd SDK copy.

Change-Id: Ib3bbf17477efec3666b24fd4019ca8ce68f0b5b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119174
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-10-08 21:33:42 +00:00
Kallen Tu
e3ca5ee6ba Check variance of type-parameter use in supertypes.
Tests have both correct and erroneous implementations
of variance.

Change-Id: I49dd76f42399015dd6e3f9688e598c271ce7ab1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119722
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-10-08 21:33:40 +00:00
Sam Rawlins
8513b169da NNBD i13n: Fix some navigation targets and text
Change-Id: Iba6befb86453353823c1702405057f83fff64456
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120723
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-10-08 20:54:08 +00:00
Alexander Markov
8bf424ea89 Revert "[vm/bytecode] Enable bytecode compiler by default in Dart SDK"
This reverts commit 31996aa24f.

Reason for revert: bytecode mode is disabled to avoid gaps in testing of AST-based mode.

Original change's description:
> [vm/bytecode] Enable bytecode compiler by default in Dart SDK
> 
> This is the reland of https://dart-review.googlesource.com/c/sdk/+/110551.
> 
> Change-Id: I85fcfadfd20fdba752fa8225650a1cb6c32fff31
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117931
> Reviewed-by: Régis Crelier <regis@google.com>
> Commit-Queue: Alexander Markov <alexmarkov@google.com>

TBR=rmacnak@google.com,alexmarkov@google.com,asiva@google.com,regis@google.com

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

Change-Id: I941eff705b599c59251e5ba2337c307cc84f373b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120720
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-10-08 20:40:59 +00:00
Mike Fairhurst
ee42196636 [nnbd_migration] Support async function expression bodies.
This fixes 10 "side casts" (from T to Future<T>).

FutureOr logic no longer needs to be specialized as _handleAssignment
now supports that.

Change-Id: Ie01b13797a49ec29b4eb723f580720f1caffffab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120420
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-10-08 20:37:58 +00:00
Johnni Winther
431509ba8e [cfe] Remove builder/builder.dart
Change-Id: I471e2c9a0875c4ff14169a935758f53a74655f25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120642
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-10-08 20:24:38 +00:00
Johnni Winther
a85054d12e [cfe] Handle parser recovery in extension declarations
Closes #38600
Closes #38712

Change-Id: I875c55c49253066263bfe1c9cbe97debd1e81648
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120583
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-10-08 20:24:38 +00:00
Leaf Petersen
bb04f145b2 Update CFE expectations for extension method tests.
Change-Id: I04662433cb031043714d5ad0a1050a5398b1cf95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120740
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2019-10-08 20:16:39 +00:00
Brian Wilkerson
1f6c93aed5 Add support for querying the kind of edge origins
Change-Id: I9dc8ff9aa98bab2461f670adf15df899080f3885
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120741
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-10-08 19:30:29 +00:00
St?phane Este-Gracias
6aa415841c Support homebrew on Linux
Fix dart-lang/homebrew-dart#42

Closes #38512
https://github.com/dart-lang/sdk/pull/38512

GitOrigin-RevId: 561d002a18d95b97f217904f0f024c71fad0cb3d
Change-Id: I6ab2ef15e4220d641848bec15a12d9b64e375cb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118376
Reviewed-by: Alexander Thomas <athom@google.com>
2019-10-08 18:34:25 +00:00
Daco Harkes
ee0b1df4a6 [vm/ffi] Migrate tests/samples/benchmarks to extension methods
I used the regex replaces documented on the `load` and `store` deprecated methods.
I manually replaced some `.val` to `.ref` when a regex could not detect whether something was a primitive value or a struct.

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

Change-Id: I3534b6dd00d9ac45fa1a11fe75c80fb3cccc07dc
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-mac-debug-simdbc64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-reload-mac-release-simdbc64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-precomp-mac-release-simarm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118993
Reviewed-by: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2019-10-08 16:49:41 +00:00