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>
Future.wait() must be passed a list of type List<Future>.
Change-Id: Id7dd9e7c77aef10db6de8146f7ffad6df8f5cbc2
Reviewed-on: https://dart-review.googlesource.com/20161
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
- Load vmservice_io library only in the service isolate or when an AOT snapshot is being generated
This should account for the following issues:
- https://github.com/dart-lang/sdk/issues/31203 - there should be a vmservice_io_strong.dill file
- https://github.com/dart-lang/sdk/issues/30158 - Consider extracting flutter vmservice_sky into
separate .dill from platform.dill
- https://github.com/dart-lang/sdk/issues/30111 - support compiling vmservice with an external
outline of the sdk
Bug:
Change-Id: If945ec05afe8127e288e8d3b55172c0f7c3d6e7a
Reviewed-on: https://dart-review.googlesource.com/18147
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Siva Chandra <sivachandra@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
This also makes nativewrappers work in analysis.
Change-Id: Ic516035ed2995f9b267a095ed67cb58e96c42a1a
Bug:
Reviewed-on: https://dart-review.googlesource.com/19283
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
Change-Id: I7f8d6b110f2f0c90b131a2538240c1b81bfa1578
Reviewed-on: https://dart-review.googlesource.com/17162
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Change-Id: I48fcc8443a0980c435e87642cf6a7aede07e68f0
Reviewed-on: https://dart-review.googlesource.com/17161
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Change-Id: I0281b5e04785c1759866e0d9b9dc3e091ea72e66
Reviewed-on: https://dart-review.googlesource.com/16780
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
Seeing this in the hot path on an internal app.
Change-Id: I921f12ece706b4ea92d9a97858fde2799972f653
Reviewed-on: https://dart-review.googlesource.com/15940
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
fixes#31063
Change-Id: Ib49ae77903805a5c027ab870898954bb43901fda
Reviewed-on: https://dart-review.googlesource.com/13120
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
This separates compiling platform.dill files from the patch_sdk.dart
script. The motivation for that is that I'm working on reading patch
files directly from Fasta, so we can completely remove the build step
for generating patched_sdk and dart2js_patched_sdk.
Short-term this should allow Paul to add a strong-mode version of
platform.dill without causing to many conflicts with my work on
patches.
Change-Id: I1150845b2986348d4fffe27092701d8a9b57ea54
Reviewed-on: https://dart-review.googlesource.com/11506
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Both dart:io and dart:_http have scripts whose uri is just 'crypto.dart'. This confuses vm-service clients who incorrectly assume that scripts are uniquely identified by uri.
Change-Id: I387c42d32f9e1a2aabf03d9d1a89ed4703f0f40d
Reviewed-on: https://dart-review.googlesource.com/10211
Reviewed-by: Zach Anderson <zra@google.com>
This reverts commit 8cf9ef22c4.
The expectations in Dart2js and Kernel tests have now been updated.
Change-Id: I9d65ff207490cfc783849b1b726db81cf56ecfc2
Reviewed-on: https://dart-review.googlesource.com/9124
Reviewed-by: Régis Crelier <regis@google.com>
This reverts commit db15f5d73b.
Dart2js and Kernel tests are comparing text that has changed because of
the core lib change.
Change-Id: I1d33716a3d6e6a077aa1f1a9ad7cc37825d31fa6
Reviewed-on: https://dart-review.googlesource.com/9082
Reviewed-by: Siva Chandra <sivachandra@google.com>
Change-Id: I7bd4356556023ff4a56d876684ea63bad1917b07
Reviewed-on: https://dart-review.googlesource.com/8341
Reviewed-by: Emily Fortuna <efortuna@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
This moves Http code into dart:_http. dart:io then imports and
re-exports dart:_http. This is the first stage of moving
dart:_http into its own pub package.
This CL was reverted due to a failure in the Flutter engine build
which happened due to an incomplete change in gen_snapshot.cc, and to
update sdk/lib/libraries.yaml and sdk/lib/libraries.json
Change-Id: Ie90c77ef631aea7a163774b58e8ccbaf71a24d3c
Reviewed-on: https://dart-review.googlesource.com/7588
Reviewed-by: Zach Anderson <zra@google.com>
Reverting for broken Flutter build and kernel platform compilation test. It looks like the new _http library is missing from various snapshots. Not sure why this didn't fail locally.
This reverts commit ac9ff3f3af.
Change-Id: I7fbc2f842cf1380793e7af9fb869cacd14682885
Reviewed-on: https://dart-review.googlesource.com/7600
Reviewed-by: Zach Anderson <zra@google.com>
This moves Http code into dart:_http. dart:io then imports and
re-exports dart:_http. This is the first stage of moving
dart:_http into its own pub package.
Change-Id: Icd33232a97b3d75511ef7ec88b01fd47cdcf5a23
Reviewed-on: https://dart-review.googlesource.com/6420
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Florian Loitsch <floitsch@google.com>
Avoids string copies in C++ and map copies in Dart.
Also remove some vestiages of removed feature that allowed an embedder to add pre-encoded events to the timeline.
Change-Id: I962a67093ba461c991d9169b0391c44af1d489db
Bug: https://github.com/dart-lang/sdk/issues/30787
Reviewed-on: https://dart-review.googlesource.com/6762
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Fuchsia's Dart and Flutter content handlers share the implementation of
dart:io with the command line embedder, but would like to disable
some operations that don't make sense for them, like exiting thoe whole
process, which may be hosting multiple unrelated Isolates.
Change-Id: I825ece49c685471ff85802873b1c0f974c507aed
Reviewed-on: https://dart-review.googlesource.com/3687
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Fuchsia requires the ability to sandbox Isolates w.r.t. file IO.
When a new Isolate starts, Fuchsia will pass the Isolate an object
called a namespace. We can translate the namespace object into a
file descriptor suitable for passing to the *at() family of
POSIX file system calls. The file system calls will then
have visibility only into the specified namespace.
We also plumb Namespaces through on all the other platforms as well to
make the change easier to test and so that in the future we can
implement e.g. per-isolate cwds.
This change adds a new internal class to dart:io called _Namespace,
which is implemented in a patch file. See:
sdk/lib/io/namespace_impl.dart
runtime/bin/namespace_patch.dart
The embedder can set up a non-default namespace by calling
_Namespace._setupNamespace during Isolate setup.
Instances of _Namespace have a native field that holds a pointer
to a native Namespace object. See:
runtime/bin/namespace.h
Calls from e.g. file_impl.dart are now also passed a
_Namespace object. The implementations in e.g. file.cc and
file_linux.cc then extract the namespace, and use it to compute a
file descriptor and path suitable for passing to e.g. openat().
related US-313
R=asiva@google.com, rmacnak@google.com
Review-Url: https://codereview.chromium.org/3007703002 .
This confused a Flutter user. The other classes don't reference dart:html, and these docs appear in docs.flutter.io, so we'd like them to stay focused on dart:io.
Both Flutter and Fuchsia expect stripped dart in standard out directory, so make that default too(while standalone build puts stripped into exe.stripped/).
BUG=
R=zra@google.com
Review-Url: https://codereview.chromium.org/2998503002 .
Currently kernel fails a number of test because too much is allowed to be constant.
Examples includes
const x = "hello " * 4; // yielding "hello hello hello hello "
const y = "hello".leng; // crashing the VM
The idea behing the helper class is, that fasta can generate those as for instance
var c = new _ConstantHelper();
const x = c.times("hello ", 4, () => thow yadayada);
where - upon evaluating it in for instance the VMs constant evaluator - the helper will see that "hello " is neiher an integer nor null, and thus execute the given onError function.
This is only one step towards that; it will still have to be hooked up in fasta,
and constant evaluators (e.g. in the VM, I suppose there's also one in dart2js etc)
might need to be updated to be able to execute it.
R=ahe@google.com
Review-Url: https://codereview.chromium.org/2982843002 .
Previously, the string set up by the embedder was eagerly passed to
Uri.parse during Isolate startup. This is expensive both in time and
memory footprint. This CL causes Uri.parse() to be called only
when needed. This change will allow reducing the memory footprint
of Fuchsia's Dart content handler on hello world by ~1MB.
fixes#25603R=asiva@google.com
Review-Url: https://codereview.chromium.org/2988613002 .
A new RPC is introduced `_registerService` which allow clients to
register new services that are accessible from all the other clients.
Each registered endpoint is identified by 3 strings:
- `service`
a non empty string which identifies the provided service
(e.g. `HotReload`, `OpenFile`)
- `alias`
an alias for that particular endpoint used by clients to identify it
(e.g. `Flutter`, `IntelliJ`)
- `method` __generated__
the RPC method that should be invoked from a client to request it
A new _stream_ `_Service` is introduce, and two related events:
- `ServiceRegistered`
which is triggered when a new client is registered.
All the related information (`service`, `alias`, `method`) are sent.
- `ServiceUnregistered`
which is triggered when a client, which previously registered a
service, disconnects.
Just `service` and `method` are sent.
Related https://github.com/dart-lang/sdk/issues/30023R=asiva@google.com, bkonyi@google.com
Review-Url: https://codereview.chromium.org/2980733003 .
This gets rid of the following messages in the build:
patched_dart2js_sdk/lib/_internal/js_runtime/lib/native_typed_data.dart: Nit: 'Symbol' is imported from both 'dart:_internal' and 'dart:core'.
patched_dart2js_sdk/lib/svg/dart2js/svg_dart2js.dart: Nit: 'Symbol' is imported from both 'dart:_internal' and 'dart:core'.
patched_dart2js_sdk/lib/web_audio/dart2js/web_audio_dart2js.dart: Nit: 'Symbol' is imported from both 'dart:_internal' and 'dart:core'.
patched_dart2js_sdk/lib/web_gl/dart2js/web_gl_dart2js.dart: Nit: 'Symbol' is imported from both 'dart:_internal' and 'dart:core'.
patched_dart2js_sdk/lib/web_sql/dart2js/web_sql_dart2js.dart: Nit: 'Symbol' is imported from both 'dart:_internal' and 'dart:core'.
BUG=
R=ahe@google.com, sigmund@google.com
Review-Url: https://codereview.chromium.org/2982503002 .
_ChildNodeListLazy.removeRange used to throw UnsupportedError because ListMixin.removeRange calls setRange.
Make throwing UnsupportedError explicit to avoid relying on the implementation of ListMixin.removeRange
This will unblock the '_closeGap' change.
BUG=
R=lrn@google.com
Review-Url: https://codereview.chromium.org/2955103003 .
On a switch fall through error, Fasta currently generates
```
throw new core::FallThroughError::•();
```
which generates the error-message via the VM:
```
'null': Switch case fall-through at line null.
```
This introduces a new constructor taking a url and a linenumber,
which then can give a better error message.
BUG=
R=ahe@google.com
Review-Url: https://codereview.chromium.org/2951453002 .
The code in the patch is now inlined into the vmservice library.
This is being done because, the vmservice related libraries are
now compiled directly from source instead of from the "patched_sdk".
So, what is being compiled now does not have the vmservice_patch
applied. By removing the patch, we are removing the need to
artificially patch the vmservice library and making the
vmservice_io.dill complete.
R=rmacnak@google.com
Review-Url: https://codereview.chromium.org/2946773002 .
directly inside dart2js.
A few notes:
* I ended up adding support for this feature also in dart2js with --use-kernel, it was not implemented correctly before. This is why more tests are passing.
* I played with two other ideas:
(a) making this a compile-time error instead
(b) making it a warning if the arguments were constant and implement it as a constant, treat it as an error if they were not.
Unfortunately both are a breaking changes, so I backed out from them. IMO (a) is the cleanest thing to do long term, and we should raise this with the language team.
R=efortuna@google.com
Review-Url: https://codereview.chromium.org/2896393003 .