connect to DDS without relying on a redirect.
Some WebSocket implementations (particularly dart:html's) don't follow
redirects and don't provide the user with the message returned by the
server.
This CL adds 'getWebSocketTarget' as an RPC which returns the
URI that should be used by the client to connect directly to the proper
web socket target. In addition, the "implicit-redirect" forwarding has
been removed.
Change-Id: Iaf88c965f6fedfa6f63c28a08860a3c80388797c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156485
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Normally the heap grows in steps proportional to the size of the heap, so it grows faster the closer it gets to memory exhaustion.
The closer the heap size approaches --old_gen_heap_size, the less the heap will grow between GCs. This is useful on systems that respond to low memory conditions by killing processes instead of failing allocations. It is expected the asymptote will be chosen as some fraction of memory available from the OS (hundreds of MB on mobile).
Change-Id: I65cb4ab833e7a965595642312ce551719c0ade50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151635
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Previously the help messages for 'dart run' were output by a secondary
VM spawned solely to print the VM's help message. However, this help
message was not consistent with those found for other DartDev commands.
With this change, the 'run' command:
- Uses package:args to create a help message consistent with other
DartDev commands.
- No longer accepts arbitrary options and is instead restricted to a
subset of common flags. Passing a VM flag which is not included in
this subset of commands will result in an argument error if passed
*after* the 'run' command. Other VM flags can be passed immediately
following 'dart' and before the DartDev command.
- No longer outputs the VM verbose options when invoked with '--help
--verbose'. VM verbose options and the original VM help message can
be viewed by running 'dart --help --verbose'. This makes uncommon
VM flags used for development less visible to regular users.
- Now properly forwards the subset of VM options accepted by 'run' to
the VM (e.g., 'dart run --observe --no-pause-isolates-on-exit foo.dart'
would have ignored '--no-pause-isolates-on-exit').
Change-Id: Ie56b767cc21e6af3630c742458a6c3e9f7418250
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155841
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
"\\?\" prefixed path is not properly supported. Arguments historically
were parsed as a Uri, which converted backward slashes into slashes. It
used to work because Win API is able to handle slashes as separators.
But "\\?\" has a special meaning and should not be changed. '?' is also
invalid char in the URI. So it leads to a crash.
The best solution is to avoid using URI to parse the path. This cl is a
workaround for crashing.
Bug: https://github.com/dart-lang/sdk/issues/42779
Change-Id: I13bcefc820eb578a2707181080eac9c0f1592e4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156364
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
Both dlopen and LoadLibrary have caching behavior and only load the
dynamic library once into the DartVM, even with multiple isolates.
Change-Id: If16791baf28706c61acb1ecdae668485b264a373
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156682
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Instead of putting the same InferRange() in BinaryInt32Op,
BinaryInt64Op, and (currently missing) BinaryUint32Op, just add a base
version in BinaryIntegerOp that's overridden by the caching versions in
BinarySmiOp and ShiftIntegerOp.
Change-Id: I38e4b4869c08101b97201159eee0de972bfc0cbc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156681
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Precompiled mode has never been supported for ia32. Removing dead code.
Change-Id: Ia2de44373f3f494cb22f774369f922e061fc99c7
Cq-Include-Trybots:dart/try:vm-kernel-linux-debug-ia32-try,vm-kernel-win-debug-ia32-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156521
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Moves AllocateObject and CreateArray instructions down to their
dominant use (use that dominates all other uses) when such a use exists
and the move is not hampered by environment uses (which can happen when
the allocation is inside a try block).
This improves write barrier elimination for inlined constructors, since
it moves the allocation after evaluation of the arguments. Any Dart
calls in an argument would disable elimination after it.
The optimization is particularly effective for Flutter Widget code,
since such code typically contains many nested constructor calls.
Reduces instructions size of Flutter Gallery by about 0.8%.
Change-Id: Ife30850c1a23f0986f85d42c1015f4caa7cf1fa6
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153602
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This is another step in refactoring that should help with protecting class functions lookup with locks.
Change-Id: Icd8a4831684b5514079bd7e03a3d2358b992e729
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156300
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Instead of spawning new processes to run a tool for a command, this
change makes it so we run within the current process when possible. In
general, we should avoid spawning any processes when possible from
dartdev unless:
- We need to interact with the child process from dartdev (e.g.,
analysis server)
- The child needs to interact with the parent process (e.g., DDS)
Change-Id: I9c8cd39de038ab2f3a699165a47bee4c281bda67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156048
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
This is part of refactoring that should help with protecting class functions lookup with locks.
Change-Id: I28d25aa78c0b4d83eb8ceab827b71852a23368b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156162
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
To make implicit getters/setters frameless in common cases we use graph
intrinsics. We do this for boxed as well as unboxed fields. We do this
only for simple cases (e.g. not if field guards or possible boxing are
involved).
It also removes the hand-written assembly intrinsics for the getters,
which avoids bugs if boxing-state of field is not the same as
boxing-state of setter/getter.
Issue https://github.com/dart-lang/sdk/issues/40876
Change-Id: Id3bd7842ead0278fee61d4a21c8661ce18dbccee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155900
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
This ensures redundant bounds checks are eliminated for
GenericCheckBoundsInstr (in addition to CheckArrayBoundInstr which we
already do).
Change-Id: Ie49e63f3e48cd7c90f5616cc1394f4d8a6920699
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156188
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Bots seem much slower than local testing.
Change-Id: If5ce44a0b59b82c8651017f7efe810b8a4c65ef5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156052
Reviewed-by: Ryan Macnak <rmacnak@google.com>
With the introduction of paged new-space, it became possible for the scavenger to fail to allocate if old-space could not grow and survivors did not pack after being reordered, and the scavenger would FATAL out. Long before that, the scavenger could fail to allocate the other semispace and FATAL out. Now an allocation failure causes the scavenge to abort, and partial forwarding to be reversed.
Change-Id: Idadfa4d9797aa7afce362bf70343e66b1b1dfeaf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155683
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
- Makes Future.wait a recognised function, and asserts its chained
future, _future is allocated at a known index in the context.
- Adds logic to locate, extract the chained future during lazy async
stack unwinding.
- Adds tests for the Future.wait async case.
- Minor consistency nits, comments.
This change is similar to a previous CL, adding Future.timeout support:
https://dart-review.googlesource.com/c/sdk/+/152328
Change-Id: I7439750968595d25d7bbac0068ad64fcc891e176
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155420
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Instead of using class ids when building field/function service ids, we use names instead
(as we do in some other places already).
Issue https://github.com/dart-lang/sdk/issues/42533
Change-Id: I55530161af26ee9514aa29a048cf140094cabd95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156004
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
This was causing flaky failures when initializing DDS as it was invoking
the getVM RPC which in turn sometimes accessed the script_uri after it
had been freed.
Change-Id: I4454b6fa2da3ad6767938ed12b1013223a667af7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155740
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Before this, we had to use PRECOMP_NO_CHECK() for any entries that
involved field offsets that came after NOT_IN_PRECOMPILED() fields,
because the offsets would differ between JIT and AOT. That removed
the check in dart.cc that the offsets match, but that just meant
that precompiled code that used these offsets were wrong.
One possible workaround is to just lift any field definitions whose
offset might be used in precompiled code before any NOT_IN_PRECOMPILED()
defined fields, but this means otherwise unnecessary changes in the
Layout classes.
Instead, just fix the runtime offset generation/retrieval by splitting
the list of offsets into two parts: offsets common to all modes and
offsets only valid in JIT mode. While this complicates the code that
generates and imports these offsets, it ensures that our code generation
actually uses the right offsets for the target mode.
In addition, by doing this split we can add checks for uses of JIT-only
offsets when in precompiled mode. Adding these checks found some uses of
JIT-only field offsets in code compiled in precompiled mode. (These
uses may have been benign if the stubs that included the uses were never
called in the precompiled runtime, but now there's explicitly a check
for precompiled mode around these uses.)
Also remove the unused ARRAY_STRUCTFIELD type from offset lists.
Change-Id: I083ab5997d3a5245b5f1487b614b62faee47d405
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155780
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Introduces Dart_NewFinalizableHandle which does auto delete itself,
but does not allow accessing the weak referenced object.
Issue: https://github.com/dart-lang/sdk/issues/42312
Change-Id: I24ea732925122c453213c4fa3f629761c352f838
Cq-Include-Trybots:dart/try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-msan-linux-release-x64-try,vm-kernel-precomp-msan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,dart-sdk-linux-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,front-end-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-mac-debug-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-nnbd-linux-debug-x64-try,analyzer-nnbd-linux-release-try,front-end-nnbd-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154695
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Newer GN doesn't allow `*.framework` elements in `libs`. It
requires using `frameworks` instead. The toolchain definitions need
to pass the new substituted variable to the link to make use of the
new required way to express these dependencies.
Bug: fxbug.dev/56683
Change-Id: I62e68a8e5bdfef095b72b38d9d41f757e510012b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155482
Auto-Submit: Roland McGrath <mcgrathr@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This reverts commit e3a682480a.
Reason for revert: Broke time reporting on new
devices.
Original change's description:
> Reland "[vm] Replaces fuchsia.deprecatedtimezone"
>
> This is a reland of 16f09f20b3
>
> The apparent break of internal tests was not caused by this change.
>
> Original change's description:
> > [vm] Replaces fuchsia.deprecatedtimezone
> >
> > (prior attempt was rolled back as it caused downstream tests to time
> > out. See prior attempt at: See:
> > https://dart-review.googlesource.com/c/sdk/+/149206)
> >
> > The FIDL library fuchsia.deprecatedtimezone is going away. There are
> > different and better ways to obtain the same functionality. This change
> > removes the dependency on fuchsia.deprecatedtimezone from the Dart SDK.
> >
> > Adds inspect metrics that allow whitebox testing of the runners. Here's
> > a sample `fx iquery` excerpt from a running device, showing both a dart
> > and a flutter runner exposing the same OS diagnostic metrics.
> >
> > ```
> > /hub/c/dart_jit_runner.cmx/70981/out/diagnostics:
> > /hub/c/dart_jit_runner.cmx/70981/out/diagnostics#os:
> > dst_status = 0
> > get_profile_status = 0
> > timezone_content_status = 0
> > tz_data_close_status = 0
> > tz_data_status = 0
> > /hub/c/flutter_jit_runner.cmx/29567/out/diagnostics:
> > /hub/c/flutter_jit_runner.cmx/29567/out/diagnostics#os:
> > dst_status = 0
> > get_profile_status = 0
> > timezone_content_status = 0
> > tz_data_close_status = 0
> > tz_data_status = 0
> > ```
> >
> > Under nominal operation, all of the above values should be equal to 0.
> > Nonzero values indicate an error.
> >
> > This functionality is guarded by Fuchsia integration tests at
> > //src/tests/intl.
> >
> > Tested:
> > (compile locally for Fuchsia and deploy)
> > fx test //src/tests/intl
> >
> > See:
> > - https://github.com/dart-lang/sdk/issues/42245
> > - https://github.com/dart-lang/sdk/issues/39650
> >
> > Fixes#39650
> >
> > Change-Id: I97f6e17e57000f6eec71246aee670bca65b7e1d1
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150662
> > Commit-Queue: Filip Filmar <fmil@google.com>
> > Reviewed-by: Martin Kustermann <kustermann@google.com>
>
> Change-Id: I5da6b0f481af0eb42c3b5e74c920588ac2ef5be9
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151862
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Commit-Queue: Filip Filmar <fmil@google.com>
TBR=kustermann@google.com,kaushikiska@google.com,fmil@google.com
Change-Id: I6e590cf22347f9153e5203b255f37872dbd91fa6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155505
Commit-Queue: Filip Filmar <fmil@google.com>
Reviewed-by: Filip Filmar <fmil@google.com>
This reverts commit 444cb00610.
Reason for revert: The original change broke time reporting on new
devices. Since this was a touch-up, it will need to change as well.
Original change's description:
> Fix the #include path for ICU headers
>
> The ICU headers in os_fuchsia.cc have been included with their path
> relative to the dart root directory. They should instead be included
> relative to the paths mentioned in `-I` directives of the current
> compiler invocation.
>
> This allows downstreams that have a different directory organization to
> build dart sdk even if they don't exactly replicate the directory
> structure of dart sdk.
>
> Change-Id: Iec79f261aee5ccc7b74448978fc69244e260400a
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154163
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Commit-Queue: Filip Filmar <fmil@google.com>
TBR=kustermann@google.com,kaushikiska@google.com,fmil@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: Ib2c22c2bfaabb07001acb707d996d90a18df3fd0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155502
Reviewed-by: Filip Filmar <fmil@google.com>
Commit-Queue: Filip Filmar <fmil@google.com>
This reverts commit d870a71b20.
Reason for revert: ASAN failures
Original change's description:
> [ VM ] Print a meaningful error message when a user attempts to run an AOT snapshot with a JIT VM.
>
> Fixes https://github.com/dart-lang/sdk/issues/42482
>
> Change-Id: I284a5673e30f59b127e69c712df93552cdfcde41
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154834
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
TBR=bkonyi@google.com,rmacnak@google.com,asiva@google.com
Change-Id: I3639ede6987fbb51fb95584685c472abb789970e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155303
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Don't assert that RSS > VM memory as VM memory might not be all resident.
Change-Id: Ie00c3e382d7b219fdb462a6e61d649f4d5276964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155140
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This heuristic can cause the heap to consume memory in excess of the growth ratio after the application's memory usage shrinks.
Bug: https://github.com/dart-lang/sdk/issues/18147
Change-Id: I3d4aa0bc4b74d22e974e3cac00ee9e42967e0826
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125000
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Before, DRT_InterpretedInstanceCallMissHandler expected either
Resolver::ResolveDynamic or InlineCacheMissHelper to return a non-null
function. However, this only happens when lazy dispatchers are enabled.
Now, DRT_InterpretedInstanceCallMissHandler is allowed to return a
null function if lazy dispatchers are disabled, and
Interpreter::InstanceCall checks the result for null. If null, then
lazy dispatchers must be disabled, so Interpreter::InstanceCall
delegates handling the miss to DRT_InvokeNoSuchMethod, which has been
updated to do the same resolution algorithm as
DRT_NoSuchMethodFromCallStub.
Cq-Include-Trybots: luci.dart.try:vm-dartkb-linux-release-x64-try
Change-Id: Ifeb1d787bbfedd823abc8421efe82d62d3cfd193
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154694
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Also relands the followup CLs:
"Perform non-covariant checks when dynamically invoking callables."
"Use AreValidArguments so that names are checked as well."
Original description of first CL:
This change only affects compilation when running in non-precompiled
mode with --no-lazy-dispatchers enabled.
Instead of always compiling in non-covariant checks, even for closures
not called dynamically, remove the non-covariant checks from the closure
and instead do the non-covariant checks for dynamic calls during the
NoSuchMethodForCallStub fallback by calling
Function::DoArgumentTypesMatch.
Adds two overloads for Function::DoArgumentTypesMatch, one which takes a
function type argument vector and one which takes neither an
instantiator type argument vector or a function type argument vector.
For the versions that are not explicitly passed a type argument vector,
an appropriate one is constructed using the arguments. If there is not
enough information in the arguments, then we fall back to assuming the
empty type argument vector for the instantiator case and instantiating
to bounds in the function type argument case.
Fixes Function::DoArgumentTypesMatch to handle generic functions and to
check arguments appropriately according to the active null safety mode.
For generic functions, the provided or resulting function type vector
has non-covariant checks performed against the type parameter bounds.
This change uncovered one test that was incorrectly passing in strong
mode, see https://github.com/dart-lang/sdk/issues/42688 for details.
Original description of second CL:
The VM only does this when the callable function does not expect dynamic
invocations. Otherwise, performing the checks would be redundant, as the
function body already contains the appropriate non-covariant checks.
Third CL had no additional description.
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-try,vm-kernel-reload-linux-release-x64-try, vm-kernel-reload-rollback-linux-debug-x64-try
Bug: https://github.com/dart-lang/sdk/issues/40813
Change-Id: I1a3e9c1865103a8d716e1cad814267caffaaadf2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154688
Reviewed-by: Martin Kustermann <kustermann@google.com>