Leaves the snapshot output location in root_out_dir so that it doesn't conflict, and hardcodes an exception for _full_sdk_snapshots to look in that directory.
Change-Id: I69cd5d87ba240052c039b7b8920092fd6a78ab08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130500
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
The information is expressed in the signature now, previously the return
type was implicitly `dynamic`.
Change-Id: Ib4a0106c94dc394e8126773442cd0886f81e0c79
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130739
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
- opt-in NNBD all the patch files of core libraries.
- dart:io patch files are not yet opted in.
Change-Id: Iaef21d49f2949406450c41a878ede697f61556d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130820
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
I believe this fixes `language_2/await/await_test`, but there might be other
tests affected.
Change-Id: I573beda1b40540691f58fb38bda56814b70a9343
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130730
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Object -> Object? in the NNBD fork.
Change-Id: Id17827327f77d61266f1a478abb735348dbc7312
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130564
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
We are establishing a convention that nullability wrappers will be emitted at the
call sites of 'is', 'as', and '_check' calls (when necessary). Additional wrappers
will be emitted when forward-declaring generic types at the top level - but only
around the generic parameters themselves.
For example, declaring List<int>, List<int?>, List<int>?, and List<int?>? results
in two top-level classes: ListOfInt(int) and ListOfInt$(dart.nullable(int)).
Change-Id: I2d91e170d8e1e911ad9eb70d6b4d67f1cc4cdbc1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129921
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
This reverts commit 24a0601d5b.
Reason for revert: This breaks the flutter build because flutter has
a build target producing the same "gen/frontend_server.dart.snapshot" file and is therefore conflicting.
See e.g. head-head-head bot failure:
https://ci.chromium.org/p/dart/builders/ci.sandbox/flutter-engine-linux/9747
Original change's description:
> Create the frontend_server snapshot as a part of the sdk
>
> This will allow us to use it from webdev, as it now supports DDC output.
>
> Change-Id: I4b82d1c45d2c058abb062dddd2a2c41cc6318c45
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130134
> Reviewed-by: Keerti Parthasarathy <keertip@google.com>
> Reviewed-by: Jonah Williams <jonahwilliams@google.com>
> Reviewed-by: Vijay Menon <vsm@google.com>
> Commit-Queue: Jake Macdonald <jakemac@google.com>
TBR=keertip@google.com,jakemac@google.com,vsm@google.com,jonahwilliams@google.com
Change-Id: Ib2d782560cc005416ece429f9506dca055bffd9b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130377
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
This will allow us to use it from webdev, as it now supports DDC output.
Change-Id: I4b82d1c45d2c058abb062dddd2a2c41cc6318c45
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130134
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Jonah Williams <jonahwilliams@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
This change:
* adds the `--use-old-rti` flag to revert to the old behavior
* enables the new behavior by default
* changes the -rti- builders to run the old rti instead of the new rti
* documents the change in CHANGELOG.md
I've kept around the logic as `useNewRti` to avoid swapping all the conditions
in the compiler.
Change-Id: I773ac33b658cb60f72e0b6beef83375abec31bad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127492
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Fixes#39074
DDC emits Dart code that can usually be called with the same semantics
as JS there is no guarantee that a function passed to JS and then
invoked successfully was wrapped with `allowInterop`. The wrapping is
always required in Dart2JS. To make DDC more strict, add interceptors
that check for the usage of `allowInterop`.
Whenever a JS interop function or setter is passed an argument which is
statically typed as a Function, but not wrapped with `allowInterop` at
the call site, wrap it with `assertInterop` which will check the
argument at call time and fail with a clear error if it was not wrapped.
Whenever a JS interop function is torn off, either at the top level or
from an instance, wrap it with a function that will also inject these
checks at runtime.
There are still holes where we can't catch the mistake:
- An argument which is statically dynamic and a Function at runtime
won't be caught.
- A Function which is stored in a collection won't be caught.
- A JS interop definition where a getter returns a Function which takes
a Function as an argument is not checked.
- A dynamic call through to javascript is not checked.
Changes:
- Refactor `_isJsLibrary` and add `isJsMember`, and `isAllowInterop`
utilities to determine what needs wrapping.
- Update `assertInterop` to give a more clear error when it fails, and
to ignore non function arguments.
- Add `tearoffInterop` to wrap a function an ensure that any function
typed arguments are wrapped.
- Inject `assertInterop` around Function arguments passed to JS methods.
- Inject `assertInterop` around Function arguments passed to static or
instance JS setters.
- Inject a runtime wrapper around static or instance Function tearoffs.
- Add a test covering all flavors of checks that are supported.
- Change the interop expando to an `Expando<dynamic>` in the NNBD SDK to work
around a stricter type check. https://github.com/dart-lang/sdk/issues/39971
Potential improvements:
If the `tearoffInterop` turns out to be too heavy, we could loosen it so
that we only wrap methods if any of their argument types are statically
declared to be a Function.
Change-Id: Ibc92df5b54e1a041b4102a07b8398b774b6bd1d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128462
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
- Removes the load port functionality from the service isolate, this was
used to load sources in Dart 1 and is pretty much dead code in Dart 2
- Moves resolution of URIs and Package URI (based on package map) to the
individual isolates instead of sending a request to the service isolate
- Setups the package map lazily as it is needed only if resolveURI is
called in Dart code, it is not needed for loading/compiling sources
(this is now done in the front end).
- Removed Dart_ServiceWaitForLoadPort() methods from the Dart C API as
it is not used anywhere.
Change-Id: I6c3704bc431bdcd49bf074eb58bee1ed492ccccb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129742
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
It isn't possible to do this with evaluate since we are unable to access
classes from private libraries exposed through dart:io like dart:_http.
Change-Id: I3d4168d919dbcf5008da60b14165fd9b89f22cad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129322
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
The remove method needs to delete the reference to the 'bucket' array
to avoid a pathological case of nearly unbounded empty buckets.
Bug: 39638
Change-Id: I5cb85817036f36aeec92f560aa4ec57ee9c88638
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129263
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
This continues the work started in https://dart-review.googlesource.com/c/sdk/+/124105
The nnbd mode is now part of the type arguments instantiation cache,
since the resulting vector depends on the mode.
Change-Id: I803c07fa9473024557db8585e87286f16681169a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128307
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
This makes the location of the `.git` folder a GN argument, so it
can be configured differently when using git-worktree.
See sdk_args.gn for documentation on how to use this.
Fixes#33619 (http://dartbug.com/33619)
Change-Id: Ia8144f401c462a6fbb91a965979949f286b04d1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127485
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
All of these tests are now running under the regular test infrastructure.
The only reason they were created as modular tests was because we wanted more
control over the SDK sources used.
Change-Id: I2ad5aa616ff8bccd10cfac2d49bfaa39ab50c192
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128801
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Legacy and nullable types will get wrapped with their respective wrappers when
compiling applications with null safety enabled.
Change-Id: I1defe4fc9d5d9b5eacf23a479178eca060ea716b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128379
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Bug: https://github.com/dart-lang/sdk/issues/39627
Lists in a future should be typed with dynamic since they come from JS
interop.
Results from running tools/dom/scripts/go.sh
Change-Id: I4ed37d6f5fa570beef71652dcad17c3bcf7560ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128300
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
This code is causing an issue when running tests with the NNBD SDK. As I
understand it used to be possible to pass a function to assert but that feature
was removed from the language. We might as well remove it from DDC too :)
Change-Id: Ia62c653ec9d4c98694986b2c326d2b1b027b9ed9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128308
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
This change fixes the issues causing build failures when using the
forked NNBD SDK sources and trying to build the dartdevc_kernel_sdk
target.
The end result is a dart_sdk.js file that is known to be incorrect
(missing uses of the legacy and nullable type wrapping) but serves
as a baseline for improvement. Some tests of the runtime directly
will correctly pass.
Following changes will turn on the type wrapping and we can start
diagnosing and fixing the issues that appear.
Fixes: #38665
Change-Id: Iddcf31ef2520fa54bf7d9ae6262c2264636b9b10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127780
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
This is the first step in deleting legacy DDC!
* Default all invocations of DDC to run the kernel version.
* Disable all tests that run analyzer DDC.
* Detect the most likely case when invoked with an analyzer
summary and print instruction to update build_web_compilers
dependency.
I will follow up with deletions, and a rename of the test configurations/
builders to reclaim the names (ddc vs ddk, dartdevc vs dartdevk).
Issue #38777
Change-Id: I1477f0274b6b7f345a5e19d2b3f93797c454a09e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127067
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>