Commit Graph

19280 Commits

Author SHA1 Message Date
Aske Simon Christensen e62391a162 Revert "Handle ir constants in field analysis and impact tests"
This reverts commit 0cd89e5bd1.

Reason for revert: Conflicts with move of constant evaluator.

Original change's description:
> Handle ir constants in field analysis and impact tests
> 
> Include initial handling of unevaluated constants from environment.
> 
> Change-Id: Ibd330a14dfabad1dee95b64ce7015939412374d3
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97112
> Commit-Queue: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Sigmund Cherem <sigmund@google.com>

TBR=johnniwinther@google.com,sigmund@google.com

Change-Id: Ie01c7dda6152abbf852cd40a00597f019db49e66
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97116
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2019-03-18 13:01:11 +00:00
Johnni Winther 0cd89e5bd1 Handle ir constants in field analysis and impact tests
Include initial handling of unevaluated constants from environment.

Change-Id: Ibd330a14dfabad1dee95b64ce7015939412374d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97112
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-03-18 10:30:04 +00:00
Stephen Adams 7a90563ee3 [js_runtime] Try to avoid String.prototype.replace with replacement patterns
Change-Id: I4b063fe77592bbb0ad9f6ffb628c3bdd6323b20c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96220
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-03-15 21:51:15 +00:00
Bob Nystrom 626cb68ad2 More spread test fixes.
Change-Id: I87ff7f75cbe10598f831fb969ad04ba612bd4b0c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97004
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2019-03-15 20:48:55 +00:00
Johnni Winther eb6f1b6abd Handle effectively constant fields in class stub generator
Closes #36222

Change-Id: Ic8b7a3963e1364903b4b2d7871ff0b12cb134572
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97082
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-03-15 20:15:25 +00:00
Alexander Markov 06eeeec92e [tests] Remove obsolete VM option --error-on-bad-type from tests
Change-Id: I1ab76f5a86dc53bfa22bd350e6a7aca477c58947
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97043
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-03-15 18:19:55 +00:00
Stephen Adams 9b185051a9 Don't use lazy static initializer in Random.secure()
The lazy static initializer returns null after throwing on the first use.

Change-Id: I44fbb6f8af263dc5c813ed5dff2291fb27e48b4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96984
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-03-15 17:45:06 +00:00
Samir Jindel 025825dc0f [vm] Update ffi status files and fix function_stress_test on Windows.
Issues fixed: dartbug.com/35933, dartbug.com/35935 and datbug.com/36138.

Change-Id: I4a057951abf9a022a3fc7a63e85a32e8fae22a58
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97105
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-03-15 15:11:20 +00:00
Daco Harkes 638f13ff3d Revert "[ VM / dart:isolate ] Added ability to set names for spawned isolates."
This reverts commit 59525264e8.

Reason for revert: causes Flutter test observatory and protocol to deadlock.
Issue: https://github.com/dart-lang/sdk/issues/36232

Original change's description:
> [ VM / dart:isolate ] Added ability to set names for spawned isolates.
> 
> Fixes issue #34059
> 
> Change-Id: I315498b02edc184e9e408c93eddb78aa1a5a8a1d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/90341
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

TBR=bkonyi@google.com,rmacnak@google.com,asiva@google.com,sigmund@google.com

Change-Id: I5f2115a2ac394a8d4c7c175bc97f2b88b65fcb49
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97107
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2019-03-15 14:40:37 +00:00
Samir Jindel 85f8d3c047 [vm] Build FFI trampolines with IL.
Bugs fixed: dartbug.com/36033, dartbug.com/36034, dartbug.com/36155.

Change-Id: Ic463dd2d299018e03f840ecedc8b7dfa350c6b95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94860
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-03-15 12:38:54 +00:00
Samir Jindel 4e68a04f3e [vm] Minor improvements to FFI function tests.
Most importantly, we move resolution of symbols in function_test to the toplevel
so the same function object is re-used on each invocation. This makes it possible to
tests repeated invocations with the optimization counter enabled.

Also added some comments and new tests.

Change-Id: I3772a1f15d1ad9924c8583112ddf3b1349fb6c09
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96083
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-03-15 12:38:54 +00:00
William Hesse d6ffee639b [co19] Roll co19
Change-Id: I9fa1568bc172636b2ed3d1c2f73e88d9d3950ba1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96947
Reviewed-by: William Hesse <whesse@google.com>
2019-03-15 12:05:39 +00:00
Johnni Winther d0c4d6b329 Take variance into account when computing rti checks
Change-Id: Ie3f93a6ac1fbf796b1c66bf29d2e9de51f5dee13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96942
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-03-15 09:40:14 +00:00
Johnni Winther 3e794ec16a Add tests for rti emission on function types
Change-Id: Iee612110afbb83947a7869df3c49138a9ba34832
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96906
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-03-15 09:40:14 +00:00
Kevin Millikin 495b9c4519 Remove set-literals experimental flag from tests
The set-literals feature has shipped and is on be default.  There is
no longer any need to pass it as an option to tests and the tools
cannot remove support for the flag while it is used in tests.

Change-Id: Ibf105ec01193ebb08d6e22600e6c7748897cc2ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96941
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2019-03-15 07:41:11 +00:00
Bob Nystrom 092a552a52 Fix spread disambiguation test.
Using runtime objects of the right type so that the spread doesn't
throw at runtime before we can check its type.

Change-Id: I6838079ff7f0f0267796058eee4c077c993484d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97002
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2019-03-15 00:15:28 +00:00
Ben Konyi 59525264e8 [ VM / dart:isolate ] Added ability to set names for spawned isolates.
Fixes issue #34059

Change-Id: I315498b02edc184e9e408c93eddb78aa1a5a8a1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/90341
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-03-14 22:23:09 +00:00
Nate Bosch 28d697a6c1 Enforce override annotations in dart2js
Update the excludes in the test directory analysis options to match the
files that were not updated to add override annotations.
Update the excludes in `testing.json` to match the analysis options.

With a consistent analysis options test config the diagnostics in
editors will match what is enforced by the test.

Also clean up the no longer required `enableSuperMixins` config.

Change-Id: If0e23642c25e0b5c1aced6a5a8c8c05a6da538f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96836
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-03-14 18:47:05 +00:00
Stevie Strickland f31b7928ae [VM] Adding regexp lookbehind assertion support.
See https://github.com/tc39/proposal-regexp-lookbehind
for a high-level description of the feature and examples.  This is one of the
features requested in https://github.com/dart-lang/sdk/issues/34935.

This work takes the feature as present in the v8 engine and appropriately
merges it into our irregexp fork. Notable changes to the irregexp codebase to
introduce this feature:

-----

We can no longer assume that all matching proceeds forwards, since lookbehind
matching proceeds backwards. Similarly, we cannot assume that we can only be
at the start of a string if we started matching from that point. The direction
of matching must also be taken into consideration when doing bounds checking,
which previously assumed the engine would never attempt to look before the
start of a string.

-----

We may now parse backreferences to captures before the capture they
reference, since we parse regular expressions left to right, but lookbehinds
perform captures as they evaluate the string from right to left.  Since
RegExpBackReference objects contain a pointer to their corresponding capture,
this means that we may need to create RegExpCapture objects prior to the
parsing of the corresponding captured subexpression.

Thus, RegExpCapture objects are now only initialized with their index, and the
body is set later when the subexpression is encountered and parsed. This means
any method that operates on the body of a RegExpCapture can no longer be const,
which also affects the rest of the RegExpTree class hierarchy. This also means
that we don't have a valid max_match length for backreferences based off the
capture body, and must assume they can end up being any length.

-----


Change-Id: Iffe0e71b17b1a0c6fea77235e8aee5c093005811
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94540
Commit-Queue: Stevie Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-03-14 14:26:47 +00:00
Kevin Millikin c9e9b76d4d Skip control-flow-collections tests on all runtimes
This feature is under development in the front end.  Testing it on the
runtimes leads to numerous spurious status changes.  Skip the tests
for now.  The intent is that when a backend change causes a test to
start passing, then that test will be un-skipped.

Change-Id: I6c8c1f45315607039240c3edc61ba8340ae9cda0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96902
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Auto-Submit: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2019-03-14 13:09:07 +00:00
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
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
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
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
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
Sergey G. Grekhov 8436dca626 [co19] DEPS updated
Change-Id: I487418f0a8a1cad37585d985ac2da6807556b4f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96620
Reviewed-by: Alexander Thomas <athom@google.com>
2019-03-13 12:12:06 +00:00