Since we removed the dartdevc script, we cannot use the environment
anymore to provide the VM flags. These instead have to be provided
explicitly to the dart command.
Change-Id: I7742815ee43ef89a41644b364ba07335358fe976
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248641
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Currently the flag does nothing. Follow up changes will add support
incrementally.
Add a `--canary` flag to DDC that will enable all features in
development to simplify use in tests and benchmarks.
Issue: https://github.com/dart-lang/sdk/issues/48950
Change-Id: I4878c771bdb4f4c6e8b8cd618737009268b02cbe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237602
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
- Adds a flag `-a` for specifying the architecture (only works for MacOS at the moment).
- Calls '-uname -m' when no architecture is specified on MacOS.
- uname values from: https://en.wikipedia.org/wiki/Uname
Change-Id: Id5eb530e6571d2de452acd90d3b0d7e24fb32747
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/239468
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
Module symbol information now includes basic details the classes
compiled in the module.
Add tests and refactor to share some of the options for running the
incremental frontend compiler and ddc.
Change-Id: I6d3eb16bd6fb70c4c0af46de93a0f7bf96151c4f
Issue: https://github.com/dart-lang/sdk/issues/40273
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202865
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
This was used to build the sdk long ago. Last year (in April!) we removed
the last use of it internally, so the file can now be removed. At this
point both internal and external build systems use the compile platform tool.
Change-Id: Ib92b2ae4b0b3f1b7b7ec4bc6dd50ad2723016ec4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186661
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
This change adds a placeholder for int.operator >>>.
No implementation is added yet.
This change unblocks implementation of this operator in
the backends (VM, dart2js, DDC).
Issue: https://github.com/dart-lang/sdk/issues/44912
Issue: https://github.com/dart-lang/sdk/issues/30892
Change-Id: I9912ca9f44d594e9c5fa91f5fc65e807fe48cc7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185480
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Since the flag is now enabled by default, there should be no mention of it.
There are still some uses in front_end/testcases that are not just removable
(it also uses `no-non-nullable`). There migth be more uses that are not
as easily found as grepping for `--enable-experiment
Removes two VM tests where fixing them meant they were just duplicating
the corresponding non *_2/ tests.
Fixes#44941
TEST= Large number of tests chaged.=(no-)?non-nullable`.
Change-Id: Ief755981ccde9a5482fcdf408c2929c74433a710
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183688
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
- Copy the internal version of dart_library.js without any changes.
- Unblocks syncing this file again.
- Update ddb script to use the dart2js preamble for d8 which includes
assignment of a global `self` and the fake event loop for better
error handling.
Change-Id: I01c2ad82fe7c36bb393f9eab897f558daabf6b8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181522
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
This change does a small fix to exclude line numbers from the golden
files produced by check_nnbd_sdk.dart. Doing so helps keep the golden
file more stable and less likely to require updates when developers make
unrelated changes to the core libraries.
There are very few failures that remain and now that the CFE is more
mature, we may be in a position to stop using the patch-sdk mechanism to
test the validity of the migrated sdk.
Change-Id: Id41448f23871d0a43257db5dbf5b0b062e2eaddd
Bug: https://github.com/dart-lang/sdk/issues/44491https://github.com/dart-lang/sdk/issues/44618
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178726
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Change-Id: I84e94736a425d45b6b1334e90f7991fa31070713
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176240
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Auto-Submit: Lasse R.H. Nielsen <lrn@google.com>
UnmodifiableSetView does not have backend specific implementations
(simillar to UnmodifiableMapView, unlike UnmodifiableListView).
Closes https://github.com/dart-lang/sdk/issues/36901
Change-Id: I041bb6dc95d6a67a395ca75581ffe8e5933acdc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164103
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Emphasize that the operation is going away,
and mark constructor as deprecated.
TEST= Refactoring+deprecation only, covered by existing tests.
Change-Id: I82aa044cd2cf7bf347b624371399f44bda8f4a07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173261
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Allows sound-like null safety when running mixed applications in weak
mode.
This is not a specified option and is only intended to assist large
scale migration efforts.
Change-Id: Icd0abb0e876d16e719a01e8381eef55a2b511051
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171821
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Adds a @pragma("vm:recognized", <kind>) to all recognized methods, where
<kind> is one of "intrinsic", "graph" or "other", corresponding to the
kind of recognized method.
When running in debug mode, it is checked that all recognized methods
are marked with the correct kind of pragma, and that all methods marked
with the pragma are in fact recognized.
This enables kernel-level analyses and optimizations to query whether
a method is recognized by the VM.
TEST=Asserts that check the correspondence both ways, covered by test
suite, in particular the various CompileAll tests that compile all code.
Change-Id: I12f3305c72a93ecb1aefae2d66e3d9a7dae23b44
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168951
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Simple calls to `List.generate` are expanded into a list allocation
and a loop. This generates better code for several reasons:
- There is no overhead for the function argument (closure allocation,
closure type, closure class)
- Global type inference is more precise since each List.generate list
is tracked separately, and the assignments in the loop give better
inference to the collection's element type.
To get precise element type inference, there are two new JSArray
constructors. Global type inference starts with the element type being
bottom for these elements, avoiding spurious nulls in the inferred
type.
Change-Id: I5efb90651ae3f9eb2e81af556704960cdf0b75c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168770
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
- Fixes broken benchmarks in ddc because the benchmarks run in
d8 with the ddc module system can handle conflicting library
names more gracefully than es6.
- In the future we need to update the source of truth for
dart_library.js so we can keep the file in sync.
- Removes the ability for ddb to run with any precompiled sdk.js
from a dart installation. Now you must run a build first and
the sdk.js files from that build will be used. This means the
`--debug` flag no longer changes which sdk.js files are used.
Change-Id: Icaf78956f93ff643d23e68001354ec08c9c28b12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166926
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Change-Id: I1801d4d8f3f25c76885f3482ae1553d32e6ee15b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168828
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Connect the type hierarchy with the missing (compared to the
dart2js versions) of the JSMutableIndexable class.
Avoids an extra copying of all data to a temporary list during
the construction just to get access to the index operator.
Change-Id: I8a9f8ba4d956ac49d6fb635709d11a6e7c018270
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166782
Reviewed-by: Mark Zhou <markzipan@google.com>
Avoid redundant element casts and checks if the list is growable.
Change-Id: Ib915ccf2ec65fbe7d32ecaabe23899f2530617c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166781
Reviewed-by: Mark Zhou <markzipan@google.com>
Bug: https://github.com/dart-lang/sdk/issues/42535
Adds a runtime flag to ddc to enable runtime checks on native APIs.
In the case where an API is typed non-nullable but returns a null
value, throws a null assertion error.
Change-Id: I4d5d7529ba28d9308687dad5d51f1b9c71274455
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162461
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Future CLs will hook up the static typing rules for method calls
(`clamp` and `remainder`) and will implement the rules for contexts.
Bug: https://github.com/dart-lang/sdk/issues/42629
Change-Id: Iccfb1fa1ac9aff6c0832d65e4835b5b9bd51a804
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158501
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Fixes the JS interop tests/benchmarks that expect the global
window.self to exist when running in d8 or node.
Change-Id: Id3eed6cdffb97560d61781e11d97d63edf74232d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156782
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Some benchmarks are located in directories named with characters
that are invalid in js identifiers. To generate bootstrapping that
loads these modules import the module builder and use the same
naming method that ddc uses.
These names are directly tied to the version of ddc that produces
them. This solidifies the fact that we really can't rely on using
the ddb script to run ddc from a different commit/build.
Change-Id: I92349d70134886de63686d88f5eab9da12b4021f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156820
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
This brings ddc to parity with dart2js when running benchmarks
and fixes a crash in the migrated Utf8Decode benchmarks.
In the future we might reject programs based on the signature
of the main method or introduce runtime errors but that is
still under discussion
https://github.com/dart-lang/language/issues/1120.
Change-Id: I594f60e887ce05ef7074c72cbbe379c0d526707e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156361
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Eliminated several links to content that no longer exists
Change-Id: Icd7bf5796a061882ba384e39d78d5f8ff429696d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154362
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Auto-Submit: Kevin Moore <kevmoo@google.com>
Now that the sound null safety mode is a compile time flag
instead of a runtime flag there is no need to set the value in
the bootstrapping code before running main(). The sound and weak
versions of the sdk now have it already set.
Add compileTimeFlag() method that will inline the constant value
directly into the generated output.
Change-Id: I5b9243c47cffc421067ac820ef49342b9d0efff9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154100
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
* Setting the nonNullAsserts flag in the bootstrapping logic will
enable/disable failing when a null value is passed to a non-nullable
method parameter when running with weak null safety.
* Move the --null-assertions from VM options to the shared options in
the test and use it to set the flag in DDC the entry point.
* Configure other backends to ignore the flag.
Change-Id: Ia2670514bed7fa981564e99b85d74f6bae6dd9fc
Fixes: https://github.com/dart-lang/sdk/issues/42404
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151306
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
* Start using --sound-null-safety in ddb script To be more consistent
with the finalized naming.
Legacy mode: No flags
Weak mode: --enable-experiment=non-nullable
Sound mode: --enable-experiment=non-nullable --sound-null-safety
* Remove --kernel flag. It's been ignored since analyzer based DDC
was removed.
Change-Id: I1349f7852927e65b1574637a96f68123f1f9741a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153387
Auto-Submit: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
The blank line clobbers the output if ddb is used in non-verbose mode
to execute a program where the stdout ordinarily belongs to the program
in question whose output might be machine parsed.
Change-Id: Ie929d19deabebb7b1f3d24f99035aec2d9844a64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153208
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
This is a reland of https://dart-review.googlesource.com/c/sdk/+/151163.
The reported problem is a mismatch between actual behavior and
description. The original cl tried to fix the bahavior but it broke many
external users. Given the fact that the old behavior has been widely
accepted and used, updating comments might be the correct thing to do.
This cl will update the description of toString() to be sync with its
behavior.
Bug: https://github.com/dart-lang/sdk/issues/41737
Change-Id: I899a346647c268c2dd4e582f9a9f44a3d2286720
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152060
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
This reverts commit 038e981f89.
Reason for revert: Breaks some tests; visible changes to some web UIs.
Original change's description:
> Fix duration.toString() to conform the description
>
> Duration.toString() should return in a format of "HH:MM:SS.mmmmmm".
> But when `hours` is less than 10, toString() doesn't have the leading
> zero, which is "H:MM:SS.mmmmmm".
>
> The corresponding co19 issue: https://github.com/dart-lang/co19/issues/733
>
> Bug: https://github.com/dart-lang/sdk/issues/41737
> Change-Id: I2264171b2b37e89056695f7f821125a5f78d87fb
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151163
> Commit-Queue: Zichang Guo <zichangguo@google.com>
> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
TBR=lrn@google.com,zichangguo@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: https://github.com/dart-lang/sdk/issues/41737
Change-Id: I4d7ef5de9807e8e2b2a77c2171d1693b7527f671
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151848
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>