Commit Graph

64479 Commits

Author SHA1 Message Date
Kevin Millikin 9aea5536fb [cfe] Initial support for compiling if in collections
Support compiling if elements and map entries by constructing
IfElement or IfMapEntry when they are seen.  There is no support for
lowering them to block expressions yet.

Change-Id: I74c2492fefc9703e9e2f639baad7f737bbe63721
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96786
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-03-14 10:08:36 +00:00
Johnni Winther 1ac41d26b4 Support @Creates and @Returns from ir constants
Change-Id: I5afa43354f70e42dad93a568afabb14d2004cf52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96784
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-03-14 08:44:46 +00:00
Ryan Macnak ac4eca7eb9 [vm, gc] Take advantage of object alignment and non-overlap when copying objects during a scavenge.
Change-Id: Ic58b391f4bf5141da61fd45e2c8358ef1bd285be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/72072
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-03-14 01:17:56 +00:00
Konstantin Shcheglov d5ab8b4da2 Resolve ForElement(s) in separate scopes.
R=brianwilkerson@google.com, paulberry@google.com

Context: co19_2/LanguageFeatures/Control-flow-collections/dynamic_semantics_list_A04_t01
Change-Id: I09e63e0821015993aa47736efd729411a9bd67e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96833
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-03-14 01:11:26 +00:00
Nicholas Shahan 5b07ef9d1c [tests] Fix new tests
* Add missing const on expected set.
* Add missing type to map literal.

Change-Id: I25fdfe45926b4943f17661ad5f392ea53ad1f06b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96850
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-03-14 00:44:46 +00:00
Alexander Markov b1a3629547 [vm] Move receiver variable to ParsedFunction, add ParameterVariable()
This refactoring moves receiver variable (previously known as this_variable)
from ScopeBuildingResult into ParsedFunction, like other special variables.
This is done as ScopeBuildingResult is AST-specific and not available
in bytecode, but certain flow graph builders use receiver variable
(for example to load instantiator type arguments for type arguments
checks).

This CL also introduces convenience ParsedFunction::ParameterVariable()
method to reduce repetitive incantations

  parsed_function->node_sequence()->scope()->VariableAt(..)

to a more readable

  parsed_function->ParameterVariable(..)

Change-Id: I427536abfa412de9916b79cf2e56e06f2f2f1d71
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96842
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
2019-03-14 00:25:56 +00:00
Brian Wilkerson 037b273753 Make List literal inference match the proposal
Change-Id: I8c70fc80d1965a407141c4d1c8e90f1d32bd44ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96847
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-03-14 00:16:56 +00:00
Nate Bosch f2579a8ede Add override annotations in dart2js tests
In preparation of enforcing these in the analysis options.

Change-Id: I316f2efea510ecc8ff1b975e96d166a5f8c0286c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96834
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-03-14 00:15:46 +00:00
Daniel Nicoara d1a943281b Change path order when trying to open tracing
/sys/kernel/debug/tracing is the old path[1] and only present for
backwards compatibility. Check the new path first otherwise accessing
/sys/kernel/debug/tracing will cause debugfs to be mounted. If
permissions are not set correctly after the mount, the user process may
not have a way to access the trace_marker.

[1] https://www.kernel.org/doc/Documentation/trace/ftrace.txt

Bug: None
Change-Id: Ifbd967c0f7298c8877c23bd4908d172b94f9e2d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96832
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-03-13 23:44:11 +00:00
Aart Bik 6483f5238f [dart/vm] be more flexible with precomputed constants
Rationale:
The problem was that we were evaluating field
initializers while still loading the constant
table. This hit two asserts (1) having pending
potential_natives() when entering codegen and
(2) not being able to evaluate constants
since the table has not been loaded yet. The
solution is to simply postpone enum field
initialization (forced to avoid hot reload
issues) while loading the constant table
until right after the table is ready.

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

Change-Id: I5060476e5b3b49e555cfc507fb398ef0144b44d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96844
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-03-13 23:38:26 +00:00
Ryan Macnak 580e5731d6 [vm] Test compilation traces, type feedback, reused instructions.
Improve error for failure to reuse instructions.

Change-Id: I38b30a0da508f686d73dffebbf5893d6c939f19a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95940
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-03-13 23:36:06 +00:00
Ryan Macnak 217a027456 [vm, interpreter] Support unboxed fields.
Bug: FL-208
Change-Id: Ia6d6b913ccfc3b279ae89666bfb6f494a098b102
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96523
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-03-13 23:29:56 +00:00
Mike Fairhurst 1bd7920367 Resolve generic function default parameter values
Change-Id: I060ee8f61b8cb74482b92d4057e4183f1e4ca269
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96701
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
2019-03-13 22:44:18 +00:00
Paul Berry 31c47567dc Remove AnalysisOptionsForLink and plumb analysis options through linker.
This is a non-breaking change; the only way linking is exposed to
clients is through `SummaryBuilder`, which can get the analysis
options from the context.

Fixes #35747.

Change-Id: I273408f33a881ac32ab248cbc8f3e0644630563b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96829
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-03-13 22:39:53 +00:00
Nate Bosch 69a4f20347 Add override annotations consistently
This makes it easier to follow class hierarchies and understand where a
class is changing the interface. I hit this when I found a class that
had the annotation on some methods it was overriding, but not all, which
made it confusing.

Prepares for adding the lint rule and enforcing it.

40% of overridden methods were annotated - add annotations to the remaining 60%.

Change-Id: I02472f4b6c5026a820cf9ff1a7ada663a60f1868
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96666
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-03-13 22:36:11 +00:00
Mayank Patke 4339fe9b51 Add constant evaluation tests for IfNull.
Change-Id: I68229e831cea9e1c9aac548d9da8434bcacdaaff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96710
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 8adcab9fec Add constant evaluation tests for Identity.
Change-Id: I9ce93147f7cdb96ce659551499a64958a77d1711
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96709
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 3552dbb429 Add constant evaluation tests for Equals.
Change-Id: I20be37af485f8841ec549f33c16e5680e0170444
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96708
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 27328840f9 Add constant evaluation tests for GreaterEqual.
Change-Id: I2e2a3b656710cd130882dd2f7480f9d532a1ba61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96707
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 9f680cd0bd Add constant evaluation tests for Greater.
Change-Id: I356b805ff69307a697e073ea4499217e11541cc5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96706
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 0950d473ad Add constant evaluation tests for LessEqual.
Change-Id: If98b28bfbb32b14e1d53546642fae613aa937519
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96705
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 7ff70237d4 Add constant evaluation tests for Less.
Change-Id: I024905e6e90f40301d092de2e4e0e45e379b143b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96704
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke ce9a1bb24e Add constant evaluation tests for Add.
Change-Id: I21b5fd03bfaee3c32573c56d8f529c933f315d14
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96703
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 2fa96dd653 Add constant evaluation tests for Divide.
Change-Id: Ic361816bd0cfa5a6822cb96322bb29fcf7749778
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96405
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 952421a68d Add constant evaluation tests for TruncatingDivide.
Change-Id: I144967283f76570ec6312750995ca219d3a4ad09
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96404
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 9fd0ec2560 Add constant evaluation tests for Modulo.
Change-Id: Ia8d7fd2faee166ea71aaca5e1fc797d5d658d8c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96403
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 9262d111fd Add constant evaluation tests for Multiply.
Change-Id: I05e7c3e6b6cb4a137a03f4917b8ab7125a1e19b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96402
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke aba9392f0e Add constant evaluation tests for Subtract.
Change-Id: Id818fc9c2f246b8858fb747d8955604b44348a4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96401
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 3a38f0bb89 Add constant evaluation tests for BooleanOr.
Change-Id: Ib9f7b409845ff13ecaa49fd1d949ea1bf474281d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94465
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 052d6d235c Add constant evaluation tests for BooleanAnd.
Change-Id: Icead29835e72027f6f9cd82f799781983843fc89
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94464
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke be5332c0a5 Add constant evaluation tests for ShiftRight.
Change-Id: I327d98fa496543db885549e3654844da5f9f6a16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94463
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 4f34218ce1 Add constant evaluation tests for ShiftLeft.
Change-Id: Ie669c127be1f76a64dbb7a96b81b3ce7d1621733
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94462
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 3df5334137 Add constant evaluation tests for BitXor.
Change-Id: If5b72f5743ebde2304058ba57e50c7dee5173561
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94344
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 84d8d6b513 Add constant evaluation tests for BitOr.
Change-Id: I93d172601c8c3e83e3a17d4eeb90d06f2fe2fd45
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94343
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke f7972480bd Add constant evaluation tests for BitAnd.
Change-Id: I162aed0534530efb04e7e743d1f29ef041f888fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94342
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 432c6c8c39 Add constant evaluation tests for Not.
Change-Id: I1afa07efb7f3def69f13719ee3f57cd4d8c00f2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94341
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 2e1c78db7b Add constant evaluation tests for Negate.
Change-Id: I9e23fc47538324fcd64c8e2e90e75cf12e8b0491
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94340
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke 5853f129b2 Add constant evaluation tests for BitNot.
Change-Id: I1bc82d76073006a18109eedfc62bd53a70f1685f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94320
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Mayank Patke aa4a2df5a2 Add structure of constant folding tests.
This test suite is not comprehensive by any means. The goal is to
establish the right structure for the tests (so that we get the right
inlining and constant folding behavior). Broader semantic tests will be
added later.

Change-Id: Ib028ec05f063b98046f5946272cfbfe986244d3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94040
Reviewed-by: Stephen Adams <sra@google.com>
2019-03-13 21:36:51 +00:00
Konstantin Shcheglov 078c834f25 Extract CONST_SET_ELEMENT_TYPE_IMPLEMENTS_EQUALS test and fix for spreads in sets.
R=brianwilkerson@google.com

Change-Id: I1667d6bdde78a35a542f2ec525d5328573322600
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96830
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-13 21:31:31 +00:00
Konstantin Shcheglov 2d48159e38 Issue 36187. Fix for getSuggestionDetails() fails in part file.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/36187
Change-Id: I428ab29a08eff43d5538d025b59374e4f8cad154
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96831
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-03-13 21:26:01 +00:00
Liam Appelbe e7562917f1 Reland https://dart-review.googlesource.com/c/sdk/+/96500
Rather than creating the abiversions directory during gclient update,
check in an (almost) empty directory. This fixes the flutter build.

Bug: https://github.com/dart-lang/sdk/issues/36047
Change-Id: Ied74210bfc1c8fda998f58f754eac3949ebe0718
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96846
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2019-03-13 21:03:01 +00:00
Brian Wilkerson b5528fa84d Improve the docs for isSet and isMap in SetOrMapLiteral
Change-Id: I7b6769cdb89e728c7678361855481fd4ab307d5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96827
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-03-13 20:54:01 +00:00
Jonas Termansen e55e13ffbd Merge remote-tracking branch 'github/master'
A commit was accidentally pushed to github that bypassed the googlesource
repository. This merge unifies the two histories.
2019-03-13 21:52:49 +01:00
Konstantin Shcheglov 632abb6a25 Improve 'Import Library' code generation when has 'part' directive.
R=brianwilkerson@google.com

Change-Id: Idb3370dcbb67a935939a8ee2c072b897b866f7b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96826
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-13 20:24:13 +00:00
Paul Berry d3a0293a9d Replace unnecessary ?.s with ..
They were triggering a lint (null_aware_in_logical_operator).

Change-Id: Ia6124ae4828270b1d231b44199c376adc04fcc79
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96848
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-03-13 20:23:31 +00:00
Zach Anderson e711486873 [vm,dart:io,fuchsia] Be happy with any open fd for Stdio handles if fstat fails
Change-Id: Iabb1d25d1649b60805f6c16550520596a01d20df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96843
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2019-03-13 20:20:01 +00:00
Aadil Maan 0bf8a1e591 Update breaking-changes.md
Taking over responsibilities from mit@ to drive breaking-changes-request through the approval review process.
2019-03-13 13:05:54 -07:00
Konstantin Shcheglov f08e213bb1 Extract CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS tests.
R=brianwilkerson@google.com

Change-Id: Ic73cdade894f4d5832427d193eaa0c33e51676b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96825
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-03-13 19:28:34 +00:00
Konstantin Shcheglov 2b00685d38 Make SetOrMapLiteral set/map unless we are linking, so going to infer it.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I676975b4fd861f37fcd58c48782f0a4fa59ce178
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96824
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-03-13 19:16:59 +00:00