Commit graph

17311 commits

Author SHA1 Message Date
Vyacheslav Egorov 91c80bb798 [vm/tool] Support reading V8 profiles in snapshot_analysis tool.
We reconstruct ProgramInfo tree structure from the snapshot
by applying a simple graph algorithm, which takes parts of the
snapshot with clear ownership (e.g. library, class, function objects)
and then attempts to attribute the rest of the snapshot to these
clearly owned objects based on reachability.

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

Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-try,pkg-win-release-try,pkg-mac-release-try
Change-Id: I17c0f8323ee9092a2214b18bd948ff51fa2ccc49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151384
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-06-22 21:38:16 +00:00
Martin Kustermann 142e15c2af [vm/compiler] Use unboxed index/length for GenericCheckBoundInstr on 64-bit architectures
flutter-release:

  * flutter_app_so_size: -0.47%
  * flutter_app_so_brotli_size: -0.48%
  * flutter_app_so_gzip_size: -0.57%

flutter-release-sizeopt:

  * flutter_app_so_size: -0.45%
  * flutter_app_so_brotli_size: -0.64%
  * flutter_app_so_gzip_size: -0.65%

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

Change-Id: If63b71e5d52f6ddb55fe05668a6480eb00a13303
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150300
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-06-22 19:55:36 +00:00
Martin Kustermann 0cc64fcc7d [vm/compiler] Ensure list index is integer in inliner
The inliner code is called from AOT/JIT call specializer on functions
where it knows the target. The callsite might be dynamic, in which case
the target function is a dyn:* forwarder (for calls which have one or
more non-implicit arguments).

The dyn:* forwarders inherit the recognized kind from their target. That
means the inliner has to take special care when trying to inline
functions: It can only rely on the static type safety for interface
calls, not for dynamic calls.

This CL fixes an existing bug where the call specializer knows the
target is a list and method recognizer builds custom graph for the list
indexing operator without ensuring that the index is actually an
integer.

The existing test will start failing on a dependent CL:

  tests/language_2/list/double_index_in_loop2_test.dart

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

Change-Id: Ic107fe736c1b6151562880919c39d1c650c119fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151849
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2020-06-22 13:25:35 +00:00
David Morgan 1d3fbbed7c Revert "Fix duration.toString() to conform the description"
This reverts commit 038e981f89.

Reason for revert: Breaks some tests; visible changes to some web UIs.

Original change's description:
> Fix duration.toString() to conform the description
> 
> Duration.toString() should return in a format of "HH:MM:SS.mmmmmm".
> But when `hours` is less than 10, toString() doesn't have the leading
> zero, which is "H:MM:SS.mmmmmm".
> 
> The corresponding co19 issue: https://github.com/dart-lang/co19/issues/733
> 
> Bug: https://github.com/dart-lang/sdk/issues/41737
> Change-Id: I2264171b2b37e89056695f7f821125a5f78d87fb
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151163
> Commit-Queue: Zichang Guo <zichangguo@google.com>
> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>

TBR=lrn@google.com,zichangguo@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: https://github.com/dart-lang/sdk/issues/41737
Change-Id: I4d7ef5de9807e8e2b2a77c2171d1693b7527f671
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151848
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2020-06-22 10:29:15 +00:00
Tess Strickland ed0eeaebca [vm/aot] Move precompiled position handling to CodeSourceMap classes.
Since CodeSourceMaps are not serialized when non-symbolic stack traces
are enabled, use a different CSM encoding in this mode. Here, we write
out the line number as before and then the column as a separately
written integer.

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm_x64-try
Change-Id: If9aec2f52551d04eb45626744957e625bcc17d3d
Bug: https://github.com/dart-lang/sdk/issues/42397
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151824
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2020-06-22 09:29:45 +00:00
Siva Annamalai d46a696957 Revert "Reland : [VM/Runtime] Cleanup package config initialization code"
This reverts commit 03777dba31.

Reason for revert: Failures in couple of bots

Original change's description:
> Reland : [VM/Runtime] Cleanup package config initialization code
> 
> - Use _Init function for initialization of package config
> - Remove DartUtils::SetWorkingDirectory, SingleArgDart_Invoke,
> 
>   DartUtils::SetupPackageConfig
> - Rename Loader::InitForSnapshot to Loader::Init
> - Remove _setPackagesConfig, _setWorkingDirectory from builtin library
> - Rename _setPackagesMap to _setPackagesConfig
> Change-Id: I1e4a25e79706d7764247c9fbfcc8e8ce3231343c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151633
> Reviewed-by: Alexander Aprelev <aam@google.com>
> Commit-Queue: Siva Annamalai <asiva@google.com>

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

Change-Id: Ibea8c35fe310ac7708f00bb9ffd58715b6924cb5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151869
Reviewed-by: Siva Annamalai <asiva@google.com>
Auto-Submit: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-06-20 08:02:53 +00:00
asiva 03777dba31 Reland : [VM/Runtime] Cleanup package config initialization code
- Use _Init function for initialization of package config
- Remove DartUtils::SetWorkingDirectory, SingleArgDart_Invoke,

  DartUtils::SetupPackageConfig
- Rename Loader::InitForSnapshot to Loader::Init
- Remove _setPackagesConfig, _setWorkingDirectory from builtin library
- Rename _setPackagesMap to _setPackagesConfig
Change-Id: I1e4a25e79706d7764247c9fbfcc8e8ce3231343c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151633
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-06-20 05:50:49 +00:00
asiva bbc8aedada [VM/Runtime] - Fix for issue https://github.com/dart-lang/sdk/issues/42421
Set global null safety flag based on the snapshot instead of trying to
detect it per isolate (was causing issues with the vm isolate loading).
Should fix https://github.com/dart-lang/sdk/issues/42421

Bug:42421
Change-Id: I9143560b76fedcb991e96522cbf5d820fde99f7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151866
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-06-20 04:18:59 +00:00
Zichang Guo 038e981f89 Fix duration.toString() to conform the description
Duration.toString() should return in a format of "HH:MM:SS.mmmmmm".
But when `hours` is less than 10, toString() doesn't have the leading
zero, which is "H:MM:SS.mmmmmm".

The corresponding co19 issue: https://github.com/dart-lang/co19/issues/733

Bug: https://github.com/dart-lang/sdk/issues/41737
Change-Id: I2264171b2b37e89056695f7f821125a5f78d87fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151163
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-06-19 22:52:30 +00:00
Filip Filmar 5d02a18d2f Revert "[vm] Replaces fuchsia.deprecatedtimezone"
This reverts commit 16f09f20b3.

Reason for revert: Trigger finger.  Shouldn't have been merged.

Original change's description:
> [vm] Replaces fuchsia.deprecatedtimezone
> 
> (prior attempt was rolled back as it caused downstream tests to time
> out.  See prior attempt at: See:
> https://dart-review.googlesource.com/c/sdk/+/149206)
> 
> The FIDL library fuchsia.deprecatedtimezone is going away.  There are
> different and better ways to obtain the same functionality.  This change
> removes the dependency on fuchsia.deprecatedtimezone from the Dart SDK.
> 
> Adds inspect metrics that allow whitebox testing of the runners.  Here's
> a sample `fx iquery` excerpt from a running device, showing both a dart
> and a flutter runner exposing the same OS diagnostic metrics.
> 
> ```
> /hub/c/dart_jit_runner.cmx/70981/out/diagnostics:
>   /hub/c/dart_jit_runner.cmx/70981/out/diagnostics#os:
>     dst_status = 0
>     get_profile_status = 0
>     timezone_content_status = 0
>     tz_data_close_status = 0
>     tz_data_status = 0
> /hub/c/flutter_jit_runner.cmx/29567/out/diagnostics:
>   /hub/c/flutter_jit_runner.cmx/29567/out/diagnostics#os:
>     dst_status = 0
>     get_profile_status = 0
>     timezone_content_status = 0
>     tz_data_close_status = 0
>     tz_data_status = 0
> ```
> 
> Under nominal operation, all of the above values should be equal to 0.
> Nonzero values indicate an error.
> 
> This functionality is guarded by Fuchsia integration tests at
> //src/tests/intl.
> 
> Tested:
>   (compile locally for Fuchsia and deploy)
>   fx test //src/tests/intl
> 
> See:
>   - https://github.com/dart-lang/sdk/issues/42245
>   - https://github.com/dart-lang/sdk/issues/39650
> 
> Fixes #39650
> 
> Change-Id: I97f6e17e57000f6eec71246aee670bca65b7e1d1
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150662
> Commit-Queue: Filip Filmar <fmil@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

TBR=kustermann@google.com,kaushikiska@google.com,fmil@google.com

Change-Id: I7e3f8b9724e30653ca5fccaf912e940edcbcf974
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151861
Reviewed-by: Filip Filmar <fmil@google.com>
Commit-Queue: Filip Filmar <fmil@google.com>
2020-06-19 19:21:15 +00:00
Filip Filmar 16f09f20b3 [vm] Replaces fuchsia.deprecatedtimezone
(prior attempt was rolled back as it caused downstream tests to time
out.  See prior attempt at: See:
https://dart-review.googlesource.com/c/sdk/+/149206)

The FIDL library fuchsia.deprecatedtimezone is going away.  There are
different and better ways to obtain the same functionality.  This change
removes the dependency on fuchsia.deprecatedtimezone from the Dart SDK.

Adds inspect metrics that allow whitebox testing of the runners.  Here's
a sample `fx iquery` excerpt from a running device, showing both a dart
and a flutter runner exposing the same OS diagnostic metrics.

```
/hub/c/dart_jit_runner.cmx/70981/out/diagnostics:
  /hub/c/dart_jit_runner.cmx/70981/out/diagnostics#os:
    dst_status = 0
    get_profile_status = 0
    timezone_content_status = 0
    tz_data_close_status = 0
    tz_data_status = 0
/hub/c/flutter_jit_runner.cmx/29567/out/diagnostics:
  /hub/c/flutter_jit_runner.cmx/29567/out/diagnostics#os:
    dst_status = 0
    get_profile_status = 0
    timezone_content_status = 0
    tz_data_close_status = 0
    tz_data_status = 0
```

Under nominal operation, all of the above values should be equal to 0.
Nonzero values indicate an error.

This functionality is guarded by Fuchsia integration tests at
//src/tests/intl.

Tested:
  (compile locally for Fuchsia and deploy)
  fx test //src/tests/intl

See:
  - https://github.com/dart-lang/sdk/issues/42245
  - https://github.com/dart-lang/sdk/issues/39650

Fixes #39650

Change-Id: I97f6e17e57000f6eec71246aee670bca65b7e1d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150662
Commit-Queue: Filip Filmar <fmil@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-06-19 19:15:03 +00:00
Alexander Aprelev 94fcf226fc [vm/sigprof] Disable checking of sigprof on mac.
Fixes https://github.com/dart-lang/sdk/issues/41239

Change-Id: I397f70c7d9977bbf8ce33ce649c7d82e02fd26a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151880
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2020-06-19 18:42:33 +00:00
Alexander Markov 48fbdf8408 [vm/compiler] Fix vm/cc/Inliner_List_generate on simarm and dartkb
Fixes https://github.com/dart-lang/sdk/issues/42402

Change-Id: Id0403c1974d71f21f6f5dcfad8ffebe4f41f2e91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151782
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-06-19 16:02:43 +00:00
Tess Strickland 3e40abbc09 [vm/aot] Reland "Keep column information when possible for precompiled mode."
Changes:

Doing this always in precompiled mode meant increased data segment sizes
when CodeSourceMaps are stored, since encoded line/column information is
larger in the LEB-like encoding used. Now we only store column
information when we produce non-symbolic stacks, since the increased
space needed to store the columns is instead in DWARF sections and can
be stripped or elided.

Original description:

Previously, we passed line number information to the stack trace printer
and to DWARF by changing the non-special positions in the CodeSourceMap
to line numbers in precompiled mode. However, doing this lost column
information.

We get the column information back in the majority of cases by encoding
the line number and column information when neither is too large to pack
together into 30 bits. (Here, 20 bits for line and 10 bits for column.)
Otherwise, we just store the line information as before, though due to
using a bit to encode whether column info exists, it's reduced to 30
bits. If the line info is too big for that, we just return kNoSourcePos.

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm_x64-try
Change-Id: Ia8baee71468da6100a170fa305d03059ffd17f78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151822
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-06-19 13:50:03 +00:00
Alexander Markov 7bbf2921db [vm/nnbd] Non-null assertions in NNBD weak mode
Fixes https://github.com/dart-lang/sdk/issues/42357

Change-Id: I07341ba02361201ec2130fb7b6cb87a25b9b5f51
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151662
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-06-18 20:02:42 +00:00
Martin Kustermann db8a105de7 Revert "[vm/aot] Keep column information when possible for precompiled mode."
This reverts commit 7c34a80c11.

Reason for revert: This change seems to cause >2% code size regression
in flutter-release mode.

Original change's description:
> [vm/aot] Keep column information when possible for precompiled mode.
> 
> Previously, we passed line number information to the stack trace printer
> and to DWARF by changing the non-special positions in the CodeSourceMap
> to line numbers in precompiled mode. However, doing this lost column
> information.
> 
> We get the column information back in the majority of cases by encoding
> the line number and column information when neither is too large to pack
> together into 30 bits. (Here, 20 bits for line and 10 bits for column.)
> Otherwise, we just store the line information as before, though due to
> using a bit to encode whether column info exists, it's reduced to 30
> bits. If the line info is too big for that, we just return kNoSourcePos.
> 
> Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm_x64-try
> Change-Id: Id1c826f10871e2f304fa40a59d8b704404d3a2c9
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151507
> Commit-Queue: Tess Strickland <sstrickl@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

TBR=rmacnak@google.com,alexmarkov@google.com,sstrickl@google.com

Change-Id: I5cf97543d1ac2731bb27bdb58ae97af6f22f2cfb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-nnbd-linux-release-x64-try, vm-kernel-precomp-linux-release-x64-try, vm-kernel-precomp-linux-product-x64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-release-simarm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151820
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-06-18 19:57:44 +00:00
Johnni Winther 87f74cbba9 [cfe] Check optional non-nullable parameters in constructors
Closes #42203
Closes #42362
Closes #42352

Change-Id: Ida8a41252ec524ba5c2eaa697fa61e3514897bef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151500
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-06-18 18:07:06 +00:00
Alexander Markov 411272691c [vm/compiler] Add extra call specialization pass during inlining
After constant propagation is performed on the callee function body
during inlining, there are extra opportunities for specializing
calls. Unspecialized calls are not inlined, so it is important to
specialize those calls during inlining to open further opportunities
for inlining.

With this extra pass inliner is able to inline get:length after
specializing inlined List.generate constructor, and eliminate
bounds check from the initialization loop.

This change improves micro-benchmark creating 100,000 lists using

      List<int>.generate(1000, (int x) => x, growable: false);

in AOT mode on x64 from 308ms to 167ms.

This makes it on par with pre-NNBD fixed-size list initialization:

  var result = List<int>(1000);
  for (var i = 0; i < 1000; i++) {
    result[i] = i;
  }

In fact, after all optimizations final flow graph (and generated
code) for List.generate and explicit loop become very similar.

This change has no effect on Flutter gallery size in release mode.

Issue: https://github.com/dart-lang/sdk/issues/42283
Change-Id: I3566386608733226e1c11cb5d6892cd869e564d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151466
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-06-18 15:46:40 +00:00
Vyacheslav Egorov b43714854e [vm] Allow Isolate.spawnUri to spawn from app-jit snapshots
R=kustermann@google.com

Cq-Include-Trybots: luci.dart.try:vm-kernel-win-release-x64-try,vm-kernel-mac-release-x64-try
Change-Id: I75aedf02f3b4004b191175672f652b0cce6cf47b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151508
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-06-18 12:59:33 +00:00
Vyacheslav Egorov 2c922ba59c [vm/regexp] Cache regexp backtracing stack across regexp invocations.
It seems that execution time of simple regexps on short strings is purely
dominated by the cost of creating a backtracking stack itself.

The stack is purged on major GC to prevent just keeping 256KB of memory
around.

On my Linux machine I see 5x improvement on benchmark from
https://github.com/dart-lang/sdk/issues/42366

On RegExp benchmark I see around 13x improvement in performance
on the same Linux workstation:

Before RegExp(RunTime): 17863744.009 us.
After  RegExp(RunTime):  1301678.797 us.

Change-Id: Ib5845ab8bd84941c8a4d96ffe42740b5215e3c47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151515
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-06-18 11:14:13 +00:00
linzj 54481776c9 Fix redundant comparison for InstantiateTypeArgumentsInstr.
Fixes #42389.

R=vegorov@google.com

Change-Id: Iba187e191ee2115d03d3846b58b0955581839d7b
Bug: https://github.com/dart-lang/sdk/issues/42389
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151680
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-06-18 11:08:03 +00:00
Tess Strickland 7c34a80c11 [vm/aot] Keep column information when possible for precompiled mode.
Previously, we passed line number information to the stack trace printer
and to DWARF by changing the non-special positions in the CodeSourceMap
to line numbers in precompiled mode. However, doing this lost column
information.

We get the column information back in the majority of cases by encoding
the line number and column information when neither is too large to pack
together into 30 bits. (Here, 20 bits for line and 10 bits for column.)
Otherwise, we just store the line information as before, though due to
using a bit to encode whether column info exists, it's reduced to 30
bits. If the line info is too big for that, we just return kNoSourcePos.

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm_x64-try
Change-Id: Id1c826f10871e2f304fa40a59d8b704404d3a2c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151507
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-06-18 10:45:33 +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
Vyacheslav Egorov 572aa45c21 [vm/snapshot] Name Code and Function objects in V8 snapshot profiles
Issue https://github.com/dart-lang/sdk/issues/41249

Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-try,pkg-win-release-try,pkg-mac-release-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-x64-try
Change-Id: Idd7644714884e4ea1461718285c1b01f12d811e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151225
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-06-17 20:57:01 +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
Vyacheslav Egorov 025d256658 Remove divisive terms
Based on guidance in https://developers.google.com/style/

Related to https://github.com/dart-lang/sdk/issues/42247

Change-Id: Iaf37f3372b2b5882738cfa63339dd7b032cdbba9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150630
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-06-17 14:01:54 +00:00
Tess Strickland c45c07592a [vm] Test disassembly in v8_snapshot_profile_writer_test separately.
Disassembling on every run makes it difficult to get an idea of which
specific configuration failed. Instead, just pick a configuration that
already succeeded and test that configuration with disassembly
separately so that it's clear if the disassembly was what caused the
failure.

Also add reasons to Expect.isTrue/isFalse uses in
package:vm/v8_snapshot_profile.dart. Now we don't have to track down the
specific line to find out what failed when reading logs. Another benefit
is that the error message now includes the values involved in the
failure and not just "Expect.isTrue(false)" or "Expect.isFalse(true)".

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm_x64-try
Change-Id: I3d4b533f4df041dfcced4eaeb8bc5729dfad0b82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151502
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2020-06-17 11:11:43 +00:00
asiva 4b9aa2bd7e Revert "[VM/Runtime] Cleanup package config initialization code"
This reverts commit 29e93bcdbd.

Reason for revert: Windows bots are failing with package resolution
errors. Looks like we are missing a windows path sanitization step.

Change-Id: Ib56f7e926b4f385fa3fde74c9c71947f64b8be1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151469
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-06-17 00:03:19 +00:00
Leaf Petersen d44457f79d [Core Libraries] Eliminate the fork in the core libraries.
Move the nnbd core libraries from sdk_nnbd to sdk, and updates
references in build files and elsewhere accordingly.

Change-Id: I09760fe1e006657aacdfe80f3b22fdf6f7e30a9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151121
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-06-16 23:37:36 +00:00
asiva 29e93bcdbd [VM/Runtime] Cleanup package config initialization code
- Use _Init function for initialization of package config
- Remove DartUtils::SetWorkingDirectory, SingleArgDart_Invoke,
  DartUtils::SetupPackageConfig
- Rename Loader::InitForSnapshot to Loader::Init
- Remove _setPackagesConfig, _setWorkingDirectory from builtin library
- Rename _setPackagesMap to _setPackagesConfig
Change-Id: I0b83574593fa95e1b948134fcd4a7b4858ea19c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151045
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2020-06-16 23:24:26 +00:00
Ryan Macnak 62893f9b00 Reland "[vm] Check prefix.loadLibrary is called and returns before prefix members are used."
This reverts commit 9a87cf9174.

Reason for revert: Broken test disabled

Original change's description:
> Revert "[vm] Check prefix.loadLibrary is called and returns before prefix members are used."
> 
> This reverts commit b0484ecbde.
> 
> Reason for revert: timeouts on Flutter integration tests
> (https://github.com/dart-lang/sdk/issues/42350).
> 
> Original change's description:
> > [vm] Check prefix.loadLibrary is called and returns before prefix members are used.
> > 
> > Restore checks against reloading a library with deferred prefixes.
> > 
> > No loading is actually deferred.
> > 
> > Bug: https://github.com/dart-lang/sdk/issues/26878
> > Bug: https://github.com/dart-lang/sdk/issues/41974
> > Change-Id: Iec2662de117453d596cca28dd9481a9751091ce9
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149613
> > Commit-Queue: Ryan Macnak <rmacnak@google.com>
> > Reviewed-by: Alexander Markov <alexmarkov@google.com>
> > Reviewed-by: Siva Annamalai <asiva@google.com>
> 
> TBR=rmacnak@google.com,alexmarkov@google.com,asiva@google.com
> 
> # Not skipping CQ checks because original CL landed > 1 day ago.
> 
> Bug: https://github.com/dart-lang/sdk/issues/26878, https://github.com/dart-lang/sdk/issues/41974
> Change-Id: I78709650e91d206b84a8ddd9171ef66d6cf1b008
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151169
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
> Commit-Queue: Alexander Markov <alexmarkov@google.com>

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

# Not skipping CQ checks because this is a reland.

Bug: https://github.com/dart-lang/sdk/issues/26878, https://github.com/dart-lang/sdk/issues/41974
Change-Id: Ife76bd51db65ca58e08655a9b8406c8ca483447f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151326
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-06-16 21:11:40 +00:00
Tess Strickland 6f83a5ff9b [vm/aot] Add a GNU build ID to direct-to-ELF snapshots.
For proper crashpad integration, we need to generate a build ID, as the
build ID generated by crashpad if there is not one will be a simple XOR
of the first text page, which rarely changes for Dart snapshots.
Assembly snapshots already have a build ID included by the assembler, so
we currently only do this for ELF snapshots.

Currently the build ID is a 128-bit hash value that is four separate
32-bit hash values concatenated together. Those hash values come from
the contents of the VM and isolate .text and .rodata sections.

This change also contains work to separate out the concepts of sections
and segments in the ELF builder. Now, consecutive allocated sections
with the same write and execute flags are combined into a single PT_LOAD
segment when possible, which reduces the padding needed to ensure that
segments start on page boundaries in ELF snapshots.

Bug: https://github.com/dart-lang/sdk/issues/42020
Change-Id: I42a837dae665a3902d881b8d151b49ede87d6c67
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150625
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-06-16 12:46:24 +00:00
Tess Strickland 2e939f215a [vm/aot] Move ELF section manipulation out of CreateAppAOTSnapshotAsElf.
Instead, we just always add a BSS section and we add the ROData
sections for ELF snapshots in BlobImageWriter::WriteText() (similar
to how AssemblyImageWriter::WriteText() handles it for assembly).

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm_x64-try
Change-Id: I87ce64037821ce10f2344964e7f379376c4538df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150937
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-06-16 12:46:24 +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
Vyacheslav Egorov 967deb8db4 Revert "[vm, timeline] Fix compilation failed below macOS 10.14"
This reverts commit 156ef76535.

Reason for revert: broke compilation on buildbots

Original change's description:
> [vm, timeline] Fix compilation failed below macOS 10.14
> 
> signpost.h exists in macOS 10.14 or above, so compilation failed below macOS 10.14
> 
> Change-Id: I97c4d6652f8330d3fc150186e41067c80c3b56f2
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151101
> Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>

TBR=vegorov@google.com,3630cn@sina.com

Change-Id: I04cd72a0c16a9e1d32d1735abf0fe42d35d240e1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151380
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2020-06-16 07:53:36 +00:00
pangzhen 156ef76535 [vm, timeline] Fix compilation failed below macOS 10.14
signpost.h exists in macOS 10.14 or above, so compilation failed below macOS 10.14

Change-Id: I97c4d6652f8330d3fc150186e41067c80c3b56f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151101
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-06-16 07:15:31 +00:00
pq c68c06996a prefer “exclude” language for excluded entities
See for example:

* https://9to5google.com/2020/06/12/google-android-chrome-blacklist-blocklist-more-inclusive/
* https://thenextweb.com/dd/2020/06/15/github-plans-to-replace-racially-insensitive-terms-like-master-and-whitelist/

Change-Id: Id40e8b20f8dcab6db291159c33db5197aedf9fae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151304
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-06-16 05:12:16 +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
Alexander Markov badc77239a [vm/aot] Avoid unbinding canonical names in AOT transformations
AOT transformations (mixin deduplication and TFA tree shaker) were
using CanonicalName.unbind() in order to make sure that kernel
writer will not be able to write dangling references to the deleted
classes or members (to detect such dangling references earlier).

This conflicts with lazy reading from a kernel file if --from-dill
option is used: lazy reader may read a reference to such class after
unbind() and it creates a new Reference object for such canonical name.
This causes crash later when the fresh Reference is used as it doesn't
have Class node filled in.

The solution is to avoid calling CanonicalName.unbind().
Instead, it is enough to nullify node.reference.canonicalName, which
won't break CanonicalName.reference used by lazy reader.

This crash can be reproduced on tests/language_2/vm/regress_flutter_55345_test.dart
if it is compiled in AOT mode using 2-step kernel generation.

Bug: b/158853113
Change-Id: Ib2004dbbbda85d9f56adc56b48882f4ef08869a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151120
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-06-15 22:00:42 +00:00
Alexander Aprelev 48f20c64c6 [vm/benchmark] Fix metric type of GenKernelKernelMaxRSS benchmark
Change-Id: Id7d0cdea5536752217968e235d065ce9b0140443
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151307
Auto-Submit: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-06-15 20:10:16 +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
Alexander Markov 9a87cf9174 Revert "[vm] Check prefix.loadLibrary is called and returns before prefix members are used."
This reverts commit b0484ecbde.

Reason for revert: timeouts on Flutter integration tests
(https://github.com/dart-lang/sdk/issues/42350).

Original change's description:
> [vm] Check prefix.loadLibrary is called and returns before prefix members are used.
> 
> Restore checks against reloading a library with deferred prefixes.
> 
> No loading is actually deferred.
> 
> Bug: https://github.com/dart-lang/sdk/issues/26878
> Bug: https://github.com/dart-lang/sdk/issues/41974
> Change-Id: Iec2662de117453d596cca28dd9481a9751091ce9
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149613
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

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

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: https://github.com/dart-lang/sdk/issues/26878, https://github.com/dart-lang/sdk/issues/41974
Change-Id: I78709650e91d206b84a8ddd9171ef66d6cf1b008
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151169
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-06-15 19:35:06 +00:00
pq 5619ec500e prefer “exclude” language for excluded entities
See for example:

* https://9to5google.com/2020/06/12/google-android-chrome-blacklist-blocklist-more-inclusive/
* https://thenextweb.com/dd/2020/06/15/github-plans-to-replace-racially-insensitive-terms-like-master-and-whitelist/


Change-Id: I51fe56bb7a09c5cc3280119e2c121aac86e44f8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151303
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-06-15 18:48:06 +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
Aske Simon Christensen 755686e5b2 [vm] Simplify RemoveRedefinitions.
Instead of having identical cases for every instruction that implements
RedefinedValue, just have one generic piece of code.

Change-Id: If3f4905a578eb345ae3d740d1f539d346c6223af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150985
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2020-06-15 08:59:35 +00:00
Alexander Aprelev 89fc3e1269 [vm/switchable_call] Refactor SwitchableCallHandler so that resolution is done outside of RunWithStoppedMutators.
The only exception is DoMonomorphicMiss which still resolves "old_target" inside RunWithStoppedMutators.

Bug: https://github.com/dart-lang/sdk/issues/36097

Change-Id: I5a199113d8ff3cc9064860b8e385f65642bd740c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150200
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-06-12 22:00:02 +00:00
Tess Strickland fc1ecdae0d [vm] Fix extra output in assembly DWARF.
Bug: b/158791706
Change-Id: I01289f330242de0216833f3d58c67168b044354f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150986
Auto-Submit: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-06-12 15:05:35 +00:00
Aske Simon Christensen 99bd9d7db5 [vm, gardening] Initialize target array in movs tests to satisfy msan.
Fixes https://github.com/dart-lang/sdk/issues/42289

Change-Id: I13630b44d0c5bf5ec51256fb1fac41f812dd3e7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150984
Auto-Submit: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-06-12 12:03:02 +00:00
Tess Strickland e160698933 [vm/aot] Delay relocated address calculation for static symbols.
Since we no longer add the symbol for a given code object to the Elf
object when writing the contents of the text segment, we don't need to
calculate the relocated address that early. Instead, just store which
text segment the instructions payload belongs to as well as its offset
into the segment contents and let Elf::Finalize() calculate the
relocated address when creating the symbol.

This removes one need for knowing the segment base address when writing
the segment contents. The remaining needs are related to BSS usage:

* Calculating the BSS offset from the text segment for the Image header.
* Fixing up BSS relocations in instructions payloads.

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm_x64-try
Change-Id: I8be860a7a7111721e6f546154a0814f4d16ac634
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150929
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2020-06-12 11:34:02 +00:00