Commit graph

192 commits

Author SHA1 Message Date
James Clarke 50a2216b31 Changes to make support WinUWP target
TEST=no new tests added for this change, existing tests should work.
Bug: 43762
Change-Id: I1cc4c18526c0eef62c441567e8a7e55dd3dd8b0d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167041
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-12-04 22:46:12 +00:00
Alexander Markov d014a0f59b Remove bytecode mode of Dart SDK build
This change cleans up build.py --bytecode and gn.py --bytecode options.

Change-Id: Ie251e7049ce3f8f9da28d35eda139b60ee23af98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167842
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-10-21 22:43:14 +00:00
Daco Harkes 7c5df91579 [flutter] Fix GN typo
Typo from https://dart-review.googlesource.com/c/sdk/+/164320 was not
caught on the Dart CQ.

dart_native_api.c (does not exist) should have been dart_api_dl.c.

Fix verified with Flutter build locally.

Change-Id: I7e37e4da27c02a2800ff36fd67e1be1575714c9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164560
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2020-09-25 15:16:14 +00:00
Daco Harkes 11f15f5125 [sdk] Recover folder structure in include folder
Such that include/internal/dart_api_dl_impl.h ends up in
include/internal/dart_api_dl_impl.h in the sdk release.

Also, adds missing C file: include/dart_native_api.c.

Change-Id: Ibe8dd6a6a5eed171b4bfc1f1a3013f5cf2a13547
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164320
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2020-09-25 11:09:44 +00:00
Vyacheslav Egorov 566fd8af36 [vm] Tweak version.cc generation
Actuallly generate null SDK hash in version.cc when verify_sdk_hash
is set to false. Previously it also required setting dart_version_git_info
to false.

R=cskau@google.com

Change-Id: Ib81757c898507029c499c7c3fa17a86b3375d25b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161701
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2020-09-03 10:00:24 +00:00
asiva 930e50964d [SDK] - Remove support for option '--custom-for-pub' in make_version.py
Bug:42820
Change-Id: I773c09790cdb97edbd4b5ebc75c1746d50d80d2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155681
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-08-26 03:46:33 +00:00
Liam Appelbe 0f14261176 Reland "[vm/wasm] Boilerplate for package:wasm"
This is a reland of 2bafc322fd

Original change's description:
> [vm/wasm] Boilerplate for package:wasm
>
> So far this just builds the wasmer library, copies it into the sdk
> directory, loads the library, and allows you to compile WASM modules.
> You can't actually do anything with the modules yet.
>
> Bug: https://github.com/dart-lang/sdk/issues/37882
> Change-Id: I7d7cfe5721bbe38a6afe76f326518e714d236ed4
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158367
> Commit-Queue: Liam Appelbe <liama@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: I8056df1e301acde2772ba2273148faa53d03173e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159321
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2020-08-21 18:23:00 +00:00
Tess Strickland 2546ad268f Revert "[vm/wasm] Boilerplate for package:wasm"
This reverts commit 2bafc322fd.

Reason for revert: Build failures on Flutter HHH CI bots and golem (Dart VM ARMv8, Flutter).

Original change's description:
> [vm/wasm] Boilerplate for package:wasm
> 
> So far this just builds the wasmer library, copies it into the sdk
> directory, loads the library, and allows you to compile WASM modules.
> You can't actually do anything with the modules yet.
> 
> Bug: https://github.com/dart-lang/sdk/issues/37882
> Change-Id: I7d7cfe5721bbe38a6afe76f326518e714d236ed4
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158367
> Commit-Queue: Liam Appelbe <liama@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

TBR=rmacnak@google.com,asiva@google.com,liama@google.com

Change-Id: I2c5b390987bf45704a3de98e050f4bcf1cb235d8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/37882
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159243
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2020-08-19 08:07:19 +00:00
Liam Appelbe 2bafc322fd [vm/wasm] Boilerplate for package:wasm
So far this just builds the wasmer library, copies it into the sdk
directory, loads the library, and allows you to compile WASM modules.
You can't actually do anything with the modules yet.

Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: I7d7cfe5721bbe38a6afe76f326518e714d236ed4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158367
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-08-18 23:55:31 +00:00
Liam Appelbe 089d6fc016 [vm] Build a runnable Fuchsia package containing Dart
Everything in the build/fuchsia director (except for tests.cmx) was
copied and modified from:
https://fuchsia.googlesource.com/samples/+/refs/heads/master/build

This doesn't include any tests yet, but its runnable on the emulator.

Change-Id: Id64ae71062447c789ca4d10ed3a4a09e0a6d7b99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152589
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2020-07-10 18:10:05 +00:00
Martin Kustermann 53807c1d79 [vm] Remove ARMv6 related code
This also allows unaligned access, since it's mandatory for ARMv7 (we
already take advantage of it for ARMv8).

Issue https://github.com/dart-lang/sdk/issues/42069

Change-Id: I0bd61a930e61dea330ab21fd187fe64b057ca28e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152322
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-06-26 09:39:15 +00:00
Liam Appelbe 583cfeb6f1 [vm] Fix linker bugs in --os=fuchsia release/product
Change-Id: Iba00073983ca2da46c1d6f74ddfb9a37382d6fd5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152421
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2020-06-24 20:35:19 +00:00
Daco Harkes 7eac9f355e [vm/ffi] Expose a subset of dart_(native_)api.h for dynamic linking.
This CL introduces dart_api_dl.h which exposes a subset of dart_api.h
and dart_native_api.h for dynamic linking at runtime through the FFI.
Dynamic linking is done through including dart_api_dl.cc in a shared
library and passing NativeApi.initializeApiDLData to the init function.

This CL also includes Native API versioning to deal with possible
version skew between native api version against which native libraries
are compiled and the version in the DartVM the code is run on.

The subset of symbols in the CL includes handle related symbols, error
related symbols, handle scope symbols, and native port sumbols.

Design: http://go/dart-ffi-expose-dart-api

Closes: https://github.com/dart-lang/sdk/issues/40607
Closes: https://github.com/dart-lang/sdk/issues/36858
Closes: https://github.com/dart-lang/sdk/issues/41319
Closes: https://github.com/flutter/flutter/issues/46887
Closes: https://github.com/flutter/flutter/issues/47061

Misc:
Closes: https://github.com/dart-lang/sdk/issues/42260

Change-Id: I9e557808dbc99b341f23964cbddbb05f26d7a6c5
Cq-Include-Trybots: luci.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/+/145592
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-06-18 07:30:43 +00:00
Liam Appelbe 764e72800f Reland "Revert "Add an --os=fuchsia option to build.py:""
This reverts commit d39d4d0d55.

Reason for revert: Relanding with fix

Change-Id: I6d6911b6cdc578a3b576b237db94c7f1db9824b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151600
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2020-06-18 00:24:31 +00:00
Martin Kustermann 168539d61d Reland "[vm] Build dart2native dependencies with the normal "create_sdk" target"
The flutter engine DEPS got new icu/boringssl so this CL can safely
land and roll into engine. A small change is made in Patchset 1..3.

This removes special logic for creating the `dart-sdk` we distribute
which used to build release and product mode and copied some binaries
from the latter into the former, before the SDK was actuallly ready to
test and distribute.

This changes the GN build rules to build the necessary
gen_snapshot/dart_precompiled_runtime product binaries during the normal
release build.

Normally during --mode=product builds the global build config in
//build/config/BUILDCONFIG.gn will set `-fvisibility=false`.

=> Doing so results in much smaller binaries - because only explicitly
   exported symbols are visible, the rest can be tree shaken by the linker.

Since we are building --mode=release, the `-fvisibility=false` will not
be set. In order to set the flag for the 2 special product-mode binaries
we need to add -fvisibility=hidden manually, in:

  * dart_product_config: Which is used for compiling VM sources.
  * 3rd party double-conversion library
  * 3rd party boringssl library
  * 3rd party icu library

The upstream CLs are:

  * BoringSSL: https://dart-review.googlesource.com/c/boringssl_gen/+/150482
  * ICU: https://chromium-review.googlesource.com/c/chromium/deps/icu/+/2236407

Issue https://github.com/dart-lang/sdk/issues/42230

Change-Id: I8d9b37acbb5eb94e44d97652f838948a946fd372
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151505
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2020-06-17 16:12:26 +00:00
Martin Kustermann 21222b64c4 Revert "[vm] Build dart2native dependencies with the normal "create_sdk" target"
This reverts commit a88a328b7f.

Reason for revert: Auto roller hasn't rolled previous changes from
Dart yet. Those changes updated DEPS for icu/boringssl. We have to
wait with this CL until the DEPS changes have been done in the engine.

Original change's description:
> [vm] Build dart2native dependencies with the normal "create_sdk" target
> 
> This removes special logic for creating the `dart-sdk` we distribute
> which used to build release and product mode and copied some binaries
> from the latter into the former, before the SDK was actuallly ready to
> test and distribute.
> 
> This changes the GN build rules to build the necessary
> gen_snapshot/dart_precompiled_runtime product binaries during the normal
> release build.
> 
> Normally during --mode=product builds the global build config in
> //build/config/BUILDCONFIG.gn will set `-fvisibility=false`.
> 
> => Doing so results in much smaller binaries - because only explicitly
>    exported symbols are visible, the rest can be tree shaken by the linker.
> 
> Since we are building --mode=release, the `-fvisibility=false` will not
> be set. In order to set the flag for the 2 special product-mode binaries
> we need to add -fvisibility=hidden manually, in:
> 
>   * dart_product_config: Which is used for compiling VM sources.
>   * 3rd party double-conversion library
>   * 3rd party boringssl library
>   * 3rd party icu library
> 
> The upstream CLs are:
> 
>   * BoringSSL: https://dart-review.googlesource.com/c/boringssl_gen/+/150482
>   * ICU: https://chromium-review.googlesource.com/c/chromium/deps/icu/+/2236407
> 
> Issue https://github.com/dart-lang/sdk/issues/42230
> 
> Change-Id: I3e47664d9fadb9ed1ad033bb17d46e769442f741
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150524
> Commit-Queue: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Alexander Thomas <athom@google.com>
> Reviewed-by: Zach Anderson <zra@google.com>

TBR=kustermann@google.com,zra@google.com,athom@google.com,asiva@google.com

Change-Id: Ied0f2f5b58dceb2b59bc2ac6e11e5fd717c8885e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151382
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-06-16 10:41:27 +00:00
George Wright d39d4d0d55 Revert "Add an --os=fuchsia option to build.py:"
This reverts commit 4ce18ab931.

Reason for revert: bad merge, caused build breakages in flutter/engine

Original change's description:
> Add an --os=fuchsia option to build.py:
> 
> tools/build.py --os=fuchsia runtime create_sdk
> 
> This is analogous to --os=android. It cross compiles from Linux x64 to
> Fuchsia.
> 
> A lot of the build rules are just slightly different between the existing
> Fuchsia build rules used by Flutter, and the ones added by GN SDK. For
> example "$fuchsia_sdk_root/pkg:fdio" is now "$fuchsia_sdk_root/pkg/fdio".
> So to support this I had to add a new variable, using_fuchsia_gn_sdk,
> analogous to using_fuchsia_sdk. Flutter will need to set this to false.
> 
> Change-Id: Ief275d65f30a42a801607de93cf2d27a1fe825dd
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150689
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Liam Appelbe <liama@google.com>

TBR=rmacnak@google.com,asiva@google.com,liama@google.com,kaushikiska@google.com,matthewcarroll@google.com

Change-Id: If01ee34eba906c55f2d56ba650748a86e81e701c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151321
Auto-Submit: George Wright <wrightgeorge@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
2020-06-15 23:01:53 +00:00
Liam Appelbe 4ce18ab931 Add an --os=fuchsia option to build.py:
tools/build.py --os=fuchsia runtime create_sdk

This is analogous to --os=android. It cross compiles from Linux x64 to
Fuchsia.

A lot of the build rules are just slightly different between the existing
Fuchsia build rules used by Flutter, and the ones added by GN SDK. For
example "$fuchsia_sdk_root/pkg:fdio" is now "$fuchsia_sdk_root/pkg/fdio".
So to support this I had to add a new variable, using_fuchsia_gn_sdk,
analogous to using_fuchsia_sdk. Flutter will need to set this to false.

Change-Id: Ief275d65f30a42a801607de93cf2d27a1fe825dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150689
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2020-06-15 20:05:16 +00:00
Martin Kustermann a88a328b7f [vm] Build dart2native dependencies with the normal "create_sdk" target
This removes special logic for creating the `dart-sdk` we distribute
which used to build release and product mode and copied some binaries
from the latter into the former, before the SDK was actuallly ready to
test and distribute.

This changes the GN build rules to build the necessary
gen_snapshot/dart_precompiled_runtime product binaries during the normal
release build.

Normally during --mode=product builds the global build config in
//build/config/BUILDCONFIG.gn will set `-fvisibility=false`.

=> Doing so results in much smaller binaries - because only explicitly
   exported symbols are visible, the rest can be tree shaken by the linker.

Since we are building --mode=release, the `-fvisibility=false` will not
be set. In order to set the flag for the 2 special product-mode binaries
we need to add -fvisibility=hidden manually, in:

  * dart_product_config: Which is used for compiling VM sources.
  * 3rd party double-conversion library
  * 3rd party boringssl library
  * 3rd party icu library

The upstream CLs are:

  * BoringSSL: https://dart-review.googlesource.com/c/boringssl_gen/+/150482
  * ICU: https://chromium-review.googlesource.com/c/chromium/deps/icu/+/2236407

Issue https://github.com/dart-lang/sdk/issues/42230

Change-Id: I3e47664d9fadb9ed1ad033bb17d46e769442f741
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150524
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2020-06-15 15:17:35 +00:00
Ryan Macnak ffd6f54473 [infra] Define a GCC builder configuration.
Change-Id: I5218e5f0858279589ac3b3b71fb27daccb3095c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146697
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2020-05-16 00:26:32 +00:00
P.Y. Laligand db75896497 [fuchsia] Update label for trace-engine library.
Change-Id: I4b30ebb576e64d0b2448a815fb5f5cee2bc5655b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148235
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-05-16 00:04:22 +00:00
Ryan Macnak b6ef01ddaf [vm] Fix -Wno-conversion-null errors.
Change-Id: Id4f506f168a40682a6f9176ab6dc8ac4c110b9ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147326
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-05-08 17:08:49 +00:00
asiva 03ce33f80c [BUILD] - Initial CL to unfork the NNBD Dart SDK
- Flips the flag from --nnbd to --no-nnbd so that by default it builds
  the NNBD version
- using the --no-nnbd flag results in the SDK being built in a
  directory which has the 'Legacy' suffix added to it
  (e.g: out/DebugX64Legacy)
- the '--enable-experiment=non-nullable' flag still needs to be passed
  in during execution so that CFE runs in that mode. This is different
  from the 'null_safety' flag

Change-Id: I729630a7bd36ea7ae38134f9285b44e93c283c68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138902
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2020-05-07 21:12:47 +00:00
Siva Annamalai 726d3c7725 Revert "[BUILD] - Initial CL to unfork the NNBD Dart SDK"
This reverts commit cab69e7706.

Reason for revert: It was a temporary submit

Original change's description:
> [BUILD] - Initial CL to unfork the NNBD Dart SDK
> NOTE: This is a trial submit and will be reverted immediately.
> 
> - Flips the flag from --nnbd to --no-nnbd so that by default it builds
>   the NNBD version
> - using the --no-nnbd flag results in the SDK being built in a
>   directory which has the 'Legacy' suffix added to it
>   (e.g: out/DebugX64Legacy)
> - the '--enable-experiment=non-nullable' flag still needs to be passed
>   in during execution so that CFE runs in that mode. This is different
>   from the 'null_safety' flag
> 
> Change-Id: I7d25d9710818af5919c0bb83abe51153172f5886
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144880
> Reviewed-by: Siva Annamalai <asiva@google.com>

TBR=asiva@google.com

Change-Id: Ib0f99fc1a42c9c7a8b21f8542f4a35dba9105d5c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144900
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-04-27 05:00:10 +00:00
asiva cab69e7706 [BUILD] - Initial CL to unfork the NNBD Dart SDK
NOTE: This is a trial submit and will be reverted immediately.

- Flips the flag from --nnbd to --no-nnbd so that by default it builds
  the NNBD version
- using the --no-nnbd flag results in the SDK being built in a
  directory which has the 'Legacy' suffix added to it
  (e.g: out/DebugX64Legacy)
- the '--enable-experiment=non-nullable' flag still needs to be passed
  in during execution so that CFE runs in that mode. This is different
  from the 'null_safety' flag

Change-Id: I7d25d9710818af5919c0bb83abe51153172f5886
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144880
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-04-27 04:59:26 +00:00
Siva Annamalai 63a92a3b00 Revert "This is a trial submit of the unfork CL, it will be reverted immediately."
This reverts commit 393468dc89.

Reason for revert: This was a trial submit and so reverting it.

Original change's description:
> This is a trial submit of the unfork CL, it will be reverted immediately.
> This commit is being done so we can roll it into Flutter and run some device lab testing to see the effect this CL will have on Flutter.
> 
> [BUILD] - Initial CL to unfork the NNBD Dart SDK
> 
> - Flips the flag from --nnbd to --no-nnbd so that by default it builds
>   the NNBD version
> - using the --no-nnbd flag results in the SDK being built in a
>   directory which has the 'Legacy' suffix added to it
>   (e.g: out/DebugX64Legacy)
> - the '--enable-experiment=non-nullable' flag still needs to be passed
>   in during execution so that CFE runs in that mode. This is different
>   from the 'null_safety' flag
> 
> Change-Id: I83c813aee2a5b61ad876d8a7b0988705bb24c839
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144082
> Reviewed-by: Siva Annamalai <asiva@google.com>

TBR=asiva@google.com,liama@google.com

Change-Id: I7b50fae71764eceb17893338d1981e40ea2de520
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144083
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-04-20 03:50:49 +00:00
asiva 393468dc89 This is a trial submit of the unfork CL, it will be reverted immediately.
This commit is being done so we can roll it into Flutter and run some device lab testing to see the effect this CL will have on Flutter.

[BUILD] - Initial CL to unfork the NNBD Dart SDK

- Flips the flag from --nnbd to --no-nnbd so that by default it builds
  the NNBD version
- using the --no-nnbd flag results in the SDK being built in a
  directory which has the 'Legacy' suffix added to it
  (e.g: out/DebugX64Legacy)
- the '--enable-experiment=non-nullable' flag still needs to be passed
  in during execution so that CFE runs in that mode. This is different
  from the 'null_safety' flag

Change-Id: I83c813aee2a5b61ad876d8a7b0988705bb24c839
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144082
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-04-20 03:46:06 +00:00
Vyacheslav Egorov a41a1dc917 [vm/compiler] Split compiler sources out of normal VM sources.
Make them form its own source set (libdart_compiler) and completely exclude
them from AOT runtime targets.

Previously we had some inconsistencies, with some files were using
DART_PRECOMPILED_RUNTIME to fully or partially exclude either contents
from their headers or from implementation, while other files did nothing
and relied on linker to throw their contents away.

This change tries to address this inconsistency.

A follow up change would include a check in most compiler headers which
would prohibit to use them while building AOT runtime.

Change-Id: Ief11b11cbc518b301d3e93fce80580a31bbad151
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142993
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-04-16 22:59:03 +00:00
asiva e33d023fa0 [BUILD] - Format gn files, this is being done to ensure the unfork CL
doesn't show these formatting changes as diffs.

Change-Id: I69ccbf4adabc66d88371cece785a2c1bce60f133
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138962
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-03-10 21:56:11 +00:00
Liam Appelbe 00e481aab0 [vm] Reland the flag flip behind the --nnbd build flag
Bug: https://github.com/dart-lang/sdk/issues/40409
Bug: https://github.com/dart-lang/sdk/issues/40179
Change-Id: Ib84926ef15068d23dcac7b89843c454b8446b28e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134062
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2020-01-30 23:41:19 +00:00
asiva ac4b43f0a8 [VM/runtime] - Remove DART_NO_SNAPSHOT
- Remove the define DART_NO_SNAPSHOT in all the build configs
- Remove all conditional code under DART_NO_SNAPSHOT

Change-Id: Ia01d09de7c4b1813a5e172a630950e637e476713
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130566
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-01-08 18:56:21 +00:00
Sigmund Cherem 561e8242ce Support building under git-worktree
This makes the location of the `.git` folder a GN argument, so it
can be configured differently when using git-worktree.

See sdk_args.gn for documentation on how to use this.

Fixes #33619 (http://dartbug.com/33619)



Change-Id: Ia8144f401c462a6fbb91a965979949f286b04d1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127485
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2019-12-19 23:12:53 +00:00
Samir Jindel c885bdde1d [vm] DBC is obsolete. Remove dead code.
Change-Id: Ica33af158cca53c8e951e4b2582de83660e8a60d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121851
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-27 18:18:29 +00:00
Martin Kustermann e82fedc345 [vm] Remove deprecated (and untested) ARMv5 support from the VM
Since we have no CQ/CI test coverage of ARMv5 and none of our customers
uses it, a breaking change request was made (see issue further down).

The breaking change has been approved and a corresponding email has been
sent out:

https://groups.google.com/a/dartlang.org/forum/?nomobile=true#!topic/announce/vRQja7di3FQ

This CL removes any armv5 related code from our codebase.

Closes https://github.com/dart-lang/sdk/issues/36666

Change-Id: I9abf32f1980ca19a9cf882b43c9966b2127f89e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122540
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-10-23 14:44:33 +00:00
Chris Bracken e41086ef7c [vm] Enable timeline trace events with Fuchsia SDK
Re-enables tracing when built against the public Fuchsia SDK. Was
previously only available on in-tree Fuchsia builds since tracing had
not been exposed in the public SDK.

Change-Id: I54026268f96f762a84c92c24df377249990159a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122081
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-10-18 01:33:03 +00:00
Ryan Macnak ecd7977928 [vm] Fix gcc build.
Change-Id: I8a0a9a695403dc6d048dccb9f33642d70cc5d588
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121866
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-10-17 16:51:32 +00:00
Ryan Macnak 71ecb73a2b [vm] Fix one MSAN failure; add UBSAN configuration.
Change-Id: I5b1d43836f3eb09983195fc3792f369aa3f8079f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120750
Reviewed-by: Chinmay Garde <chinmaygarde@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-10-09 23:38:30 +00:00
Ryan Macnak d5feab0c53 [vm] Create builds for LeakSanitizer, MemorySanitizer and ThreadSanitizer.
Change-Id: I65905ec76fcde8b7f4063cb5b80a3d034b453153
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120323
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Chinmay Garde <chinmaygarde@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-10-07 16:24:22 +00:00
Alexander Aprelev 34087a61ba [build] Remove dart_host_toolchain.
Consensus seems to be that there should be different mechanism to support host-targeting-host vs host-targeting-target configuration: comparing toolchains names won't work for that.
Also, dart_host_toolchain was set up to be used by Fuchsia, but it is no longer being used.

Change-Id: Ic2e63d8cef00b18bf6866122199027459eaf32c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118910
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2019-09-27 21:14:11 +00:00
Alexander Aprelev dbe8f6a9df Revert "[build] Rely on default host os TARGET_OS unless cross-compiling."
This reverts commit 4167867bb2 as it
breaks arm gen_snapshot that are build on linux:

```
$  python tools/build.py -mrelease -aarm --os=android dart process_test runtime_precompiled
using /run/user/276040/goma_aam as tmpdir
Auto update is skipped because latest/MANIFEST was updated recently.
Using goma VERSION=181 (latest)
GOMA version 2cc1b3e007b13ab21f982568ba6518c1c29d09e5@1567062346

goma is already running.

ninja -C out/ReleaseAndroidARM -j1000 -l64 dart process_test runtime_precompiled
ninja: Entering directory `out/ReleaseAndroidARM'
[1/1] Regenerating ninja files
current_toolchain //build/toolchain/android:clang_arm
host_toolchain //build/toolchain/linux:clang_x86
dart_host_toolchain //build/toolchain/linux:clang_x86
current_toolchain //build/toolchain/linux:clang_x86
host_toolchain //build/toolchain/linux:clang_x86
dart_host_toolchain //build/toolchain/linux:clang_x86
...

$ python tools/test.py -n dartkp-android-release-arm ffi/data_not_asan_test
...
--- Command "precompiler" (took 39ms):
DART_CONFIGURATION=ReleaseAndroidARM out/ReleaseAndroidARM/clang_x86/gen_snapshot --snapshot-kind=app-aot-elf --elf=/usr/local/google/home/aam/p/d/dart-sdk/sdk/out/ReleaseAndroidARM/generated_compilations/dartkp/tests_ffi_data_not_asan_test/out.aotsnapshot --no-sim-use-hardfp --ignore-unrecognized-flags --packages=/usr/local/google/home/aam/p/d/dart-sdk/sdk/.packages /usr/local/google/home/aam/p/d/dart-sdk/sdk/out/ReleaseAndroidARM/generated_compilations/dartkp/tests_ffi_data_not_asan_test/out.dill

exit code:
255

stderr:
error: import of dart:ffi is not supported in the current Dart runtime

--- Re-run this test:
python tools/test.py -n dartkp-android-release-arm ffi/data_not_asan_test

```

Change-Id: Ib1d3d11fc7bdb138557cee363681718bc5e88e24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118474
Reviewed-by: Alexander Aprelev <aam@google.com>
2019-09-23 23:04:55 +00:00
Alexander Aprelev 4167867bb2 [build] Rely on default host os TARGET_OS unless cross-compiling.
Before this change we erroneously override TARGET_OS with target_os value, which for example resulted in dart sdk built as part of Fuchsia targeting Fuchsia, rather than host os(Linux).

Bug: https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=36723
Change-Id: I92b698a331c8c5ef802f0b329ebf13616f29952f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118372
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2019-09-23 21:02:49 +00:00
Liam Appelbe ed9e89ea38 Implement a basic WASM API using wasmer.
Currently this only supports functions that take and return numeric
types. Byte arrays, and callbacks will come later, in a separate
wrapper package.

Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: I7bb82be83cbbb6062736b3e958f89d021f1af4bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114586
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-09-13 18:25:16 +00:00
Alexander Markov 7b50b7a8e6 [vm/bytecode] Bootstrapping VM from bytecode
Previously, core snapshot was generated from AST
(because --enable-interpreter/--use-bytecode-compiler was not specified
when building core snapshot).

As the result, CL
https://dart.googlesource.com/sdk/+/da8cb470cc94830a98d49532e8d5d1a5b3d80f8b
which declared libraries in bytecode also removed bytecode entirely from
core snapshot in Dart SDK.

This CL enables bytecode by default if --bytecode argument is
specified for gn.py. This enables JIT compiler from bytecode
(interpreter is still disabled by default but can be enabled
using --enable-interpreter). Core snapshot and other
snapshots now have bytecode.

This change revealed a bunch of bugs which are fixed in this CL:

* _Closure fields were treated as unboxing candidates which triggered
  assertion in LoadFieldTOS in interpreter.

* Several places should load class declarations if they are not loaded yet.

* Canonicalization of TypeRef objects which are not fully initialized
  may cause duplicate entries in the hash table of canonical
  TypeArguments. This triggers assertions when hash table is rehashed.
  The solution is to avoid canonicalization of non-root recursive types
  and recursive type arguments. Also, TypeRef::Canonicalize and
  TypeRef::Hash are reverted to assert and work only if type was set.

* Native wrapper classes are eagerly stamped as type-finalized
  which caused assertion failures when reading their class declarations
  from bytecode.

* When building flow graph for FFI trampolines kernel offset of library
  (which is now declared in bytecode) was queried. Added special case
  to Function::KernelDataProgramOffset().

* In interpreter-only mode with simulator (e.g. SIMARM64) if simulator
  is not called before code is interrupted with stack overflow check,
  simulator returns get_sp() = 0, which was treated as stack overflow.

* test standalone_2/io/platform_resolved_executable_test.dart
  spawns sub-process but it didn't pass VM options.

Change-Id: I81bc4f1a4c6725cfa246a435ebe5d8abe43abc67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107199
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2019-06-26 18:25:26 +00:00
Chinmay Garde aa64d1d2e6 Allow building Dart with Fuchsia SDK enabled buildroots.
The Fuchsia SDK can now be consumed by non-Fuchsia buildroots to produce
Fuchsia artifacts.

The Fuchsia SDK comes with a JSON manifest that describes the various SDK
"parts". GN targets are stamped for each of these parts. The location of these
GN targets can be configured. That location is set to |fuchsia_sdk_root| in
each buildroot. This variable is defined in //build/fuchsia/sdk.gni in each
buildroot. For buildroots that don't care or know about the Fuchsia SDK, that
file may not exist. This is why, the import of that file is guarded behind
the is_fuchsia flag. When the Fuchsia SDK is enabled, that file will define
values for two required variable |using_fuchsia_sdk| and |fuchsia_sdk_root|.

The first flag defines if the SDK is being used. If unset (but defined), the
builds are in-tree. Eventually we want only SDK builds. |fuchsia_sdk_root|
is set to the spot in the buildroot where the GN targets for the SDK parts
are stamped.

Change-Id: I604612c8d6a21efb07b323610e80b596abc1a6dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101540
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Chinmay Garde <chinmaygarde@google.com>
2019-05-07 00:43:33 +00:00
Aart Bik c5cdc4ed89 [dart/fuzzer] Add build rule to link Dart with libFuzzer
Rationale:
First step towards integrating libFuzzer with Dart.
The initial target function is proof-of-concept.


Change-Id: I21f6ebf70fec05719423fef61fa5a9609500dc95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96987
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2019-04-25 21:29:42 +00:00
Matthew Dempsky a0e0a7a150 [vm] Delete disallowed constructors/operators
This allows the compiler to emit better errors. It also allows the
compiler to detect when a class accidentally references its own
supposedly disallowed constructors/operators (e.g., see dartutils.cc).

Notably, this exposes a number of private member variables that are
unused, but some that are used only in certain build configurations.
It would arguably be better to only define the variables when they're
needed, but that's deferred to a subsequent CL.

Change-Id: I5d0e6697eebebc9321fae1ff49cc68caf557b903
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97175
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-03-23 00:52:41 +00:00
Zach Anderson 825d03c585 [vm] Remove malloc_hooks support for jemalloc
Fuchsia is switching/has switched to scudo.

Change-Id: I0c829518652053243bf3f8db675e562ccfb448f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95663
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2019-03-06 19:16:27 +00:00
Ryan Macnak dc555eb9a7 [vm] On Fuchsia, enable timeline streams based on the state of system trace categories.
Allows categories to be selected through arguments to `trace` instead of changing VM flags and rebuilding.

Change-Id: Ia1ec6b58ca0b765c3d675b7d4938acc5f624b768
Reviewed-on: https://dart-review.googlesource.com/c/91860
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-03-01 18:05:40 +00:00
Dan Field eb73f132c1 [vm] Add macro for fallthrough annotations
Internal builds in Google are catching this as an error.

I'm guarding it because I assume we might support building using other
compilers.

Change-Id: I665099cace9c6a40d737c471dd1b0fdb326fea39
Reviewed-on: https://dart-review.googlesource.com/c/91162
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-02-15 01:12:01 +00:00
Zach Anderson 03ba8c16aa [vm,fuchsia] Disable safe-stack
When running with safe-stack, the interpreter's C++ stack gets
clobbered, but does not get clobbered when running without safe-stack.
Disabling while investigating further to avoid crashes in Fuchsia.

Change-Id: I8ea03ee0e243e878a6f01ce499ad2ff109501d8b
Reviewed-on: https://dart-review.googlesource.com/c/88747
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2019-01-09 02:56:22 +00:00
Zach Anderson 3ad0571cf9 [fuchsia] Fixes for the Fuchsia build
Makes public some include paths needed for the dart_runner to depend on
dart_io.

Also updates some dart:io implementations to give and OSError
instead of crashing when something is unimplemented.

Change-Id: I862fc7cc43f56e74de791ecc021b88238b54a8e5
Reviewed-on: https://dart-review.googlesource.com/c/84920
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-11-26 16:30:33 +00:00
Liam Appelbe 899d1c15c7 Rollforward of the dart_io_api.h include change, with a fix for flutter.
The fix for the flutter build was to switch include_dirs from . to include/ in the dart_public_config. The other files in include/ were compiling correctly because their #includes were being treated as relative paths, but dart_io_api.h is in a subdirectory. In future, clients should be able to just add include/ to their C++ includes.

Tested: Dart tests, and verified that flutter engine compiles.
Bug: https://github.com/dart-lang/sdk/issues/35172
Change-Id: Ic74d7c1cdedeac32df939c53c1fd57a1260072a3
Reviewed-on: https://dart-review.googlesource.com/c/84686
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2018-11-19 18:16:11 +00:00
Liam Appelbe 53a47b25ff Standardize the #includes in runtime/include/*h.
Bug: https://github.com/dart-lang/sdk/issues/35172
Change-Id: I75d1e99fb178d7b6df051f6ada0a26a126e31b81
Reviewed-on: https://dart-review.googlesource.com/c/84542
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-11-15 23:19:38 +00:00
Ben Konyi 445a43b58d [ VM / Testing ] Add build flags to enable code coverage
Change-Id: I37e945f842932b1ac1d87444e4fec2eb752f312f
Reviewed-on: https://dart-review.googlesource.com/c/79465
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2018-10-16 22:11:05 +00:00
Michael Goderbauer d1a3eaaa99 Add flag to control symbol visibility of libdart
Change-Id: Ib2acfaa0f7813d6aa5e9886c664e863c3f8ebf00
Reviewed-on: https://dart-review.googlesource.com/76567
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-09-25 23:58:57 +00:00
Ryan Macnak 0c80630577 [vm] Fix ia32/x64 gcc build.
(The simulators are broken at runtime.)

Change-Id: I10089cad44fca57145cfdd598342279f07c6d7fd
Reviewed-on: https://dart-review.googlesource.com/75205
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-09-17 22:27:43 +00:00
Zach Anderson b4004f6476 [vm] Reland: Move the interpreter under a flag.
After this CL, the interpreter is included by default in the
JIT VM under the flag --enable-interpreter.

Reland with fix to NativeArgument setup in simulator_arm.cc

Change-Id: Ib9b4df6eb4d997dfbe361188b8a127828c1d9c6f
Reviewed-on: https://dart-review.googlesource.com/74003
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-09-07 19:25:31 +00:00
Zach Anderson 21406f576a Revert "[vm] Move the interpreter under a flag."
This reverts commit 715ab7b30b.

Reason for revert: simarm and kernel precomp builds failing

Original change's description:
> [vm] Move the interpreter under a flag.
> 
> After this CL, the interpreter is included by default in the
> JIT VM under the flag --enable-interpreter.
> 
> Change-Id: I06458f20288d67981822788ee6e867c2127ebdd3
> Reviewed-on: https://dart-review.googlesource.com/71800
> Commit-Queue: Zach Anderson <zra@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Reviewed-by: Régis Crelier <regis@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

TBR=rmacnak@google.com,alexmarkov@google.com,zra@google.com,asiva@google.com,regis@google.com

Change-Id: I3622f4dbe53288d07fc21b34ee5ff68f2682b36d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/74001
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-09-07 17:14:21 +00:00
Zach Anderson 715ab7b30b [vm] Move the interpreter under a flag.
After this CL, the interpreter is included by default in the
JIT VM under the flag --enable-interpreter.

Change-Id: I06458f20288d67981822788ee6e867c2127ebdd3
Reviewed-on: https://dart-review.googlesource.com/71800
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-09-07 16:46:07 +00:00
Zach Anderson 7d7e39a952 [build] Move dart2js run for Observatory from python to GN
Change-Id: Ief90d6125e30c6bed808bacce521fc84957fddb9
Reviewed-on: https://dart-review.googlesource.com/63662
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-07-03 22:50:16 +00:00
Ryan Macnak 86db7810ba [build] Declare dependency of the version strings on the current Git commit.
Add fake Git reflog to Debian source tarball.

Bug: https://github.com/flutter/flutter/issues/15348
Bug: https://github.com/dart-lang/sdk/issues/32614
Change-Id: Ib4104a98cf245ee11285a37d5eee3165ca656645
Reviewed-on: https://dart-review.googlesource.com/48091
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-06-11 18:22:09 +00:00
Ben Konyi e35ed9c749 [ VM / Build ] Added '--no-include-kernel-service' to build.py. By default, the kernel service is now included in all build modes, including product mode. Providing '--no-include-kernel-service' will build the specified configuration without the kernel service.
Change-Id: I682cd7c2895a9bcb215948615f2bdc627abe8d08
Reviewed-on: https://dart-review.googlesource.com/56286
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-05-23 20:35:53 +00:00
Zach Anderson 72921342c8 [Fuchsia] Small buildfile fix for scudo malloc
Change-Id: I92e9a3193d25b6032eae95bbd193190a09bf052b
Reviewed-on: https://dart-review.googlesource.com/54624
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-05-14 21:49:08 +00:00
Zach Anderson 70cf29cc59 [GN] Add interpreter config. Refactor configs.
Change-Id: Ic7f7c437464fe8c27850e1dc5c958d699143b87c
Reviewed-on: https://dart-review.googlesource.com/54712
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-05-14 15:26:37 +00:00
Régis Crelier 41fcbd097c [VM runtime] Initial version of Kernel Bytecode interpreter in VM runtime.
Not fully working yet, only x64, no gc, no frame walking, etc...

Change-Id: I4d8357f6d46371bf21c3d54266cfe26163e3c8dc
Reviewed-on: https://dart-review.googlesource.com/50021
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-05-09 20:29:27 +00:00
Zach Anderson 4877587346 [GN] Uses dart_action.gni instead of compiled_action.gni.
This avoids conflicts with client repos that have a file
//build/compiled_action.gni with something different in them.

Change-Id: I133f66b0989bcb547cb8eed8710a88e2c1384bd7
Reviewed-on: https://dart-review.googlesource.com/53440
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-05-03 21:07:13 +00:00
Ryan Macnak 258c5172df [vm] Remove dart_mirrors_api.h.
Its last user was Dartium's DevTools.

Change-Id: I86e1a2aacc7f2589be53418b3030accc0cef9a7d
Reviewed-on: https://dart-review.googlesource.com/53464
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-05-02 21:39:27 +00:00
Ryan Macnak c354caa80d [vm, fuchsia] Build the VM as a shared library instead of a static library.
Change-Id: I791063fb0e32d56ca04de09486b41e4e98450c92
Reviewed-on: https://dart-review.googlesource.com/34304
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-04-27 21:14:37 +00:00
Zach Anderson 0482cf4da1 [fuchsia] Add rules to build gen_snapshot targeting Fuchsia
This change enables building a gen_snapshot that targets Fuchsia during
an SDK build that targets the host (Mac, Linux).

Change-Id: I4cfbcbe4e26e4be7108fc40c96122fe9a2fb4c19
Reviewed-on: https://dart-review.googlesource.com/48683
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-03-28 19:39:49 +00:00
Ryan Macnak 439badf2c0 Revert "[build] Declare dependency of the version strings on the current Git commit."
This reverts commit c080951d45.

Reason for revert: Breaks Debian source package

Original change's description:
> [build] Declare dependency of the version strings on the current Git commit.
> 
> Bug: https://github.com/flutter/flutter/issues/15348
> Change-Id: Ifef1b55c6efe0f030ee83e4c43a774c7cd049fac
> Reviewed-on: https://dart-review.googlesource.com/45921
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Alexander Aprelev <aam@google.com>

TBR=aam@google.com,rmacnak@google.com,zra@google.com,phosek@google.com

Change-Id: I16ff18213bd1592c21bd9ae99b6e97fbdfc1824c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/flutter/flutter/issues/15348
Reviewed-on: https://dart-review.googlesource.com/45980
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-03-10 00:39:50 +00:00
Ryan Macnak c080951d45 [build] Declare dependency of the version strings on the current Git commit.
Bug: https://github.com/flutter/flutter/issues/15348
Change-Id: Ifef1b55c6efe0f030ee83e4c43a774c7cd049fac
Reviewed-on: https://dart-review.googlesource.com/45921
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2018-03-09 23:24:08 +00:00
Zach Anderson 0d5cf900b0 [infra,flutter] Adds semantically meaningful custom version strings
See https://github.com/flutter/flutter/issues/14751

Change-Id: I3b35c2a32c0dd1301e92abe23b1c6fe2c2e04a6c
Reviewed-on: https://dart-review.googlesource.com/42026
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-02-16 20:44:48 +00:00
Zachary Anderson f4758727dc [infra] Add a GN flag to omit git information
After Clang 6.0, changing the value of a single string can change the
order of symbols in the .rodata section. This confuses Golem's
checks for the equivalence of two binaries.

This change adds a GN flag to omit the git hash and commit time from
the Dart VM's version string to avoid re-running Golem benchmarks on
commits where the only VM change is in the version string.

To use it, pass --gn-args="dart_version_git_info=false" to gn.py

Change-Id: I8134714d50e3c9b6dae750a515dc3c2228d76b53
Reviewed-on: https://dart-review.googlesource.com/33000
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-01-08 18:29:44 +00:00
Zachary Anderson a99cdabd00 Reland: [GN] Adds dart_host_sdk_toolchain argument
Setting this build argument to something other than host_toolchain will
cause the build target create_host_sdk to be exposed. That target will
build the Dart SDK with the toolchain specified by
dart_host_sdk_toolchain.

Relanding to fix bad toolchain conditions in dart_os_config and
dart_arch_config.

TO-549

Change-Id: I276f47d9071233acb98f6029a4666da0cee33d7d
Reviewed-on: https://dart-review.googlesource.com/18361
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2017-11-02 19:02:18 +00:00
Zach Anderson 8f5d55623e Revert "[GN] Adds dart_host_sdk_toolchain argument"
This reverts commit 8fc90bd3bc.

Broken precomp bots due to wrong toolchain condition in dart_arch_config and dart_os_config.

Change-Id: Ic5c75f9ca3a0d4f316678354da44d1fcca10499d
Reviewed-on: https://dart-review.googlesource.com/18360
Reviewed-by: Zach Anderson <zra@google.com>
2017-11-02 18:03:27 +00:00
Zachary Anderson 8fc90bd3bc [GN] Adds dart_host_sdk_toolchain argument
Setting this build argument to something other than host_toolchain will
cause the build target create_host_sdk to be exposed. That target will
build the Dart SDK with the toolchain specified by
dart_host_sdk_toolchain.

TO-549

Change-Id: Ida92521724cf7af34b34fb8c6d3514a226c48dd4
Reviewed-on: https://dart-review.googlesource.com/18145
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2017-11-02 17:27:19 +00:00
Zachary Anderson 9ab8b55663 [gn] Split target arch/os defines from dart_config
This is a baby-step towards building an SDK targeting the host arch
during a cross-build. This will require a similar update to the use
of dart_config in the Flutter engine at //flutter/lib/io/BUILD.gn:19.

Change-Id: I8b871cceb53038cab8407264664c5ce545e6e010
Reviewed-on: https://dart-review.googlesource.com/17523
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2017-10-31 17:33:13 +00:00
Siva Annamalai af550c9b6c Revert "Revert "1. Remove unused dart debugger API entrypoints which are not used anymore""
This reverts commit e76ea5b604.

1. Remove unused dart debugger API entrypoints which are not used anymore
   as this API has been deprecated and dartium was the last user.

2. Some unit tests are using some of these API entrypoints, so moved them
   over to a test file which will be linked into run_vm_tests

Change-Id: I5a486b98e4b97eb4df2e58d9cc0ba603e96c2e32
Reviewed-on: https://dart-review.googlesource.com/11180
Reviewed-by: Siva Annamalai <asiva@google.com>
2017-10-04 20:19:22 +00:00
Siva Annamalai e76ea5b604 Revert "1. Remove unused dart debugger API entrypoints which are not used anymore"
This reverts commit c30918f11e.

Bug:
Change-Id: I6d5f037868a967a9f4fcabc1ecb20f34e957036a
Reviewed-on: https://dart-review.googlesource.com/8403
Reviewed-by: Siva Annamalai <asiva@google.com>
2017-09-26 02:20:55 +00:00
Siva Annamalai c30918f11e 1. Remove unused dart debugger API entrypoints which are not used anymore
as this API has been deprecated and dartium was the last user.

2. Some unit tests are using some of these API entrypoints, so moved them
   over to a test file which will be linked into run_vm_tests

Change-Id: I3343b23d082400da3c803cf81ea80dfaa5e426cf
Reviewed-on: https://dart-review.googlesource.com/7942
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2017-09-26 01:00:01 +00:00
George Kulakowski 7800d2a995 Rename Magenta to Zircon, along with related abbreviations
Change-Id: Ic4215ceb00f5a60d21ec1398fd398a9f78a9eb94
Reviewed-on: https://dart-review.googlesource.com/6100
Reviewed-by: Zach Anderson <zra@google.com>
2017-09-15 14:54:18 +00:00
Zachary Anderson 734beef062 [infra] Translate _sources.gypi files to _sources.gni files
Also deletes code that becomes dead as a result.

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2996903002 .
2017-08-14 21:54:36 -07:00
Zachary Anderson 80f096fb6c Add missing config to libdart_jit
It was dropped by mistake by an earlier commit and broke the Flutter
build.

R=aam@google.com

Review-Url: https://codereview.chromium.org/2984503002 .
2017-07-17 15:35:58 -07:00
Zachary Anderson fa859c507f Add libdart PRODUCT targets for Fuchsia's dart_runner
R=rmacnak@google.com

dart:hello_dart.dartx memory footprint: 6292k -> 5572k
Review-Url: https://codereview.chromium.org/2975343002 .
2017-07-15 21:43:50 -07:00
Ryan Macnak be95b916dd GN: Change the default meaning of dart_target_arch from current_cpu to target_cpu.
Update args.gn for the simulator builds to compensate.

R=zra@google.com

Review-Url: https://codereview.chromium.org/2980023002 .
2017-07-13 14:59:35 -07:00
Zachary Anderson b3200f4664 [Fuchsia] Routes timeline events to Fuchsia's tracing app
This CL routes timeline events to Fuchsia's tracing app when the
following arguments are passed to the VM:

--systrace_timeline
--timeline_recorder=systrace
--timeline_streams=[some streams here]

I'll add these arguments to the Flutter engine for Fuchsia after this
CL lands.

TO-367

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2977513002 .
2017-07-11 14:12:27 -07:00
Zachary Anderson 1a8174b08d Exclude Observatory assets from PRODUCT build dart, dart_precompiled_runtime
This CL also removes some compiler flags that increase space somewhat
that help the profiler find symbols, which isn't included in a PRODUCT
build.

Before:
zra@zach:~/dart/sdk$ ls -la out/ProductX64/exe.stripped/
-rwxr-x--- 1 zra eng  9693064 Jun 29 14:52 dart
-rwxr-x--- 1 zra eng  7391080 Jun 29 14:52 dart_precompiled_runtime

R=askesc@google.com, rmacnak@google.com

After:
-rwxr-x--- 1 zra eng  6809424 Jun 29 15:11 dart
-rwxr-x--- 1 zra eng  3299120 Jun 29 15:11 dart_precompiled_runtime
Review-Url: https://codereview.chromium.org/2964133002 .
2017-06-30 08:09:37 -07:00
Ryan Macnak f1b7e8ed8c Add gdb helper functions for creating a handle and using ToCString with RawObjects.
Improves gdb debugging when Object::Handle() is optimized away.

Replace some intermediate static_libraries with source_sets to fix export issue.

R=regis@google.com, vegorov@google.com, zra@google.com

Review-Url: https://codereview.chromium.org/2957843002 .
2017-06-29 14:31:44 -07:00
Zachary Anderson ac16656161 Remove MIPS support
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2858623002 .
2017-06-22 08:49:22 -07:00
Ryan Macnak 1eee6d8af3 Mostly revert "[fuchsia] Prepare for setting the Dart target architecture appropriately in the host binaries."
This reverts commit 9ab39ae099.

Keep removal of bad assert in loader.dart.  Keep using script snapshot in cross builds.

We expect to use a checked-in SDK in the Fuschia build instead.

R=zra@google.com

Review-Url: https://codereview.chromium.org/2951133002 .
2017-06-21 15:19:21 -07:00
Ryan Macnak dd996fc4be [fuchsia] Make symbols in the Dart VM visible, so they are available to the profiler.
R=zra@google.com

Review-Url: https://codereview.chromium.org/2946123002 .
2017-06-20 15:21:07 -07:00
Ryan Macnak 9ab39ae099 Reapply "[fuchsia] Prepare for setting the Dart target architecture appropriately in the host binaries."
Add missing config to run_vm_tests.

R=zra@google.com

Review-Url: https://codereview.chromium.org/2937503003 .
2017-06-13 08:49:00 -07:00
Ryan Macnak 3383c4ac25 Revert "[fuchsia] Prepare for setting the Dart target architecture appropriately in the host binaries."
This reverts commit 54e80a8c32.

Review-Url: https://codereview.chromium.org/2940513002 .
2017-06-12 15:19:23 -07:00
Ryan Macnak 54e80a8c32 [fuchsia] Prepare for setting the Dart target architecture appropriately in the host binaries.
Build another varient of dart_bootstrap targeting the host architecture to ensure reasonable Observatory build times.

Remove assert assuming a root script, which does not exist when gen_snapshot builds core snapshots.

R=zra@google.com

Review-Url: https://codereview.chromium.org/2924173005 .
2017-06-12 14:33:10 -07:00
Zachary Anderson 81e428fd39 [infra] Assembles the SDK using GN rather than create_sdk.py
This has a few advantages:
- We can track dependencies more precisely
- ninja can assemble things in parallel as they're ready rather than
  sequentially all at once.
- It is easier to customize SDKs depending on target platform, e.g.
  Fuchsia.

This CL also has a number of cleanups:
- Defining is_fuchsia and is_fuchsia host so we don't always have to check
- Piping through toolchain overrides in more places
- Fixing bugs in copy_tree.py, not using list_files.py, which is broken on Windows

related #29558

R=whesse@google.com

Review-Url: https://codereview.chromium.org/2848943003 .
2017-05-20 23:30:09 -07:00
Zachary Anderson 135b1907ee [Fuchsia] Grab the number of malloc'd bytes from jemalloc
This allows us to report the "native heap memory" value in
the Observatory for VMs running on Fuchsia.

This change also renames the flag --enable-malloc-hooks to
--profiler-native-memory to better reflect what the flag
does. (In the future we may also want to rename
--profiler to --profiler-cpu.)

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2829833003 .
2017-04-19 15:51:02 -07:00
Ryan Macnak 00c2af904f GN: Remove dead target 'libdart' and dead flag 'dart_experimental_interpreter'.
R=zra@google.com

Review-Url: https://codereview.chromium.org/2819453002 .
2017-04-12 16:05:37 -07:00
Ryan Macnak 42ec925a9e GN: Add libdart_jit and dart_api.
libdart_jit is always the JIT, unlike libdart which is either the JIT or AOT runtime depending on dart_runtime_mode. Clients of libdart will be updated to explicitly choose libdart_jit or libdart_precompiled_runtime.

dart_api allows libraries such as tonic or intermediate components of the Flutter engine to be agnostic as to whether they're in a JIT or AOT runtime, allowing the final executable making the choice without having to deal with a conflicting dependency brought in by a library.

Remove dead libdart_embedder_noio.

Replace all used of dart_nosnapshot* with dart_nosnapshot_with_precompiler*. We don't care about binary size of their clients, so it's better to have fewer targets.

R=zra@google.com

Review-Url: https://codereview.chromium.org/2814513003 .
2017-04-10 13:44:25 -07:00
Ryan Macnak 9575657668 AOT compiler changes for dart_content_handler:
- Move some misplaced entry points from the vm list to the standalone embedder list.
 - Add missing libdart_with_precompiler to GN.
 - Add ability to reference the root library in treeshaking roots without knowing its URI (as ::).

R=zra@google.com

Review-Url: https://codereview.chromium.org/2786483002 .
2017-03-29 10:12:05 -07:00
Ryan Macnak 9f2668c998 Set TARGET_OS_* from GN, falling back to HOST_OS_*.
Use TARGET_OS_* instead of HOST_OS_* to decide on the assembly variant to use. Allows, say, a gen_snapshot compiled for a Mac to target Android when generating AOT as assembly.

R=fschneider@google.com, zra@google.com

Review-Url: https://codereview.chromium.org/2757783003 .
2017-03-20 14:48:28 -07:00