- Make a snapshot in Dart 2 mode
- Check for the VM argument `--preview-dart-2` and run the correct
snapshot
Towards fixing https://github.com/dart-lang/sdk/issues/32188
Change-Id: I56d5e7f268ff40b80783fae571981705536280f2
Reviewed-on: https://dart-review.googlesource.com/54743
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reason for revert: Breaking API change blocks Flutter rolls. Reverting
to reconsider, work around, etc..
Revert "[ VM ] Fixed issue where backing array was deleted from an ExternalTypedData before the ExternalTypedData was used."
This reverts commit 916b9da48d.
Revert "[ VM ] Fixed tests for non-UTF8 paths on Windows / Macos."
This reverts commit 6327fe91c2.
Revert "[ VM ] Fix failing tests on Windows bots after non-UTF-8 paths change."
This reverts commit b51f4b7956.
Revert "[ VM ] Updated non-UTF-8 tests to expect exceptions on OSX/iOS."
This reverts commit bcb36247d2.
Revert "Revert "[ VM ] Updated non-UTF-8 tests to expect exceptions on OSX/iOS.""
This reverts commit 24450c79a5.
Change-Id: I756f74f4acdde168d0984fe130f05f9252366334
Reviewed-on: https://dart-review.googlesource.com/55441
Reviewed-by: Todd Volkert <tvolkert@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
Move implementation details into patch files, it does not belong in the interface.
Actually implement NoSuchMethod.withInvocation in dart2js.
Change-Id: I37049c258067b962d18eff42196e37aa127f0dea
Reviewed-on: https://dart-review.googlesource.com/55166
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reland "Fix issues with FileSystemEntities which have non-UTF8 paths causing exceptions to be thrown when converting to/from a Dart VM String."
This reverts commit 4f549e2900.
Change-Id: Ia27c8c300beb178fa7b08ffe0bfcb2d61f65bbb5
Reviewed-on: https://dart-review.googlesource.com/55271
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
The rest of the code was used in a single place, so I've moved the code to the
appropriate library.
Change-Id: Idd0416bf7365e3de05f20ab1184428ae7ae614b2
Reviewed-on: https://dart-review.googlesource.com/54745
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
This reverts commit ba342a94ec.
Reason for revert: Bots are red.
Original change's description:
> Fix issues with FileSystemEntities which have non-UTF8 paths causing exceptions to be thrown when converting to/from a Dart VM String.
>
> Continuation of PR #32583 by powdercloud
>
> Fixes#29451
>
> Change-Id: I4bdf24f9c8ead425a4f0cad33b642908f1ec203d
> Reviewed-on: https://dart-review.googlesource.com/51580
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Zach Anderson <zra@google.com>
TBR=bkonyi@google.com,rmacnak@google.com,zra@google.com,tvolkert@google.com
Change-Id: I12850f178a13a75289d18af4e565bd73c59b14ad
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/55060
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Continuation of PR #32583 by powdercloud
Fixes#29451
Change-Id: I4bdf24f9c8ead425a4f0cad33b642908f1ec203d
Reviewed-on: https://dart-review.googlesource.com/51580
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
This should fix the bots for FF and safari. (Chrome returns '', but FF and
Safari return a null value.)
TBR=sra@google.com
Change-Id: I9a402d3c9f4fed09b9181a8ec29f68ff6770e509
Reviewed-on: https://dart-review.googlesource.com/54714
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
dart2js will now set the CSP nonce on scripts that are inserted for deferred
loads. Note that this change only applies to the default hunk loader. Custom
hooks need to set the nonce value manually.
Fixes https://github.com/dart-lang/sdk/issues/33061
Change-Id: I04abc7904dff22dad586690d175b87c77c3f1fe2
Reviewed-on: https://dart-review.googlesource.com/54702
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Previously, we would wait for a Future to terminate before destroying
the underlying raw socket. If that future never terminated, we would
leak the underlying file descriptor.
Now, the "force" codepath in close destroys the socket immediately
(similar to what it did previously for active sockets) and the non-force
codepath has a timeout, as requested by a TODO comment.
Change-Id: I021a93a40e4708ce93b4f1ae6c3f7289764bd69f
Reviewed-on: https://dart-review.googlesource.com/54442
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Adam Barth <abarth@google.com>
This starts removing support for isolates. I've kept around the
isolate library for now, but I stopped injecting the isolate logic
unless you directly access an isolate API.
Concrete changes:
* Timer no longer uses the event queue: this was only used in worker
isolates, soon to be removed.
* Checking for whether the code is run within a worker is not dependent
on initializing the isolates global state. This was important to allow
deferred-loading to work without the isolate logic.
* Workers no longer track pending async calls correctly. This may make it possible
to terminate worker isolates early, again this wont be relevant shortly.
Bug: https://github.com/dart-lang/sdk/issues/32684
Change-Id: I05025418e05c3641ba1a3bc34ea75ca558a28fbd
Reviewed-on: https://dart-review.googlesource.com/54160
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Deprecate `retype` and forward it to `cast`.
Change-Id: Ie17ffdd1eef0d3f19582bf638c5349927c7b5ebd
Reviewed-on: https://dart-review.googlesource.com/53802
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
This makes it possible to do:
js.context['self'].addEventListener('message',
allowInterop((e) => print('received')));
Change-Id: I202b6c881372a77c0ec41dd334e9aa76286d7796
Reviewed-on: https://dart-review.googlesource.com/54068
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
We should work on merging d8.js and this file, since they are almost identical.
Closes#7728
Change-Id: I4f754a4f59ad3b498eba7658d38cecc617bf784d
Reviewed-on: https://dart-review.googlesource.com/53860
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
This avoids conflicts with client repos that have a file
//build/compiled_action.gni with something different in them.
Change-Id: I133f66b0989bcb547cb8eed8710a88e2c1384bd7
Reviewed-on: https://dart-review.googlesource.com/53440
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
This CL updates dart:io but not dart:_http. It updates the sdk sources,
the patch files, and tests.
Change-Id: I64c3da407f09fa2bc6eec582049c4ae3a8afbe6d
Reviewed-on: https://dart-review.googlesource.com/52990
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Its last user was Dartium's DevTools.
Change-Id: I86e1a2aacc7f2589be53418b3030accc0cef9a7d
Reviewed-on: https://dart-review.googlesource.com/53464
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This adds a special RTI representation for a type argument of a
(supertype of a) js-interop class, which effectively is the Dart 1
`dynamic` type.
Closes#32969
Change-Id: Ifd92b3fc6779d96d354ad929bd7c07a349299ae6
Reviewed-on: https://dart-review.googlesource.com/53002
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
The static methods allow type parameters to be registered,
but this means that the type parameters will be dropped unless in strong mode.
Change-Id: I91c1977c287c14742df7d59b988e64ddc46f794d
Reviewed-on: https://dart-review.googlesource.com/52870
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
This reverts commit 9bb085a1c6 due to
test failure in google3.
Change-Id: I63940e62bd97c83bc432db99b44c991e6c1e025e
Reviewed-on: https://dart-review.googlesource.com/52422
Reviewed-by: Dan Grove <dgrove@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Put in types to avoid some implicit downcasts in _SyncStarIterator.
Change-Id: I0b04a20ccc84e20f95469a0515a054caf4cf4b34
Reviewed-on: https://dart-review.googlesource.com/52420
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Allows a rule to depend on create_sdk and declare a part of the SDK as an input. Doing both is good style in GN, and is needed for polymorphism with a prebuilt SDK, which would have an empty dependency and an input to detect updates to the prebuilt artifacts.
Change-Id: Icbb05a1073c6b18517dd715fba047c80caa3e8cd
Reviewed-on: https://dart-review.googlesource.com/52401
Reviewed-by: Zach Anderson <zra@google.com>
A<dynamic> is _not_ a subtype of A<int> in Dart 2
Change-Id: I0d1185b38192a06aaf9d8622a78c7384dfc287dc
Reviewed-on: https://dart-review.googlesource.com/52106
Reviewed-by: Sigmund Cherem <sigmund@google.com>
The values returned from calling sync*, async and async* are now parameterised.
Simple cases where the type has no type parameters are handled.
The next step is to introduce a signature-like j-model entity to compute the type in more complex cases.
Change-Id: I2e43088cc6383a70e3a3d3067ec7542694ee2d0a
Reviewed-on: https://dart-review.googlesource.com/51421
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
This includes Fasta, tools and observatory, so the checked-in SDK must
have the lower-case constants.
Change-Id: I8380ad041ad058f7d02ae19caccfecd434d13d75
Reviewed-on: https://dart-review.googlesource.com/50201
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Replace
var element = JS('', '#[#]', this, i);
with
var element = JS<E>('', '#[#]', this, i);
to ensure 'element' has the static type E.
I would prefer
E element = JS('', '#[#]', this, i);
but that makes legacy checked mode insert unneeded type assertions.
Change-Id: I74446ca7bfa748490347100093a94b9191ca6821
Reviewed-on: https://dart-review.googlesource.com/50860
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Type arguments that require a subsitution need the interceptor to
access the substitution function.
- Add an interceptor input to HTypeInfoReadVariable
- Add an entry point getRuntimeTypeArgumentIntercepted that takes the interceptor.
- Optimize uses that do not need the interceptor.
The interceptor is cheap to get from the context in the common case
that the type variable access is directly in an instance method.
A typical use (broken)
var t1 = H.getRuntimeTypeArgument(receiver, "ListMixin", 0);
becomes
var t1 = H.getRuntimeTypeArgumentIntercepted(this, receiver, "ListMixin", 0);
Change-Id: I2abe6a2b6e8d2cdb0ede1b7248dd8337830f8a0c
Reviewed-on: https://dart-review.googlesource.com/50640
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Optimisitically always wrapped the `compare` argument, even if it was `null`.
Change-Id: I811affad97edc9e98af07abd323a25478e45a392
Reviewed-on: https://dart-review.googlesource.com/50724
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
- Add a type argument count to JSInvocationMirror.
- Change stubs to pass the argument count.
Change-Id: I448dbee9a2aa0be17c24ae79eae0c89e7574fa7c
Reviewed-on: https://dart-review.googlesource.com/49820
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
R=sra@google.com,sigmund@google.com
Change-Id: I2f5ccae15bcd993ab1e15ab556a25d6e0cd1d450
Reviewed-on: https://dart-review.googlesource.com/50504
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Terry Lucas <terry@google.com>
"=Object" was inacurate and contradicted the inferred type <Function> in strong mode.
Change-Id: Ibee4351357dde4aaacf95ff7265cd335fc5d06ea
Reviewed-on: https://dart-review.googlesource.com/49832
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Fixes errors in RegExp and String.fromCharCodes.
TBR=sigmund@google.com
Change-Id: I7f84d2b9ee2dfead6d0cf634e36c06b9071bf991
Reviewed-on: https://dart-review.googlesource.com/49981
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Avoids issues where they are lazily created in a different current zone and that zone messes with, for example, schedule microtask, which the future uses to schedule invocations of its callbacks.
Change-Id: I6697ca469426472523089fcf7ca44312b9c6ff5f
Reviewed-on: https://dart-review.googlesource.com/49509
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Florian Loitsch <floitsch@google.com>
Also remove mentions in documentation.
Change-Id: I51ad3137fff505168acde7f2e21bebc42a49da3b
Reviewed-on: https://dart-review.googlesource.com/49721
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
The trick of detecting isIntercepted from the number of arguments does
not work with function type arguments. We fixed this in other places,
now fix it in the full emitter.
Change-Id: I35fcda11db1df0e7442b66317c9ea20674514722
Reviewed-on: https://dart-review.googlesource.com/48922
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
This disables most runtime features of dart:isolate, similar to dart:io.
For now, this supports `new ReceivePort()` and `ReceivePort.close` as
those are used by async tests to keep the Dart VM alive. Those are
no-ops in DDC. Also removes most of dart:_isolate_helper, except for
the JS API that's used to bootstrap DDC `main()`.
Change-Id: I84eab6cd39d05a70a6afe982e952076ddaaa8c0f
Reviewed-on: https://dart-review.googlesource.com/45754
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
This is so we correctly answer `const bool.fromEnvironment("dart.library.js")`
as true when --categories=Server is passed to the compiler.
Change-Id: Id12a0af65905fabc23ef5a1cd3e5fd837bc8b766
Reviewed-on: https://dart-review.googlesource.com/48265
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Change-Id: Ic8172f4574a35ac31910ac0d5934c0d63db40a23
Reviewed-on: https://dart-review.googlesource.com/48060
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
This uses the environment_overrides section that I'm adding to the libraries
specification files.
Change-Id: I95c175533f21320dd44eab9988afe2644ed0c9d3
Reviewed-on: https://dart-review.googlesource.com/47406
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
This change is needed to be able to introduce a new platform "dart2js_server"
that represents compiling to dart2js for non-browser targets (like nodejs). Some
users (like Dart Sass) depend on this feature.
The old front-end made this work by using "--categories=all", this change should
make it possible to compile with "--categories=Server".
Change-Id: I41bf25ab19016154206c419a48884bdc4afbd444
Reviewed-on: https://dart-review.googlesource.com/47700
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Long ago I accidentally only made the change to _cfe.dart in the .json file and
not in the .yaml file (which is technically the source of truth).
Change-Id: I0e8abdc84b9b0f20019c712246493979debaf1cd
Reviewed-on: https://dart-review.googlesource.com/47323
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Add tests.
Change-Id: If27b6c987c944ebb84d43acde012f5b44730c4e7
Reviewed-on: https://dart-review.googlesource.com/45501
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Fix all deprecation warnings in the kernel and vm packages.
Change-Id: I44e5b128cc8fbc1360ad4c49ecdf2aa7cfd269d8
Reviewed-on: https://dart-review.googlesource.com/46720
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
This reverts commit 60a2cfa219.
Change-Id: I6d83653c72d5e8576952a631d23be5be5d9c71f6
Reviewed-on: https://dart-review.googlesource.com/46384
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Fixes#32464
BUG: http://dartbug.com/32464
Change-Id: I1462452c3f6a7838aeaaa84e3fb0e092a3f85338
Reviewed-on: https://dart-review.googlesource.com/45704
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Change-Id: Ic9a180cbb758cf8fe51369d904fa4b51fd1b8e27
Reviewed-on: https://dart-review.googlesource.com/44480
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
This makes sure we can distinguish e.g. 2 different timeline.dart files
(from runtime/lib/timeline.dart and sdk/lib/developer/timeline.dart)
This CL also fixes the owner of constructors to be patch classes, if
the constructors come from a patch.
This CL also adds a service/valid_source_locations_test, which loops
over libraries/classes/fields/functions and obtains source locations for
them, including line numbers. This ensures that if there is a source
location attached to a member, we can use it's token position to get to
the line number.
This CL also changes package:kernel's [Cloner] to clone fileOffsets (and
not just fileEndOffsets). This is important for mixin resolution, where
we copy members into mixin application classes.
Issue https://github.com/dart-lang/sdk/issues/32489
Change-Id: I4fea5cd646d81f47e1c4ede1e86d477ba6de3e82
Reviewed-on: https://dart-review.googlesource.com/46141
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
The whereType method silently does the wrong thing without methods,
so make it throw until we turn them on everywhere.
Change-Id: Id934c8bdb4f682dbc3560d78fbca580e37297e2d
Reviewed-on: https://dart-review.googlesource.com/45744
Reviewed-by: Nate Bosch <nbosch@google.com>
Add `typeArguments` to Invocation.
Add constructors to Invocation, making it less necessary for users to create their own implementations.
Add tests.
Add Symbol.unaryMinus and Symbol.empty constants.
Change-Id: I70cb3265f9413617cf57fce1297e393a29eeb26a
Reviewed-on: https://dart-review.googlesource.com/40741
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
This class can be used to annotate declarations with
tool specific hints.
For example @pragma('vm:extern') can tell that a method is invoked from
outside (e.g. via VM C API), which informs Kernel based tools not to
tree-shake this method.
Design doc (internal) https://docs.google.com/document/d/1yqje8uctBqITcwKxhebb0EHunY1bt0Qd4yZExrTHIW8/edit
Change-Id: Icf2106accfb1167124582466a3a55486d432793d
Reviewed-on: https://dart-review.googlesource.com/43062
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Change-Id: Ia923f953069bd41dbd5f0f3dc48aa55bad46aabd
Reviewed-on: https://dart-review.googlesource.com/45220
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
This reverts commit 44aa9a17fd.
Reason for revert: The dartdoc API documentation generator cannot handle Future<void> yet. This is filed as a P0 issue, and the change should be relanded when it is fixed: https://github.com/dart-lang/dartdoc/issues/1625
Original change's description:
> Do not return this on RandomAccessFile.close
>
> Bug: 32015
> Change-Id: I98508bdad569201afeed91f1287f061b5bb39a31
> Reviewed-on: https://dart-review.googlesource.com/44060
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
TBR=lrn@google.com,vegorov@google.com,zra@google.com,sigmund@google.com,lexa.knyazev@gmail.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: 32015
Change-Id: I658b997cdc62e23cfb4fec8921e19239d534e272
Reviewed-on: https://dart-review.googlesource.com/44980
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: William Hesse <whesse@google.com>
This must land after we make the libraries strong clean.
Change-Id: I3a49a2be3b2bcb15842434266f55ce49e3800fc6
Reviewed-on: https://dart-review.googlesource.com/42140
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
These are a couple of cases where inlining differs from the previous
version and makes a difference in angular code.
Change-Id: Ibc8ba0d720b8bb49481c41e1332fc6a4a0292d9d
Reviewed-on: https://dart-review.googlesource.com/44701
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Change-Id: I9a2e07de692127069d8098e3a0ea45846a3f45ae
Reviewed-on: https://dart-review.googlesource.com/43672
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
dart:isolate was used for the `Future<Isolate>` return type of
spawnDomUri, which is an unimplemented experimental method. This method
now returns `Future`.
This change helps dart4web disable support for dart:isolate (#30538)
Change-Id: Ida87c2a27ac33d1b9a14feb7dd6d306a546a0aaf
Reviewed-on: https://dart-review.googlesource.com/43860
Reviewed-by: Terry Lucas <terry@google.com>
Some legacy libraries may import dart:mirrors, but not use it. This CL turns them
into a runtime error temporarily to give some time for the library
maintainers to remove the import to dart:mirrors in the future.
Change-Id: I876133908d2a61300256915aab54730bdff51649
Reviewed-on: https://dart-review.googlesource.com/43640
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
Change-Id: I40574d695826a3ed038c7c756ce980fae001325d
Reviewed-on: https://dart-review.googlesource.com/43040
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Event type parameters instead of dynamic.
- Fixed missing interceptor in dart2js for MutationEvent (even though its deprecated
and should not be used). The MutationEvent is created when a node is deleted. Enabled
Dart MutationEvent class generation.
- Fixed/re-enabled all indexed_db tests to run and pass successfully.
Stephen please take a look - target in VersionChangeEvent is a final field, per your suggestion,
instead of a getter. The MutationEvent is returned in the browser and without the MutationEvent
Dart class the error:
Uncaught TypeError: t1.get$target is not a function
R=vsm@google.com,gabrielchow@google.com,sra@google.com
Change-Id: Ic36aea8c33b4263a32ff9d047ba3e6b979e03b10
Reviewed-on: https://dart-review.googlesource.com/41569
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Terry Lucas <terry@google.com>
Change-Id: I86c8d849c8137854b3a2dfa966cf86c9475f9f72
Reviewed-on: https://dart-review.googlesource.com/43201
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
This change is to recover 6% lost on Intl.NumberFormat.format.reused
when JSNumber was make Dart2 clean.
Use invoke_dynamic_specializer to replace call with HAbs instruction.
Inject receiver check to condition receiver to a non-null number to
improve. This part makes x.abs() one of the operations 'trusted' by
'--trust-primitives'.
Add one-shot accelerators for abs and get:sign.
Change-Id: Ia423c4b398114abe1d4a784febbe664710f0a242
Reviewed-on: https://dart-review.googlesource.com/42890
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
In JavaScript, and integral valued double is an 'int'.
Change-Id: I79dedcb00f74dc699f85a21a2052239ed25b7974
Reviewed-on: https://dart-review.googlesource.com/41640
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
This may introduce extra interceptor methods for JSInt, we should consider
optimizing these separately (see https://github.com/dart-lang/sdk/issues/32252)
Change-Id: I26ee463c8672d67cd44b21b6ac50a1842b6e7b1e
Reviewed-on: https://dart-review.googlesource.com/42523
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
This is a partial list, there are still 8 issues remaining, most of them in
js_number.dart, one that is not but the FE is not giving me a location for some
reason.
Change-Id: I2bd1d24256147e255f487e100ce800c3ba791ce5
Reviewed-on: https://dart-review.googlesource.com/42122
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
1. Make bitLength work on very large values. This fixes problems with
BigInt.from on large values.
2. Restructure to allow Math.clz32 to be used once dart2js no longer
supporst IE11.
Change-Id: I255f030ff3b3630cdee63502d11a8b6630a4f008
Reviewed-on: https://dart-review.googlesource.com/41960
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Change-Id: I44c084353b35e16cd2fd5481d86a7be6c0b62ef3
Reviewed-on: https://dart-review.googlesource.com/41160
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
This change adds most of Dart 2 subtype checking to js_runtime.
The main observable change is the stronger subtyping of function types.
The subtype code is split into V1 and V2 methods with the intention to
eventually remove the V1 paths.
There is a lot of minor details that are still TODO:
- TODO: generalized void
- TODO: comparison on type variable by it's bound
- TODO: FutureOr
Change-Id: Id05db0aef5ce0d58416a72f1538a90ed67436b3e
Reviewed-on: https://dart-review.googlesource.com/37960
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
On Fuchsia, we need external typed data arrays that are backed by
read-only regions of memory. Today, writes to these typed data
lists crash the process. This change allows us to wrap the
external typed data in unmodifiable views so that an exception
is thrown instead of crashing.
related #32028
Change-Id: I94dc5e1771b73480cb0eb21799215c090000fd5f
Reviewed-on: https://dart-review.googlesource.com/40201
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
Switch default for StreamController.addStream cancelOnError parameter to false.
Add orElse named argument to Stream.{first,last}Where.
First step in renaming the argument from defaultValue to orElse.
Change-Id: I22039c1f6933664ebc287c71e802799a64776f08
Reviewed-on: https://dart-review.googlesource.com/34822
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Changes signature of Iterable.singleWhere.
Makes LinkedHashMap no longer be a HashMap.
Change-Id: I7a12fea533d42b0fc8357086649df38ad01f3cdd
Reviewed-on: https://dart-review.googlesource.com/39140
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
This reverts commit 0b59f24f97.
Reason for revert: Creates crashes in dart2js with kernel, see
https://luci-milo.appspot.com/buildbot/client.dart/dart2js-linux-d8-minified-1-5-be/9751
Original change's description:
> New methods on Iterable, List, Set, Queue, Map.
> Changes signature of Iterable.singleWhere.
> Makes LinkedHashMap no longer be a HashMap.
>
> Change-Id: Ibd7e56e1ac03cb9fb10d19d1328d452fcd06d89f
> Reviewed-on: https://dart-review.googlesource.com/32541
> Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
> Reviewed-by: Leaf Petersen <leafp@google.com>
TBR=lrn@google.com,leafp@google.com
Change-Id: Iab904f5885a5213ae2e16ef496eed0b6843185f3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/39060
Reviewed-by: William Hesse <whesse@google.com>
Changes signature of Iterable.singleWhere.
Makes LinkedHashMap no longer be a HashMap.
Change-Id: Ibd7e56e1ac03cb9fb10d19d1328d452fcd06d89f
Reviewed-on: https://dart-review.googlesource.com/32541
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
The classes are still identical, but will diverge as the VM will provide an
optimized version.
Change-Id: I8397fd927b89fa745ac7aa4b8d98e562140f731b
Reviewed-on: https://dart-review.googlesource.com/35521
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
They are encoded as annotations on the importing library, similarly to
how native methods are encoded.
Change-Id: I4dc1119b20949308e4856666693fe4e890e9ee87
Reviewed-on: https://dart-review.googlesource.com/35660
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Adds a ProcessStartMode in which the child process inherits the stdio
handles from the parent.
Change-Id: Ibe7b8ae08caccaed827ae0a911a3cced7803cb6b
Reviewed-on: https://dart-review.googlesource.com/36362
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
The content handlers on Fuchsia can potentially give each Isolate
different handles to use for stdout and stderr. This change provides
a hook for an embedder to call to supply the handles to Dart, and
removes hardcoding of stdio handles to 0, 1, 2.
Change-Id: Ic03b77adc9a911e9c754562fa6a91f9929e10dfc
Reviewed-on: https://dart-review.googlesource.com/36122
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
With these changes, migration can more efficiently convert existing
code, and can actually change the addStream signature to not specify
"true".
Change-Id: I65a90afe2716e9a99d41e5f55bf1e0dcc5d3e40e
Reviewed-on: https://dart-review.googlesource.com/35183
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Fixes analyzer test failures on the bots.
Change-Id: I426ce7be20bac0ab57b8921db0ffa5fe2be15871
Reviewed-on: https://dart-review.googlesource.com/35760
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
This is a reland of https://dart-review.googlesource.com/#/c/sdk/+/28920/
with the following changes:
- It creates a new library dart:cli
- waitFor(Future) goes in dart:cli instead of dart:io
- Removes a flaky test, and adds a missing precompiler entrypoint
- Adds waitFor(Future)
- Improves doc comments
fixes#31102
Change-Id: I04d2c46fd0afac049dd4fd1353905dc20da18f90
Reviewed-on: https://dart-review.googlesource.com/29449
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Natalie Weizenbaum <nweiz@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
This aligns us with JS engines and Unicode 6.3
R=lrn@google.com
Bug: 29060
Change-Id: I0b6356f0e652f7c9841bcf6485aa591a3d835061
Reviewed-on: https://dart-review.googlesource.com/35560
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Corry <erikcorry@google.com>
Some parts of the Dart build need to be customized when running the
host steps for a build ultimately targeting a Fuchsia build. This was
set by passing a special GN variable indicating that a configuration
was a host configuration targeting a Fuchsia build, but the built-in GN
variable 'target_os' has the same result as it is the same across all
toolchains in a particular build. This replaces the test:
is_fuchsia || is_fuchsia_host
with the equivalent:
target_os == "fuchsia"
and the less common:
is_fuchsia_host
with:
target_os != current_os && target_os == "fuchsia"
Change-Id: Iabec1fb2879b234ca44c9e03b2f4a62ffbc6fa4a
Reviewed-on: https://dart-review.googlesource.com/35542
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
Two follow-on optimization would reduce the generated code to closer to the original size:
- It would be profitable to write an optimization the removes the type
information from any list when it can be proven the type information
is not used.
- Provided the split result list is not modified, we can strengthen
accesses to be non-null Strings.
Bug: https://github.com/dart-lang/sdk/issues/30548
Change-Id: I87ecdd129ec0227f982bd2e1f34193b3d6b0d81b
Reviewed-on: https://dart-review.googlesource.com/35081
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Change-Id: Idf83e7f5dfb95e0097fa73fa0a0ecd68c76d2ac9
Reviewed-on: https://dart-review.googlesource.com/35381
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
- I beleive create_snapshot.dart is no longer in use: it was replaced by
create_snapshot_entry + GN application snapshot rules.
- utils_wrapper seems to be something really historical (maybe we thought we
were going to only have a single wrapper for all of our tools back in the
day). The only use of it is to track build dependencies in test.py, which I
think we can do by directly using dart2js.dart.snapshot instead.
Change-Id: I6e32403eb8c5d40f0b58e48ae5ff6fb60fd855b3
Reviewed-on: https://dart-review.googlesource.com/34923
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
The goal is to renable it as soon as we migrate our constant-evaluator and
constant folding to use Bigint.
Change-Id: I3bba1bbe07517e9cb496896b3417f58173878d62
Reviewed-on: https://dart-review.googlesource.com/34302
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Change Fasta type inference and Kernel type checking to use the new
definition for Future flattening, which is really unwrapping (peeling
off one layer of Future or FutureOr). Use this for inferring types of
`await` expressions and return types from `async` functions.
Ensure that we are using the same notion of flattening for inference
and checking. (Maybe it was a red flag that we weren't.)
This fixes await_test so that it produces a runtime error rather than
a compile time error - see #31541.
A similar change will need to be made to the analyzer - see #31887.
Change-Id: I7d936e9788969a48fdc216628eaa793389fb5e30
Reviewed-on: https://dart-review.googlesource.com/34504
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
This linked in kernel service dill file will be used to load the kernel
isolate if the attempt to lookup the kernel service snapshot fails. The
kernel service snapshot is looked up in the following order.
1. If the "--dfe" option is specified, the file specified is used.
2. If the kernel service snapshot is found next to the executable,
then it is used.
3. If the kernel service snapshot is found in the "snapshots" directory
next to the executable, then it is used.
Change-Id: I5a0e757eb27b26a274b22b4bc36350fee59a100f
Reviewed-on: https://dart-review.googlesource.com/32446
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Chandra <sivachandra@google.com>
Remove use of castTo, which is not yet available in the prebuilt SDK used to build Observatory.
Bug: https://github.com/dart-lang/sdk/issues/31587
Change-Id: Ia118710a2c4dca1851935d284e1a78a9c6517256
Reviewed-on: https://dart-review.googlesource.com/34022
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
- Added JS_GET_FLAG('STRONG_MODE') allow the code to be tailored to
the type system version.
- Split type stringifying code into V1 (existing logic) and V2
(strong mode Dart 2.0 logic).
The V1 code will eventually be deleted.
Change-Id: I78db91796040b6ecfa1bd5d6a9d64bd4c2bc4bcf
Reviewed-on: https://dart-review.googlesource.com/33680
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
I also added safe-printed irritant to the message, which in the case
of a primitive value or closure would tell you what value is causing
the problem.
Bug:
Change-Id: I530f5185f06d54ddc2ad4d45e11fa08b71213338
Reviewed-on: https://dart-review.googlesource.com/33260
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Update some documentation.
Change-Id: I4e05d89e84bd35068ca57917e752af235c62b647
Reviewed-on: https://dart-review.googlesource.com/32762
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
'Normalize' the data used for loading deferred libraries. Replace
URIs and SHA1 hashes with indexes so that the URIs and hashes occur
once.
Bug: https://github.com/dart-lang/sdk/issues/29635
Change-Id: I3ac8791ad44ca588cbb1bd7d86f18243c956a04a
Reviewed-on: https://dart-review.googlesource.com/32505
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Start by adding static castTo method to the interfaces. This provides everybody with the
desired implementation without exposing the classes.
When implementing the cast method, the recommended way is to (extend the base class,
but if you choose not to ...) use the castTo method.
If we ever get a language feature, we can implement the castTo method using that,
without being stuck with an unnecessary class.
Change-Id: I53274e60c88a4de519bead85d2ca44c1065a9c1a
Reviewed-on: https://dart-review.googlesource.com/26620
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Also, updated status files to correctly fix failures in FF, IE and removed other spurious status entries.
R=alanknight@google.com,vsm@google.com
Change-Id: Ic965103d892ff4d5d119712e3187e829f57cd022
Reviewed-on: https://dart-review.googlesource.com/31800
Reviewed-by: Terry Lucas <terry@google.com>
This reverts commit 0c8294e4a0.
Bug:
Change-Id: Idb35c64fd5365f2669e8aff45765fed74e0f0766
Reviewed-on: https://dart-review.googlesource.com/31440
Commit-Queue: Terry Lucas <terry@google.com>
Reviewed-by: Terry Lucas <terry@google.com>
This solves some arcane issues with Fuchsia's GN complexities,
explained further in the comments. It obviates "copy_dylibs".
Change-Id: If1b26bfa73d5167550d2217258fa074b9dacade9
Reviewed-on: https://dart-review.googlesource.com/30924
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
@Experimental is already defined in dart:html. Adding the same
annotation to dart:core breaks the build. Removing the annotation from
dart:html and adding it to dart:core is a breaking change, e.g.
if someone has said "import 'dart:html' show Experimental".
This annotation is for use in the upcoming dart:standalone with
the waitFor(Future f) function:
https://dart-review.googlesource.com/c/sdk/+/29449
Change-Id: Iea2f537a2ae89a6097c4284084a2a168e833bb04
Reviewed-on: https://dart-review.googlesource.com/30261
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
In 5a44162c97 in attempt to adhere to declared
method signatures we lost zero-copying JSON decoding of responses from
VM: `Message.sendToVM` was changed to always decode the response into
string before passing it to the caller and the logic to use fused
JSON decoding was removed. This increased peak memory consumption by
the VM Service.
This commit addresses the issue by restoring the zero-copying JSON decoding
logic while adding a wrapper around responses that make it clear what kind
of data is passed around and how that data is encoded and handled.
We introduce a class `Response` which can contain either a Dart string, a
binary data (represented as a Uint8List) or utf8 encoded string (represented
as a Uint8List). This class is used in all places where previously a String
or dynamic were used, e.g. MessageRouter.routeRequest is changed to return
Future<Response> rather than Future<String>. This allows callees to
decode JSON responses without copying them into Dart heap while
maintaining sufficient level of typing to make the code easy to reason about.
This commit also removes some dead code from the VM service related to old
Service API and TAR assets unpacking (which has been long done in C++).
Bug: https://github.com/flutter/flutter/issues/13626
Change-Id: Ifbba56944a552034a0f802a965a313326a1236e7
Reviewed-on: https://dart-review.googlesource.com/30280
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
These members were defined as returning Future<Socket>, but the
implementation in _Socket didn't conform to the interface. There's no
reason these members need to return Future<Socket> anyway, so just
change them to return Future<dynamic>.
Avoids a strong mode error in socket_patch.dart.
Change-Id: Icdda5c7880daf0241e36f1d35e61d171f1694409
Reviewed-on: https://dart-review.googlesource.com/29741
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Change-Id: I3f90979fad2681775cae56d499f3ff5968ea6485
Reviewed-on: https://dart-review.googlesource.com/29545
Commit-Queue: Terry Lucas <terry@google.com>
Reviewed-by: Terry Lucas <terry@google.com>
Moved `parseRadix` into a separate test where it doesn't do 10 iterations.
This reverts commit ab4061471b.
Change-Id: Ie48216c2f4f077dc86f915a54021c39706c432e8
Reviewed-on: https://dart-review.googlesource.com/29593
Reviewed-by: Florian Loitsch <floitsch@google.com>
Commit-Queue: Florian Loitsch <floitsch@google.com>
The only fix needed for relanding is adding _ensureScheduleImmediate
to the list of vm entrypoints in //runtime/vm/compiler/aot/precompiler.cc
Original commit message:
Adds a top-level call waitForEventSync to dart:io that blocks the
thread an Isolate is running on until messages are available.
Before the thread blocks, the microtask queue is drained.
Before waitForEventSync returns, all messages are handled.
Lifting this up from a comment:
This is apropos of the request that nweiz@ sent to the mailing list a
couple weeks back. I'm not sure we should land this. We certainly
shouldn't land it without some annotations that will make the analyzer
complain a lot in most configurations, but I don't know what those
annotations are.
fixes#31102
Change-Id: Id96de46cc5f10e1847045cfafb7cfed6a38bce16
Reviewed-on: https://dart-review.googlesource.com/28920
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
There were two situations where this could get into a bad state:
* If the sink already had an error, _isBound would be set to true and
never unset. This is fixed by not setting it at all if an error
already exists.
* If _controllerCompleter completed to an error, _isBound would never
get set back to false. This is fixed by refactoring the code so that
the appropriate whenComplete() is always run.
Change-Id: Ia511fa3e2345213ff8e56dc4fae6f397b84257d1
Reviewed-on: https://dart-review.googlesource.com/26981
Commit-Queue: Natalie Weizenbaum <nweiz@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
This reverts commit 2aed87a133.
Reverting for failures on precompiled bots.
Change-Id: I758bfc72d8f5e67b0e5e12a7367a47f1df9364e2
Reviewed-on: https://dart-review.googlesource.com/28900
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
Adds a top-level call waitForEventSync to dart:io that blocks the
thread an Isolate is running on until messages are available.
Before the thread blocks, the microtask queue is drained.
Before waitForEventSync returns, all messages are handled.
Lifting this up from a comment:
This is apropos of the request that nweiz@ sent to the mailing list a
couple weeks back. I'm not sure we should land this. We certainly
shouldn't land it without some annotations that will make the analyzer
complain a lot in most configurations, but I don't know what those
annotations are.
Change-Id: If8286f4525994a162dd4f4563fefccb9d0984f7c
Reviewed-on: https://dart-review.googlesource.com/25281
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Without strong mode, a "good enough" implementation is to simply call
the generic method with "dynamic" for the type arguments, which is what
this does. That should be enough to unblock our internal users.
We also need to not report a compile error when
dart_internal/extract_type_arguments.dart imports the hidden
"dart:_internal" library.
This patch does both of those for the VM and dart2js (using its old
front end).
Note that the test still fails because the test is more particular than
most actual user code would be -- it validates that the instantiated
type arguments are *exactly* correct, and not that the returned object
is merely subtype compatible.
Bug:
Change-Id: I0343beace4991861b29712b3fd7067ec8dc8f8ba
Reviewed-on: https://dart-review.googlesource.com/28020
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
VMService.routeRequest of type Future Function(Message) overrides
MessageRouter.routeRequest of type Future<String> Function(Message).
It not enough to just fix VMService.routeRequest's return type because
Message.sendToVM() violates its type signature: it declares to
return Future<String> but in reality it returns Future<dynamic>
which can complete with either String or List. This CL addresses
this issue as well.
Bug:
Change-Id: I8240113d3e13d67c4e9a59db4250132a2077a4ec
Reviewed-on: https://dart-review.googlesource.com/26701
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
The informal spec for strong mode top level inference
(https://github.com/dart-lang/sdk/pull/28218) says "If there are
multiple overridden/implemented methods, and any two of them have
non-equal types (declared or inferred) for a parameter position which
is being inferred for the overriding method, it is an error."
This CL fixes several SDK errors that arise from this rule. For
example, the classes _Closure, Function, and Object contained members
declared as follows:
class _Closure implements Function {
bool operator ==(other) ...
}
class Function {
bool operator ==(Object other) ...
}
class Object {
bool operator ==(other) ...
}
The type of Object's operator == was (dynamic) -> bool; the type of
Function's operator == was (Object) -> bool; therefore the type of
_Closure's operator == (which overrides both, since _Closure extends
Object and implements Function) cannot be inferred and must be
specified.
A similar situation exists for _Double and _IntegerImplementation
(both implement num, which declares operator == to have type (Object)
-> bool), and _Uri (which implements Uri, which declares operator ==
to have type (Object) -> bool).
This CL fixes the error by specifying the type explicitly in the
classes _Closure, _Double, _IntegerImplementation, and _Uri.
Change-Id: I91f7ceef8549399d438ba4be8c408493b3f338db
Reviewed-on: https://dart-review.googlesource.com/28100
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
We don't have a good place to pull this from on Android, but the
Flutter engine gets notifications when it is updated, etc., so don't
cache the value, and let the embedder supply a closure.
fixes#29211
Change-Id: I18e322fffb5212d9dbe154bc8628f817ba070237
Reviewed-on: https://dart-review.googlesource.com/27924
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
There is no actual implementation here yet (that's your job :) ), but there is:
- An external method in dart:_internal, extractTypeArguments().
- Empty patch methods for that for the VM, dart2js, and DDC. These need to have implementations
filled in.
- A "dart_internal" package to expose a subset of the API. It gives you:
extractListTypeArgument()
extractMapTypeArguments()
We'll bring this into Google, but not publish it externally unless we find we really need to.
- A test for the behavior. It probably has bugs since I can't run it.
See: https://github.com/dart-lang/sdk/issues/31371
Change-Id: I7d9f9a3a36f8e8be106440375c80d584898c83cb
Reviewed-on: https://dart-review.googlesource.com/26467
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
My merge CL is breaking in dart2js. Landing this minimal fix while I look at that.
Bug:
Change-Id: Ie0b17c9643e3ea7e788ff02ca3beef58fe3c3903
Reviewed-on: https://dart-review.googlesource.com/27060
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
This removes the last uses of the generic method comment syntax from
the SDK. There are no additional explicit casts or reified generics
(other than those implied by reifying generic methods) in this CL.
Bug:
Change-Id: Icae23cac60869243cb3ba441f86d70422f68178f
Reviewed-on: https://dart-review.googlesource.com/26081
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
Put a precise type on the printToZone variable, and change entry
calls in startRootIsolate to avoid casting arguments to Null.
Bug:
Change-Id: Ia7d23e8dafa93bd6246ec7fa9b8c14411db30421
Reviewed-on: https://dart-review.googlesource.com/18683
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
This is a strong mode migration that was missed in the earlier rounds.
It allows use of functions that have a more restricted argument type than Object in strong mode
while still ensuring that the argument has a correct type.
Change-Id: Ib00e3f4b4a679c003a992d674c36ef672729b22e
Reviewed-on: https://dart-review.googlesource.com/24540
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Change-Id: I40508c686014f28772109fdfd10c68b986b40be6
Reviewed-on: https://dart-review.googlesource.com/25140
Reviewed-by: Terry Lucas <terry@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Change type arguments for LinkedHashMapCell from reified in strong
mode only (using the comment syntax) to always reified.
Bug:
Change-Id: I567178a413194c72f01d4166e537ecb608c6a708
Reviewed-on: https://dart-review.googlesource.com/21789
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Change-Id: Id13cc838b67785b12f95d19b480a6a830ad5c003
Reviewed-on: https://dart-review.googlesource.com/24120
Commit-Queue: Alexander Thomas <athom@google.com>
Commit-Queue: Karl Klose <karlklose@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Remove comment syntax on methods signatures in convert. This doesn't
change the reified types, but may cause new errors and warnings in
non-strong mode code.
Bug:
Change-Id: Ib811a4918d30eb5ba04300df928ac6c3868b2c2b
Reviewed-on: https://dart-review.googlesource.com/21783
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
Eliminates all of the uses of the "/*=" syntax in the sdk libraries
that can be trivially converted to implicit downcasts.
Bug:
Change-Id: I213a5d683f50d0cec0b32482f44330db3b5d618d
Reviewed-on: https://dart-review.googlesource.com/21781
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
This involves a few main pieces:
- Add code to the GN scripts to generate DDC's patched SDK and then
compile it to summaries and JS in the build output directory.
- Add support to the underlying DDC build scripts to support controlling
which files are built where.
- Update test.dart to use the DDC SDK from the build directory.
- Update create_sdk to use the built SDK instead of the checked in one.
- Fix various internal DDC tools to build their own copy of the SDK
(since they can't easily find the one in the build directory because
it's path if config-specific) and use those.
- Delete the checked DDC SDK JS and summaries.
I think I got everything working. The built Dart SDK looks fine -- it's
identical to one built using the old build scripts.
The various tools and DDC's little test runner I *think* work, but there
may be a bug or two in there. I tried the various things I could and it
seems like they work but it's hard to tell since they may be kind of
broken right now anyway.
Bug:
Change-Id: Iea77915a5c1cc8450f60ebfbdf8c725c7ea2f32c
Reviewed-on: https://dart-review.googlesource.com/18144
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Eliminate uses of the comment syntax in lib/async. This is mostly
done simply by turning explicit (but commented) casts into implicit
casts to avoid regressing dart2js performance.
Bug:
Change-Id: I286c7bffbf609b5e2fa24b9d48b90876c2c45a9b
Reviewed-on: https://dart-review.googlesource.com/21566
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Flutter reacts badly to using deprecated members.
Change-Id: Id7933ddbc0c2fa68d9a232e2ad4c74dfd0ecdf35
Reviewed-on: https://dart-review.googlesource.com/21601
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
The new front end doesn't support generic comment syntax yet, so it's
getting the wrong type for LineSplitter in strong mode. Since we no
longer to preserve legacy mode semantics for LineSplitter, we can just
use the correct strong mode types without generic comment syntax.
Change-Id: If2dcb2fb3fae9eb49685838e4e84958e545650c7
Reviewed-on: https://dart-review.googlesource.com/21286
Reviewed-by: Florian Loitsch <floitsch@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This reverts commit 5f15867a47.
The recent renaming of constants had caused a lot of pain with this CL.
TBR=lrn@google.com
Bug:
Change-Id: I67a78fa09e15e95ea44fe18d9847fcfd9c61e043
Reviewed-on: https://dart-review.googlesource.com/21382
Reviewed-by: Stephen Adams <sra@google.com>
The parameter defaults to false. This enables creating a
SecurityContext that includes the trusted root certificates that can
be modified per-connection.
fixes#24693
Change-Id: I22e5736838755ce4055f77b1b17aeb5176329240
Reviewed-on: https://dart-review.googlesource.com/20580
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Zach Anderson <zra@google.com>