This change tests that run_vm_tests runs correctly when provided with
the kernel service snapshot, which is needed to run benchmarks like
UseDartApi.
Test building the kernel-service.dart.snapshot.
Change-Id: I1cb750a16e32daba2eee46e245cc7d4e7d230165
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151395
Reviewed-by: Alexander Aprelev <aam@google.com>
Supplementary changes for handling Classes done in this CL are the
following:
* handling Supertypes
* handling Constructors
* handling remaining kinds of Procedure
* serializing AsyncMarker the same way as flags
* eliminating the need to wrap flags into IntLiteral
Change-Id: Id69c6e37f093cf80206f4657b649f79c75484775
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154000
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
This is a reland of 40c79c8ed7
The build recipes now use forward slashes on Windows to pass the path to
the browser executable to test.py.
Original change's description:
> [test] Add paths to chrome and firefox to the environment when present
>
> This adds a CHROME_PATH or FIREFOX_PATH environment variable to the
> test's evnironment which contains a path to the browser's executable.
> This is only set if the --chrome or --firefox argument was passed to
> test.py.
>
> https://github.com/dart-lang/sdk/issues/42417
>
> Change-Id: I711de6ab91b8ffbbe72c7fb1530b68c4189a4b8a
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153209
> Commit-Queue: Alexander Thomas <athom@google.com>
> Reviewed-by: William Hesse <whesse@google.com>
Change-Id: Ib61b8c6424fa7bce525d76d8b94756a215d28c1e
Cq-Include-Trybots: dart/try:dart2js-strong-win-x64-chrome-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153980
Commit-Queue: Alexander Thomas <athom@google.com>
Commit-Queue: William Hesse <whesse@google.com>
Auto-Submit: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
The result from 'gcloud auth print-access-token' contains a
new-line that cannot be used in the header. To make this use case
easier, remove new-lines, if found.
Change-Id: I44a9cc2bcfe4a8ef06e47a8495e69e116e9a6dfa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153921
Commit-Queue: Karl Klose <karlklose@google.com>
Reviewed-by: William Hesse <whesse@google.com>
The flags on the fields are serialized as lists of flag names,
allowing for any combination of the flags in any order. Similar
technique is used in this CL to serialize the flags on Procedures and
VariableDeclarations. This is in the contrast with the previous
approach for those nodes, when the flags were the part of the
serialized name of the node (such as "static-method" for static
Procedures or "final" for final VariableDeclarations).
Change-Id: I02eb5ac92f6273542f08f269aee8e6519d3085e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153766
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
This CL adds round-trip serialization support for FunctionDeclarations
and the remining kinds of VariableDeclarations, completing the support
for statements. Additionally, the CL fixes a variable scope issue in
Catch clauses, namely that the exception and the stack trace variables
should be visible in the body.
Change-Id: I3843d491b85a65c4953d6fc10a59ecbde5017029
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153611
Reviewed-by: Johnni Winther <johnniwinther@google.com>
+ use the inferred return type in error reporting when no return type is
declared. This turned up in this particular case where we report an
error between the returned value and the inferred return type.
Closes#42546
Change-Id: I48da24047f2e92ca91a514dfcb43c2ba6f65ee46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153610
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Account for the size of the a generative constructor factory.
The factory evaluates all the initializers up the inheritance/mixin chain,
allocates the object, and then calls all the constructors down the
inheritance chain. All this is missed by the old code looking at the
immediate constructor body, sometimes causing extremely large
constructors to be inlined.
Change-Id: I8803b0f4b4155dec0f7878fd5527c1dd507b9c80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153560
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
See #42620.
Change-Id: Ifd18c939082935390df0c2aa0bd724cf6f76c27c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153705
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
These tests verify the scope over which a variable can become
de-promoted due conservative modeling of demotion. The conservative
model of demotion is used for loops, closures, switch statements, and
try blocks.
The implementation of flow analysis already passes these tests. I
will shortly be making a spec clarification that brings the spec in
line with the implementation.
Change-Id: I22a5584a808169fa228c2972c25844c432916c06
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152920
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Even though this field is never written into snapshot dropping it
eagerly allows to compact away a lot of entries in the symbols
table, which are otherwise retained.
On the large internal application this gives the following improvement:
Breakdown by object type:
+--------------------------+--------------+---------+
| Type | Size (Bytes) | Percent |
+--------------------------+--------------+---------+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| ArtificialRoot | -7 | 0.01% |
| OneByteString | -1603 | 1.26% |
| Array | -3206 | 2.51% |
| (RO) _OneByteString | -122688 | 96.22% |
+--------------------------+--------------+---------+
Total: -127504 bytes
-0.39% of old size
Change-Id: Ib6993e3036ff6b36515a17ee7f60175e1188c8fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153768
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
We missed the nullable type in the expected strings during the
migration.
Change-Id: Ie354e89a0ba0ca1a74caaffcc41c72655c280f04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153704
Auto-Submit: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Right now we assign class ids to top-level classes, abstract classes as
well as concrete classes. All of them have allocated from a 16-bit pool
of ids. The VM FATAL()s once it hits that limit.
Customers who run very large programs (significant amount of generated
code) on the Dart VM have started to hit this 16-bit class limit.
Concrete classes can have instances in the heap. Our current heap layout
only allows 16-bit class ids to be encoded in the header word. To avoid
increasing the size of heap objects or shrinking the size of the identity
hash code to 16-bit we keep class ids in object headers to be 16-bit.
Abstract classes cannot have instances in the heap. Though their class
ids are encoded in type objects. Furthermore we sort classes in
AOT/AppJIT mode to perform fast class-id range checks. To avoid impacting
this optimization we treat abstract classes the same way as concrete
classes.
Top-level classes cannot have instances in the heap. Their class ids are
only used in the runtime code, for example for hot-reload as well as
part of the service protocol.
=> We can allocate class ids outside the 16-bit range for top-level
classes, thereby freeing a significant amount of space in the 16-bit
range.
This CL does exactly that: We change classid_t to be int32_t. The
ClassLayout::id_ can now be assigned ids outside 16-bit range for
top-level classes. To do this we keep dart classes and top level classes
as separate arrays in the ClassTable.
Issue https://github.com/dart-lang/sdk/issues/42533
See also b/160229360
Change-Id: I6710a644e7b0ab2d4f4c792bef8e1f91cb117421
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153607
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
This experiment will use a powerset abstract value domain in the inferrer
Change-Id: I216ff9c24d1e7292688426ae7bcb52b15aa2714e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153720
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Christian Altamirano <coam@google.com>
Change-Id: I8e3c478c129e633421625967ff4ac41c9b565fb2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153200
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Previously this class was marked `@visibleForTesting`, but we need
clients to be able to create instances of this class in order to drive
the migration process.
Change-Id: Ibb8a4cda342942dcb15e6fd7625387d246b41f84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153800
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Make sure the individual getter/setter workaround for structs in NNBD
works. That way structs can be migrated without having to opt in to
the proposed --enable-experiment=external-abstract-variables for
external fields.
Note that this requires dart:ffi users to migrate twice for NNBD, once
to the workaround, and later a cleanup to external fields.
Change-Id: I2a9020ff7df3ebf08e04f71183f9297d87acb1b1
Cq-Include-Trybots:dart/try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,vm-precomp-ffi-qemu-linux-release-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153777
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Previous version
(landed via https://dart-review.googlesource.com/c/sdk/+/135683)
only worked if the dill was loaded via
Dart_LoadScriptFromKernel where script_kernel_size was set,
and when the platform dill could be loaded from a file called the right
thing.
This CL makes it work for Dart_LoadLibraryFromKernel too and allows
the VM to send the platform along (explicitly or implicitly) and only
tries to load the platform from a file with the right name if no
platform is given in any of the inputs.
This should fix http://b/148776866
Change-Id: I62317400a932b7dcd9e126a5a88907d507f9d658
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153609
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
CL 148324 'For external/abstract fields: add tests and update Dart.g'
contained a couple of typos, this CL corrects them.
Change-Id: I6ee9b769c8b23e299b13cbb5d4ba38cbfec7656f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153145
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Before this CL, if one compiled a script as strong nnbd (with nnbd
enabled), where the script was marked as as a version where nnbd is enabled,
but where the script lived in a package with a version that was too low
one would get an error.
The reason is that the language version is set twice:
First when the library is created (but the file isn't read yet). This sets
the version from the package. Here an error was issued.
The second time is when the file is read and the file-version-marker is
parsed (e.g. @dart = 2.9).
The error should only be given if - once the final verison has been set
(i.e. after parsing the file) - the version is "wrong".
To make matters worse the (bogus) error given even points to the files
first position which can make it seem like it specificly points to the
@dart annotation and says it's wrong.
This CL fixes the error so it's only issued when it should be.
It does not fix pointing semi-weirdly.
Fixes https://github.com/dart-lang/sdk/issues/42323
Bug: 42323
Change-Id: Id84ca06b2e4eca5912e65798ed2d86f8c89d71a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153769
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Last fix reverted, should not mess up with the format option.
Should only deal with load operations.
R=kustermann@google.com
Change-Id: Ib9037fc32445e899ab92a8110f29f51f482520e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153641
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Change-Id: I04beeb6c24969610255d52a1816e444e57dfe51f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153616
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
Add breakdown by node type when this information is available.
Change-Id: If2d477d0720aff69e3a168b9520fc3c2ccd153c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153767
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This allows for disabling the generation of .d deps file when compiling
the platform dill files.
Change-Id: I37774f0dbdae7863fc1cf53b1c5e0d29c6bbdf2c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153765
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>