Commit graph

1561 commits

Author SHA1 Message Date
Jens Johansen 9b67562b4d Add 'coverage' flag, defaulting to true, but let the gn application_snapshot default it to false
Automatic set coverage when loading snapshot

TEST=Existing tests, manual inspection of reduction in sdk snapshot sizes (see data in comments in https://dart-review.googlesource.com/c/sdk/+/370501)

Change-Id: I044616144c2defeed252a6715eba1abcabffc86d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371700
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2024-06-18 09:10:00 +00:00
Martin Kustermann 847c35612a [dart2wasm] Make dart compile wasm compiled apps disable dart.library.ffi
This is a follow-up to [0]. That CL changed dart2wasm's modular
transformer to issue an error if `dart:ffi` is imported.

Users of packages that have specialized code for the VM (which supports
FFI) use conditional imports based on `dart.library.ffi`. We don't want
the VM-specific code to be used for web in dart2wasm (as dart2wasm
doesn't support the entirety of `dart:ffi`).

As a result we're going to make `dart.library.ffi` be false in
coditional imports (as well as in
`const bool.fromEnvironment('dart.library.ffi')`).

[0] https://dart-review.googlesource.com/c/sdk/+/368568

Issue https://github.com/dart-lang/sdk/issues/55948
Issue https://github.com/flutter/flutter/issues/149984

Change-Id: I70a775278ab701d1fd2596521e378cb6364edac2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370580
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2024-06-11 09:28:40 +00:00
Vyacheslav Egorov ee30aa4d26 [build] Use gen_kernel.exe when building kernel_service.dill
Shortens rebuilds of dart target after core library edits to
8s from ~24s

Change-Id: Ic66334f3810277fcdd2b26cd1bed4b72a824a0f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368802
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-05-30 13:19:55 +00:00
Vyacheslav Egorov a4dd314c9e [tools] Allow precompiling gen_kernel and compile_platform
When iterating on core library changes or changes in the AOT compiler
many seconds are wasted waiting on gen_kernel/compile_platform to
parse Dart code. This happens because we are running these tools
from sources on prebuilt Dart SDK.

This CL allows SDK developer to opt-in into AOT compiling these
tools by adding `precompile_tools=true` to their DART_GN_ARGS.

AOT compilation is performed using prebuilt SDK - so these
executables do not need to be recompiled if core libraries or
VM changes reducing iteration cycles.

pkg/vm/tool/precompiler2 is tweaked to detect when DART_GN_ARGS
contains `precompile_tools=true` and use precompiled
gen_kernel.exe instead of running it from source.

Using precompiled compile_platform takes vm_platform_strong.dill
build from 20 seconds to 3 seconds.

Using precompiled gen_kernel takes small benchmark build from
~10 seconds to 2 seconds.

This relands 5cda2a871c with fixes
for Flutter build.

TEST=manually tested

Change-Id: I552861c80c152890655e41baaf6ea3fb3b03a57e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367961
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2024-05-24 09:40:39 +00:00
Slava Egorov a17d709a1d Revert "[tools] Allow precompiling gen_kernel and compile_platform"
This reverts commit 5cda2a871c.

Reason for revert: broke Flutter build. 

Original change's description:
> [tools] Allow precompiling gen_kernel and compile_platform
>
> When iterating on core library changes or changes in the AOT compiler
> many seconds are wasted waiting on gen_kernel/compile_platform to
> parse Dart code. This happens because we are running these tools
> from sources on prebuilt Dart SDK.
>
> This CL allows SDK developer to opt-in into AOT compiling these
> tools by adding `precompile_tools=true` to their DART_GN_ARGS.
>
> AOT compilation is performed using prebuilt SDK - so these
> executables do not need to be recompiled if core libraries or
> VM changes reducing iteration cycles.
>
> pkg/vm/tool/precompiler2 is tweaked to detect when DART_GN_ARGS
> contains `precompile_tools=true` and use precompiled
> gen_kernel.exe instead of running it from source.
>
> Using precompiled compile_platform takes vm_platform_strong.dill
> build from 20 seconds to 3 seconds.
>
> Using precompiled gen_kernel takes small benchmark build from
> ~10 seconds to 2 seconds.
>
> TEST=manually tested
>
> Change-Id: Ieec6ad4e1081023d140eb744f0a3cd0c754414ca
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367940
> Commit-Queue: Slava Egorov <vegorov@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

Change-Id: Id3e4eb44d33516f31c165d9a1e55911e8d356e7f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367960
Commit-Queue: Slava Egorov <vegorov@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-05-23 13:52:58 +00:00
Vyacheslav Egorov 5cda2a871c [tools] Allow precompiling gen_kernel and compile_platform
When iterating on core library changes or changes in the AOT compiler
many seconds are wasted waiting on gen_kernel/compile_platform to
parse Dart code. This happens because we are running these tools
from sources on prebuilt Dart SDK.

This CL allows SDK developer to opt-in into AOT compiling these
tools by adding `precompile_tools=true` to their DART_GN_ARGS.

AOT compilation is performed using prebuilt SDK - so these
executables do not need to be recompiled if core libraries or
VM changes reducing iteration cycles.

pkg/vm/tool/precompiler2 is tweaked to detect when DART_GN_ARGS
contains `precompile_tools=true` and use precompiled
gen_kernel.exe instead of running it from source.

Using precompiled compile_platform takes vm_platform_strong.dill
build from 20 seconds to 3 seconds.

Using precompiled gen_kernel takes small benchmark build from
~10 seconds to 2 seconds.

TEST=manually tested

Change-Id: Ieec6ad4e1081023d140eb744f0a3cd0c754414ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367940
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-05-23 12:35:21 +00:00
Ryan Macnak 058cb1d701 [build] Don't make kernel generating depend on training run inputs.
Shortens the critial path when building the SDK by ~10 seconds.

Change-Id: I87bb31646c6468fe974da9fbc4ca2e09af39802b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361760
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2024-04-10 23:34:14 +00:00
Jonas Termansen eed151a943 Fix the create_snapshot_entry error message.
Change-Id: I971c779409ef3bd2bfbe6d4a3c450f869242bd97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362188
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2024-04-10 21:54:22 +00:00
asiva 8e2acda7d6 [VM] Remove support for --no-sound-null-safety mode
This CL removes support for --no-sound-null-safety option, the VM will
only run sound null safety code.

First part of deleting support for legacy and unsound null safe code.

TEST=CI

Change-Id: I9dbed10a18ef102533d6af516ff5075297d17b74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357183
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-04-05 19:38:12 +00:00
Johnni Winther 63d2008355 [cfe] Make kernel AST and CompilerOptions use strong mode by default
TEST=existing

Change-Id: I8d8bc59dc742a7499338ea2d23a611696492603c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359222
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2024-04-05 07:45:08 +00:00
Ben Konyi 6eb85949fd [ VM / DDS ] Add --print-dtd-uri flag and launch DTD from the correct snapshot for AOT
This adds support for printing the DTD connection information to stdout
when --print-dtd-uri is passed.

This change also fixes an issue where DDS would fail to spawn an isolate
with the DTD snapshot when DDS was running in AOT mode. This means the
SDK must be shipped with both AppJIT and AOT DTD snapshots, at least
until dartdev is moved to run from AOT.

Fixes https://github.com/dart-lang/sdk/issues/55034

TEST=run_test.dart

Change-Id: I788ef9bfe76297a8d594992a2aac440ed9e2ecac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358541
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
2024-03-21 19:50:46 +00:00
YoloMao 5b812f2a16 fix: confused comment content
Closes https://github.com/dart-lang/sdk/pull/55192

GitOrigin-RevId: 6283a7c9d1a753a4fa334ac37860e42a14d7ec66
Change-Id: I58e312a761636e5728f0cfc69b5ce771d393db78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357580
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-03-14 08:57:38 +00:00
Ben Konyi d58f6a1ce3 [ DDS ] Create an arg parser for the DDS snapshot
Preparation for shipping DDS as part of the SDK instead of as a Pub
package.

TEST=Existing VM service, DDS, and dartdev tests

Change-Id: I38ec47f4ebf003d3d3c813af40a313403f23280c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356580
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-03-11 19:54:47 +00:00
Zach Anderson 03101837d9 [gn] Deprecate copy_trees()
Part of https://github.com/flutter/flutter/issues/144430

This is a reland of https://dart-review.googlesource.com/c/sdk/+/356481 with the addition of dependencies to prevent races on directory creation.

Previously, this code did backflips to accomplish two goals
1. Collect the paths of all files that would be copied from one place to another after applying regex filters so that they could be listed as the "inputs" to a GN action.
2. Arrange so that the python script doing the above would only be invoked once during GN to reduce the cost of calling out to python.

However, this is exactly the use-case for the "depfile" parameter to a GN action. Instead of running the script during GN to populate the "inputs" list, when we run the copy_tree.py script, we can instead ask it to generate a depfile to collect all the input files that were actually copied after applying the regex filter. Using that, we don't have to run the python script at all during GN.

TEST=it builds

Change-Id: I593e2500544a9fff5dd9852d0d3370f97aafc464
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356620
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2024-03-09 04:14:39 +00:00
Zach Anderson 939ae55c00 Revert "[gn] Deprecate copy_trees()"
This reverts commit f60d32167f.

Reason for revert: build failures in post submit

Original change's description:
> [gn] Deprecate copy_trees()
>
> Part of https://github.com/flutter/flutter/issues/144430
>
> Previously, this code did backflips to accomplish two goals
> 1. Collect the paths of all files that would be copied from one place to another after applying regex filters so that they could be listed as the "inputs" to a GN action.
> 2. Arrange so that the python script doing the above would only be invoked once during GN to reduce the cost of calling out to python.
>
> However, this is exactly the use-case for the "depfile" parameter to a GN action. Instead of running the script during GN to populate the "inputs" list, when we run the copy_tree.py script, we can instead ask it to generate a depfile to collect all the input files that were actually copied after applying the regex filter. Using that, we don't have to run the python script at all during GN.
>
> TEST=it builds
>
> Change-Id: I41a251ce4659119cdc3997bb2d6fc7ee0831bb6d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356481
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Commit-Queue: Zach Anderson <zra@google.com>
> Reviewed-by: Alexander Aprelev <aam@google.com>

Change-Id: Ie4409ed93a3c990fbce375dba1f2d9a3c735ea3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356308
Auto-Submit: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Zach Anderson <zra@google.com>
2024-03-08 20:59:53 +00:00
Zach Anderson f60d32167f [gn] Deprecate copy_trees()
Part of https://github.com/flutter/flutter/issues/144430

Previously, this code did backflips to accomplish two goals
1. Collect the paths of all files that would be copied from one place to another after applying regex filters so that they could be listed as the "inputs" to a GN action.
2. Arrange so that the python script doing the above would only be invoked once during GN to reduce the cost of calling out to python.

However, this is exactly the use-case for the "depfile" parameter to a GN action. Instead of running the script during GN to populate the "inputs" list, when we run the copy_tree.py script, we can instead ask it to generate a depfile to collect all the input files that were actually copied after applying the regex filter. Using that, we don't have to run the python script at all during GN.

TEST=it builds

Change-Id: I41a251ce4659119cdc3997bb2d6fc7ee0831bb6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356481
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2024-03-08 20:47:47 +00:00
Nicholas Shahan 30a94fceaf Reland "[ddc] Fix running d8 with test.py"
This is a reland of commit 244f8cee87
with fixes for the file URIs passed on the command line.

Original change's description:
> [ddc] Fix running d8 with test.py
>
> - Add build targets to compile .dill outlines for common test 
>   dependencies using kernel_worker.dart.
> - Build ddc modules for common test dependencies and move amd versions
>   to a separate subdirectory.
>
> Change-Id: I126b5821f6aea00b753d83560c76f00c6c5edc61
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350081
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Commit-Queue: Nicholas Shahan <nshahan@google.com>

Change-Id: I5a77512984fda1d91c812f1e240e9c10609914f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351622
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-02-13 20:09:58 +00:00
Nicholas Shahan 08f0ffeb60 Revert "[ddc] Fix running d8 with test.py"
This reverts commit 244f8cee87.

Reason for revert: Breaks windows builds.

Original change's description:
> [ddc] Fix running d8 with test.py
>
> - Add build targets to compile .dill outlines for common test 
>   dependencies using kernel_worker.dart.
> - Build ddc modules for common test dependencies and move amd versions
>   to a separate subdirectory.
>
> Change-Id: I126b5821f6aea00b753d83560c76f00c6c5edc61
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350081
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Commit-Queue: Nicholas Shahan <nshahan@google.com>

Change-Id: Ic5a17edc323b298eb8d60c82c755c6929e2cacc3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351520
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Nicholas Shahan <nshahan@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2024-02-09 18:25:56 +00:00
Nicholas Shahan 244f8cee87 [ddc] Fix running d8 with test.py
- Add build targets to compile .dill outlines for common test 
  dependencies using kernel_worker.dart.
- Build ddc modules for common test dependencies and move amd versions
  to a separate subdirectory.

Change-Id: I126b5821f6aea00b753d83560c76f00c6c5edc61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350081
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2024-02-09 00:47:02 +00:00
Martin Kustermann 0bc92a4333 [dart2wasm] Remove usage of type category table
The type category table is a O(number-of-classes) sized byte array that
maps from class-id to either a type category (function, record, ...) or
a masqueraded class-id.

* for flute this table takes up around 1 KB.
* this prevents from making concrete class-ids come before all abstract
  class ids

After recent changes the core RTT implementation no longer involves
masqueraded types (i.e. `<obj> is/as <type>` and `<type> <: <type>`
queries don't trigger masquerading functionality)

This CL removes the type category table, the special casing in the
class-id assignment and the compiler support for building the table.

Instead we move the logic to pure dart code, which can use normal `is`
checks to perform its function.

We add one optimization: The compiler will provide the class-id from
which one only non-masqueraded classes come. This makes the masquerading
function have a fast path.

* We use `Wasm{TypedData,String}Base` marker interfaces i
 `dart:_internal` to check for wasm-backed implementations
* We use `-Ddart.wasm.js_compatibility` to provide JSCM mode

We add a test that actually exercises the 2 modes.

Change-Id: I051c35b17878950402a1336df871a686b649f732
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349641
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-02-02 19:01:49 +00:00
MarkZ 8edbcacfb0 [ddc] Removing some references to "legacy" DDC modules.
"DDC" is now the accepted name for the module system.

Change-Id: I655219ccc7cff7ff99b1311518ef6ed6e7d1b2a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348085
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2024-01-24 21:22:25 +00:00
Ryan Macnak 2ff30ee836 [vm] Don't create UnboxedConstantInstr(kUnboxedInt64) for RISCV32.
TEST=dartfuzz
Bug: https://github.com/dart-lang/sdk/issues/54425
Bug: https://github.com/dart-lang/sdk/issues/54434
Change-Id: I05975376cd61ffeceda60edf76df182fbf753593
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345348
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-01-09 20:44:38 +00:00
Ben Konyi 3c42222b7e [ CLI ] Add tooling-daemon command to support launching the Dart Tooling Daemon (DTD)
This change includes the following:
 - A new `tooling-daemon` CLI command to launch DTD
 - Minor refactoring of package:dtd_impl to better match expected
   Dart package structure
 - Updated build rules to create dart_tooling_daemon.dart.snapshot

Change-Id: Idd91bc4ce64ce790db5bad323a50d9cf65523dc2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344800
Reviewed-by: Dan Chevalier <danchevalier@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-01-08 17:07:55 +00:00
Daco Harkes d71d0f8733 [gardening] Fix simriscv32 build
Bug: https://github.com/dart-lang/sdk/issues/54434
Change-Id: I923ed41448e440e17acc39beee5dd49a9de382fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/343200
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-12-21 12:39:54 +00:00
Jonas Termansen 669060f8c7 [build] Omit SDK and Git hashes on RBE.
Bug: b/296994239
Change-Id: I70c10fddc3bd01fef5ed5182e1d28d0797c431e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342421
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-12-20 12:23:56 +00:00
Derek Xu cd5d399e2b Reland "[ DDS ] Fix DDS AOT snapshot build rules"
This is a reland of commit 0a393f1b69

The problem was that the checks for whether or not dartaotruntime
existed were always returning false on Windows because the ".exe" suffix
wasn't being taken into account. Patchset 2 addresses this.

Original change's description:
> [ DDS ] Fix DDS AOT snapshot build rules
>
> dds_aot.dart.snapshot was not being generated for runtime build targets,
> and dds.dart.snapshot was being built regardless of whether or not we
> were building for an IA32 target.
>
> This change also adds a check for IA32 in 'dart run' so the "Could not
> find dds_aot.dart.snapshot. Have you built the full Dart SDK?" message
> isn't printed when we fall back to using dds.dart.snapshot.
>
> This change also reverts 2cc08595a6, which
> failed to fix the issue it was attempting to fix.
>
> TEST=pkg/vm_service tests
>
> Change-Id: Ic990082c25b0d022093ad66600332dfb2878709f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341760
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>

TEST=pkg-win-release-try, pkg-win-release-arm64-try, and pkg/vm_service
tests

Change-Id: Ieab41edcb6bffca3be6bf628e357871f28949323
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342640
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-12-19 21:17:15 +00:00
Derek Xu ba0835f5e2 Revert "[ DDS ] Fix DDS AOT snapshot build rules"
This reverts commit 0a393f1b69.

Reason for revert: breaks dartdev on Windows

Original change's description:
> [ DDS ] Fix DDS AOT snapshot build rules
>
> dds_aot.dart.snapshot was not being generated for runtime build targets,
> and dds.dart.snapshot was being built regardless of whether or not we
> were building for an IA32 target.
>
> This change also adds a check for IA32 in 'dart run' so the "Could not
> find dds_aot.dart.snapshot. Have you built the full Dart SDK?" message
> isn't printed when we fall back to using dds.dart.snapshot.
>
> This change also reverts 2cc08595a6, which
> failed to fix the issue it was attempting to fix.
>
> TEST=pkg/vm_service tests
>
> Change-Id: Ic990082c25b0d022093ad66600332dfb2878709f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341760
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>

Change-Id: I479a026184fc1fe27926d1ab0d7d3221dec3130e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342440
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-12-18 17:13:59 +00:00
Ben Konyi 0a393f1b69 [ DDS ] Fix DDS AOT snapshot build rules
dds_aot.dart.snapshot was not being generated for runtime build targets,
and dds.dart.snapshot was being built regardless of whether or not we
were building for an IA32 target.

This change also adds a check for IA32 in 'dart run' so the "Could not
find dds_aot.dart.snapshot. Have you built the full Dart SDK?" message
isn't printed when we fall back to using dds.dart.snapshot.

This change also reverts 2cc08595a6, which
failed to fix the issue it was attempting to fix.

TEST=pkg/vm_service tests

Change-Id: Ic990082c25b0d022093ad66600332dfb2878709f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341760
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-12-15 19:05:59 +00:00
Ömer Sinan Ağacan 75c975fe6d [dart2wasm] Remove stringref target
stringref target won't be used any time soon (probably ever). To help
with build times and avoid keeping it updated remove it for now.

Change-Id: I0df33b7ab2e19bae5090e8ea32ea6a3dc3751652
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/334881
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2023-11-10 09:49:37 +00:00
Alexander Aprelev f4d9c95262 [vm/dart2js] Add dart2js aot snapshot target to build scripts.
dart2js aot snapshot is used internally, so it makes sense to start building it externally to better understand its performance characteristics.
This CL doesn't add aot snapshot to dart sdk.

Change-Id: Id82a956138b118fb0a4bf0a16b1750e7bd4a801e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330664
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2023-10-16 19:23:09 +00:00
asiva 409eb5ba7e [Reland] [dartdev] Convert gen_kernel.dart.snapshot into an AOT snapshot
Convert gen_kernel to use an AOT snapshot in the
dart compile exe
command.

TEST=ci

Change-Id: I3024bdd20f40ef562936821aa936eec74662373e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327711
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2023-09-26 21:46:58 +00:00
asiva df266b8a44 [Reland] [dartdev] Use an AOT snapshot for dds
This change enables use of an AOT snapshot for dds execution.

TEST=ci

Change-Id: I1eba2913a4160dee5de663622aa9106dd1d83c04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327710
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2023-09-26 18:27:02 +00:00
Tess Strickland 03c2003222 Revert "[dartdev] Convert gen_kernel.dart.snapshot into an AOT snapshot"
This reverts commit 0f8069d9d0.

Reason for revert: Broke the following builds:
* vm-appjit-linux-product-x64
* vm-aot-*-product-*
* vm-ffi-android-product-*
as well as the following tests:
* pkg/dartdev/test/commands/compile_test
* pkg/vm_snapshot_analysis/test/instruction_sizes_test
* pkg/vm_snapshot_analysis/test/precompiler_trace_test

Original change's description:
> [dartdev] Convert gen_kernel.dart.snapshot into an AOT snapshot
>
> Convert gen_kernel to use an AOT snapshot in the
> dart compile exe
> command.
>
> TEST=ci
>
> Change-Id: I6e338525dabb4e84dc1edff8f0bbac803223e74d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327520
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Siva Annamalai <asiva@google.com>

Change-Id: Ia7225516a17cab52c8506abee05ce0935941f1cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327641
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2023-09-25 10:17:52 +00:00
Siva Annamalai e854243a3d Revert "[dartdev] Use an AOT snapshot for dds"
This reverts commit 5f33a9ab80.

Reason for revert: There is speculation that this CL might have caused some errors invoking the analysis server from dartdev, leading to the error "dartdev: Error: Error when reading 'dartdev': No such file or directory"

TEST=ci

Original change's description:
> [dartdev] Use an AOT snapshot for dds
>
> This change enables use of an AOT snapshot for dds execution.
>
> TEST=ci
>
> Change-Id: I500be544e168bd487745ee1232fd925d5ef546b8
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327140
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Derek Xu <derekx@google.com>
> Commit-Queue: Siva Annamalai <asiva@google.com>

Change-Id: I33a53a17f53714d3df5aba539870574a631cd416
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327523
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2023-09-22 23:09:25 +00:00
asiva 0f8069d9d0 [dartdev] Convert gen_kernel.dart.snapshot into an AOT snapshot
Convert gen_kernel to use an AOT snapshot in the
dart compile exe
command.

TEST=ci

Change-Id: I6e338525dabb4e84dc1edff8f0bbac803223e74d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327520
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2023-09-22 20:03:29 +00:00
asiva 5f33a9ab80 [dartdev] Use an AOT snapshot for dds
This change enables use of an AOT snapshot for dds execution.

TEST=ci

Change-Id: I500be544e168bd487745ee1232fd925d5ef546b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327140
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2023-09-22 15:50:50 +00:00
Nicholas Shahan 34e1b89286 [ddc] Delete unused build targets
The last uses were removed in
b04c2a3783

Change-Id: I3eae2145ba5d5fdab8e9e13c20b466f5a0c9eb14
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326248
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-09-18 17:56:35 +00:00
Nicholas Shahan 3a65ac91f1 [ddc] Cleanup old "dartdevc" build targets
Use the new "ddc" targets everywhere and delete
the old targets.

Change-Id: I89d3351006a2c3eb0d1b9d526b868cbb676dce6b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315561
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-08-29 21:33:48 +00:00
Derek Xu a083d44ddf [SDK] Ensure compatibility between frontend_server AOT snapshot and dartaotruntime in release builds
Change-Id: I7d0e98de681268afc71349a9c7a8efeaf2f4e019
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323241
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-08-29 19:44:29 +00:00
Derek Xu 2e6203df1f [SDK] Add frontend_server AOT snapshot to the SDK
The size of the AppJIT snapshot that is already in the SDK is around
44.53 MB. The size of this new AOT snapshot is around 14.57 MB. We
temporarily need to have both snapshots in the SDK, but we plan on
removing the AppJIT snapshot.

Change-Id: I1247f0ecbd3d05d18d22c8b36ac078e26de2c183
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322180
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-08-25 20:29:09 +00:00
Nicholas Shahan f4e949609c [ddc] Add new build targets for DDC assets
- Introduces a new output subdirectory `gen/utils/ddc` where the
  new build targets output files. This is intended to make the
  migration to the new assets easier since landing this change
  shouldn't immediately break any dependencies.
- Enables building the canary and stable assets at the same time.
- Changes more names in our workflow from "dartdevc" to "ddc".
- Updates the ddc-canary-linux-chrome and
  ddc-canary-linux-chrome-unsound configurations to use the
  new assets.

The new outputs appear in directories that are more consistently
named, (no more sound vs kernel confusion). They are named in
preparation for the eventual deletion of the unsound targets
without any lingering cruft to be cleaned up in the sound
directories.

The new structure is:

```
gen/utils/ddc/
           |- canary
           |  |- pkg
           |  |- sdk
           |- canary_unsound
           |  |- pkg
           |  |- sdk
           |- stable
           |  |- pkg
           |  |- sdk
           |- stable-unsound
              |- pkg
              |- sdk
```

The 'pkg' and 'sdk' directories all contain outputs with the same
files names, each compiled in the respective build modes
(sound/unsound and stable/canary).

Change-Id: I66822ebf03bba487b6d359a8e0aa818b9e7b6bef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313081
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-07-25 00:19:52 +00:00
Joshua Litt 9e37c2b480 [dart2wasm] Add JS compatibility mode.
The purpose of the wasm_js_compatibility target is to facilitate experiments with a JS compatibility mode for Dart2Wasm. Initially, we're just going to focus on typed data, but this will give us a place to experiment with moving List and String to JS as well.

In addition, someday down the road we hope to experiment with two additional compatibility changes:
1) Exclusively using double for all Dart numbers
2) Allowing undefined to flow as null.

The two major benefits of this approach are:
1) Much faster JS interop
2) To make it easier to bring up Dart2JS applications on Dart2Wasm

The only downside will be access overhead on the Wasm side, but the JS builtins proposal could potentially bring us close to parity with Wasm builtins someday.

Tested: Wasm specific trivial refactor.
Change-Id: I2c09426b6999507c1de6e584e9bc7072a088bda9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313240
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2023-07-18 19:34:38 +00:00
Ryan Macnak ce6634e041 [build] Collapse now-identical application_snapshot and kernel_application_snapshot.
Change-Id: I6aabe13b9e4adcfcfb073197e9b6b5605e16e30c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310968
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-06-23 21:58:30 +00:00
Aske Simon Christensen 5838562040 [dart2wasm] Add option and target for stringref.
This adds basic infrastructure for a stringref implementation in
dart2wasm:

- A `--[no-]stringref` option to the compiler
- An option in the `WasmTarget`, controlling the name of the target
- Separate sets of patch files for the two targets
- Separate platform dill files for the two targets

For now, the patch file contents are the same, and the compiler flag
is not used by the backend (only by the `dart2wasm` script to select
the appropriate platform dill file). Both of these will change as the
implementation progresses.

Tested: ci + manual check that the option selects the correct dill
Change-Id: I2c9bb95ba06fd3de3f7007703ef545e3f0c728ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310621
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2023-06-21 14:25:38 +00:00
Ryan Macnak 52791b4e0d [build] Decide in one place between using app-jit and kernel for the SDK snapshots.
Change-Id: Id642c635979b96f09780aba49ffcb1b9f215878d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/306666
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-06-01 15:20:58 +00:00
asiva 54dea888a5 [dart cli] Remove need for dartdev.dill file from sdk
The bulid rules generate an appjit snapshot or a kernel file under
dartdev.dart.snapshot depending on whether the target_cpu is the same as
the host_cpu.
Generation of the additional dartdev.dill file is not needed because of
this, the logic to start the dartdev isolate tries to load
dartdev.dart.snapshot as an appjit snapshot first and if that fails it
tries it as a kernel file.

TEST=ci

Change-Id: I1c985bdf543d3eb5e17d968378053cc558fd8a0f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/306134
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2023-05-30 21:42:39 +00:00
Lasse R.H. Nielsen 0386350aa7 Remove code which no longer compiles.
Probably hasn't worked in a while, so it's unlikely
that anything depends on it.

Change-Id: I7b73b92842b897b8367bf48a490a0e25cd306b3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292083
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Auto-Submit: Lasse Nielsen <lrn@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2023-04-03 23:40:05 +00:00
Jake Macdonald d259edfa28 fix up utils/tests/peg and utils/peg code to not have diagnostics
This code is opted in to the latest language version but was not ever migrated.

It could possibly be just deleted, as it hasn't been runnable for some time, but I have no idea really.

Change-Id: I7ccda121dcd56ed9388b48c70e3b3c0b2d087e47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292042
Commit-Queue: Jake Macdonald <jakemac@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2023-03-31 17:04:38 +00:00
Nicholas Shahan b49582196c [ddc] Use sound null safety when training snapshot
Change-Id: I89761a8248fbca64ed066dafbc3c5ece8be1c455
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291302
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-03-27 21:28:51 +00:00
Sigmund Cherem f72782ce9b [dart2js]: require dart2js to be invoked from an approved CLI
The dart2js snapshot is not meant to be invoked directly except from
a limited set of entry points (CLIs and internal build systems).
This change makes it an error to invoke it in unsupported ways.

Note: this change is not expected to be visible to end users.

Fixes #51695

Change-Id: I4013dd00b90bb3d54483e2f112e0ddfb8dc694e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289885
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2023-03-23 01:58:58 +00:00