Commit graph

79564 commits

Author SHA1 Message Date
Jens Johansen dce296cc36 [VM] Fix nullptr check in DFE
TEST=all tests running from file and none (to my knowledge) testing
the failure case as that's going to be a weird timing issue.

Change-Id: I997515587e86b324880fdd9fe11e86343e8bb973
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199423
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-05-12 14:01:30 +00:00
Lasse R.H. Nielsen a5e18113f3 Remove references to triple-shift and generic-metadata experiments.
TEST= removed flags from test. No behavior should change.

Change-Id: I401bfb68c082d1bd405a118d5eca6a47a807945f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199241
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2021-05-12 13:35:00 +00:00
Alexander Thomas 14b8faf09c [release] Add release date for 2.13.0
Change-Id: I3d53bb328bc4b17695cfa9f004b0349b21a1aa30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199424
Reviewed-by: William Hesse <whesse@google.com>
2021-05-12 11:23:13 +00:00
Alexander Aprelev c395e5fe54 [vm/ssl] Reenable client certificate tests.
Fixes https://github.com/dart-lang/sdk/issues/26057

Change-Id: I172f7b8221f34d2bd16df324d96ad7a6ec88d54d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199301
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-05-12 10:01:30 +00:00
Daco Harkes 3b9bd26f3e [vm/ffi] Union transform fix offsets
TEST=tests/ffi/regress_45988_test.dart

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

Change-Id: Ie8bf76bb2cc1781a4b59e508d0e5f2ada85d22a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199422
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-05-12 09:50:00 +00:00
Martin Kustermann 535b53659b [vm/compiler] Remove dangerous FlowGraphCompiler::GenerateRuntimeCall
Doing any runtime call inside an `<XXX>Instr::EmitNativeCode()` is dangerous
because doing so almost always would require adjusting the lazy-deopt
environment to ensure the continuation in unoptimized code would have
the right stack state when returning from a runtime call.

=> Going to runtime should almost always happen via a stub call.

To discourage using runtime calls inside `EmitNativeCode()` functions we
remove the `FlowGraphCompiler::GenerateRuntimeCall()` helper method.

The remaining runtime calls used in `EmitNativeCode()`s fall into three
categories:

  * StackOverFlowInstr: In this particular case the deopt environment
    wouldn't need to be modified.
  * leaf runtime calls: Those do not need any metadata (neither deopt
    nor stackmaps) - since leaf runtime entries cannot safepoint
  * unopt-only runtime calls: Those do not need any metadata (neither
    deopt nor stackmaps) - since all slots in unoptimized frames are
    GC-able and unoptimized frames cannot be lazy-deoptimized.

We add assertions for the latter to cases with a comment to make it
clear.

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

TEST=Only adds assertions.

Change-Id: Idb8badfbe65fff55585959338129405c71908d25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199042
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-05-12 09:14:50 +00:00
Martin Kustermann 64cf9574e2 [vm] Use AbstractType instead of Type when disassembling exception handler types
Issue https://github.com/dart-lang/sdk/issues/45982

TEST=Existing test suite.

Change-Id: I87b2d41ff123a871bc1c736ca2b3c442b12aa824
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199246
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2021-05-12 08:18:08 +00:00
Martin Kustermann bdcb07c85f [vm/concurrency] Speed up debug runs of isolate tests
Running isolates tests in debug mode is currently very slow due to heap
verification and related code on isolate startup & shutdown.

This CL limits those verifications to only run on the first isolate of
an isolate group.

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

TEST=Existing test suite.

Change-Id: I1f329bca9e4c1d56ab60f36ffa8b9cc037b818f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199249
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-05-12 07:55:38 +00:00
Tess Strickland c0f6b37d17 [vm] Store compression info during GC visit macros.
-----

Adds a few type traits for operating on (Compressed)ObjectPtr types:

* is_compressed_ptr<T>::value is true for compressed pointer types and
  false for uncompressed pointer types.
* is_uncompressed_ptr<T>::value is false for compressed pointer types
  and true for uncompressed pointer types.
* base_ptr_type<T>::type is ObjectPtr for uncompressed pointer types and
  CompressedObjectPtr for compressed pointer types.

Note: If DART_COMPRESSED_POINTERS is not enabled, all pointers are
uncompressed and the above traits function accordingly. That means
that is_compressed_ptr<T>::value is always false,
is_uncompressed_ptr<T>::value is true for all object pointers, and
base_ptr_type<T>::type is ObjectPtr for all object pointers, even if
they contain Compressed in the name.

-----

The following changes have been made to the VISIT_* macros:

* VISIT_NOTHING: no change.
* VISIT_FROM: takes only a field name now, and retrieves the type of
  the field to determine which base pointer type to use for from().
  Note that VISIT_FROM must now come _after_ the declaration of the
  field, since it retrieves the type from the declaration.
* VISIT_TO: takes only a field name now, and retrieves the type of the
  field to determine which base pointer type to use for to().
* (removed) VISIT_TO_LENGTH: Instead, VISIT_TO creates a to() method
  that takes an optional length argument (defaults to 0).
* (new) VISIT_FROM_PAYLOAD_START: takes the object pointer type of the
  payload elements and creates a from() that returns the beginning
  element of the payload. Note that a payload element must be a single
  object ptr to use this macro.
* (new) VISIT_TO_PAYLOAD_END: takes the object pointer type of the
  payload elements and creates a to() which takes a non-optional length
  argument and returns the last element of the payload.  Note that a
  payload element must be a single object ptr to use this macro.

If one of the {COMPRESSED_,}VARIABLE_POINTER_FIELDS macros are used,
then VISIT_TO_PAYLOAD_END should not be, as those macros already
include a use of it.

-----

In addition, each Untagged<Class> class now has a static constexpr bool
field kContainsCompressedPointers. This field is false for
UntaggedObject, and for other Untagged<Class> classes, it is either
inherited from the parent class or set during VISIT_FROM and the new
VISIT_FROM_PAYLOAD_START macro.

VISIT_TO and the new VISIT_TO_PAYLOAD_END macro double-check at compile
time that the type retrieved or provided is a compressed type if
kContainsCompressedPointers is true, and uncompressed if false.

If the elements of a payload are not object pointers, but rather
a composite object that contains object pointers, then
VISIT_FROM_PAYLOAD_START/VISIT_TO_PAYLOAD_END cannot be used. Instead,
use DEFINE_COMPRESSED_POINTERS(type), where type is the type of one of
the object pointers in the composite object, to appropriately define
kContainsCompressedPointers.

Note that this field will always be false when DART_COMPRESSED_POINTERS
is not defined.

-----

For classes, a static constexpr ContainsCompressedPointers() predicate
is created, based on the associated untagged class's field.

For instances of Class, there is an instance predicate
Class::HasCompressedPointers() that returns whether instances of a given
class object contain compressed pointers.

Change all calls to InitializeObject and Object::Allocate to pass in
the result of the appropriate predicate.

TEST=Refactoring, so current tests on CI, especially on x64c trybots.

Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-x64c-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-linux-debug-x64-try
Change-Id: Ifb61f72885bd8b951167becbccf8ec3337a922b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196931
Reviewed-by: Liam Appelbe <liama@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2021-05-12 07:36:58 +00:00
Konstantin Shcheglov 47e2acd130 Stop using linked nodes for Export/ImportElementImpl.
Change-Id: I45dd3e413dc1d1e611885293cdebdfb40bf35f7b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199367
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-05-12 06:16:48 +00:00
Konstantin Shcheglov 6f4a6360a0 Issue 45983. Don't catch and ignore exceptions during parsing.
Bug: https://github.com/dart-lang/sdk/issues/45983
Change-Id: Ib1caeb96d03e9cd3000f0005077fa6a7dbdff621
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199369
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-05-12 06:11:18 +00:00
Konstantin Shcheglov 62d0d5ff4d Deprecate AnalysisDriver default constructor.
Change-Id: I9b87cc720b5e3731499302737fcaedcb229f6199
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199371
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-05-12 05:35:58 +00:00
pq 9f27edfab1 time lint registry (for benchmarking)
Change-Id: I92acdd06bac04ce9879cb971a2c98c27749aa4a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199372
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2021-05-12 04:33:58 +00:00
Ryan Macnak a22d5b98fd Reapply "[build] Track glob dependencies via depfiles, instead of always re-executing scripts at GN time."
Use a relative path for the depfile's target to match Ninja's expectation; otherwise it thinks the target is always dirty.

TEST=build twice
Bug: https://github.com/flutter/flutter/issues/81074
Change-Id: I4cae7ab55f79b5206521c7090502c0769d2b5277
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198443
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-05-12 00:27:28 +00:00
Ryan Macnak 634cccccc6 [vm, gc] Verify remembered cards when verifying the store buffer.
TEST=ci
Change-Id: I004a55902c65d89915ea79c141270a2c2670e53c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199363
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-05-11 23:56:08 +00:00
Konstantin Shcheglov 3a3b3e480b Remove support for FileContentOverlay from ContextBuilder.
Change-Id: I23b9481ac6a841675e401579ff60bfb383865f8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199361
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-05-11 23:17:08 +00:00
Vyacheslav Egorov 20526d4368 [vm/aot] Scan deferred pools for code entries
When generating snapshot with loading units trace
deferred pools for code objects as well - otherwise
we might miss code references from one deferred
unit to another unit (e.g. if the only remaining
reference to some code object in the root unit is
actually from a deferred unit).

Fixes a bunch of issues with deferred libraries (Crash -> Pass):

- language_2/deferred/split_constants_canonicalization_test/1
- vm/dart_2/deferred_isolate_test
- vm/dart_2/deferred_loading_and_weak_serialization_references_test/0
- vm/dart_2/deferred_loading_and_weak_serialization_references_test/1
- vm/dart_2/deferred_loading_call_modes_test/2

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

TEST=ci

Fixed: 45917
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-simarm-try
Change-Id: Iccd3efcab6a5396d4b6f70968d9176ff18d7147c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198405
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2021-05-11 23:08:18 +00:00
Sigmund Cherem 460887d814 [web] Replace DDC's expando implementation
DDC now uses WeakMaps, just like dart2js. This ensures that expandos
will also continue to work properly after a hot restart.

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

Change-Id: I89799b4da9cb7827500a14dcdc2aff7c5e6afa03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199222
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2021-05-11 22:14:28 +00:00
Sigmund Cherem 3a0c27b74c [ddc] Add a regression test for issue #45874
Expandos collide after a hot restart. This currently fails because
the DDC implementation uses a static field (_keyCounter) to compute a
unique name for each expando. After a hot-restart the counter gets reset
and keys get reused accidentally.

A hacky fix would be to ensure this field is not reset after restarts,
but a more robust fix would be to use a weak map implementation like
dart2js does.

Change-Id: I991874aabf836be66cbd44de07dd38e681415ae7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199221
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2021-05-11 22:14:28 +00:00
Sigmund Cherem 7a18ef405e [web] Cleanup dart2js implementation of expandos.
This removes the feature detection of WeakMaps and no longer uses a raw
field to implement an expando. This is because WeakMaps are supported in
all browsers we currently support, and are also supported in IE11.

Change-Id: Ia0bc8261a3eb3dd4fad8cba5d0a2abecd1d3ecc0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199220
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2021-05-11 22:14:28 +00:00
Regis Crelier fe12e366b0 [vm/runtime] Support tracing of subtype checks in runtime.
TEST=for debugging only

Change-Id: I9780e0374750b044613a654043342925eb904a17
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199362
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2021-05-11 21:48:34 +00:00
Konstantin Shcheglov 9049b0a3de Remove support for serializing some AST nodes.
Change-Id: I1f49400967e86fa4ddd09a67fc9e3c8bdac214ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199360
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-05-11 21:44:14 +00:00
Sam Rawlins 507fe6216a Remove unnecessary imports in front_end
Change-Id: Iad1c41ae9ef2b379a0bed3899fef8cef118727c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199223
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-05-11 21:15:24 +00:00
Konstantin Shcheglov a3a05c66b9 Replace inConstContextWithoutParent Expando with ConstantContextForExpressionImpl.
Change-Id: I1ad9e3759a0ed04a3e1a188506c6aa4394dde7c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199163
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-05-11 21:14:44 +00:00
Konstantin Shcheglov 12b68d6c87 Remove ContentCache.
Change-Id: I2cec74046d3257a7b9fa6fa01b97b3d22fc2e4d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199162
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-05-11 20:14:24 +00:00
Gary Roumanis 3c9e595ffa Update sse tag
Change-Id: I3939d95348c7a91a6e8e675f3bcb4d587056d4d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199340
Auto-Submit: Gary Roumanis <grouma@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2021-05-11 19:46:25 +00:00
Sam Rawlins e5ace6f7c1 analysis_server: Remove unnecessary imports
Change-Id: Icdf45541df9707631c9add908abd365e3bbd0c2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199321
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-05-11 19:09:44 +00:00
Konstantin Shcheglov ad895e20d2 Get workspace from AnalysisSession in AbstractLinterContextTest.
R=brianwilkerson@google.com, pquitslund@google.com

Change-Id: I46eb8b0cd0193f048e95d921bd555dd22132d271
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199322
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-05-11 18:50:15 +00:00
Alexander Markov da4ff4e9a6 [vm/aot] Fix handling of annotations in tree shaker
Previously, annotations were not traced by global type flow analysis
(in order to avoid retaining classes which are only used in
annotations). Annotations were only traced during tree shaking
and references from such constants were treated much like
references from types. This handling of constants in annotations
conflicts with removal of fields, as tree shaker needs to know
which fields are retained upfront to be independent of the visiting
order. In a certain corner case (field was replaced with a getter
but was still used in a constant in annotation) that caused incorrect
AST and crash during serialization of AST.

In order to fix that, this change adds proper tracing through
annotations on members, classes and libraries, as if annotation
constants were used in the executable code. That also means
that annotation classes will be retained as allocated.
In order to compensate for that, a new pass is added before the global
analysis to clean all annotations except @ExternalName, @pragma
(used by the VM) and @TagNumber (used by protobuf tree shaking).

TEST=runtime/tests/vm/dart/regress_45968_test.dart
Fixes https://github.com/dart-lang/sdk/issues/45968

Change-Id: I998e4f7ec7da7b74e1738fc21b354a4ec9f0c071
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199200
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-05-11 18:25:24 +00:00
Ben Konyi 33aa207efd fix: Context parse error, parent should be ContextRef
Bug: https://github.com/dart-lang/sdk/issues/45083
TEST=N/A
Change-Id: I1781c83ac2e8868f1d6a49fc4a01edd3e3eef460
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192880
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-05-11 17:59:54 +00:00
Ben Konyi b99466d472 Reland "[ VM / DDS / CLI ] Add DevTools support to the standalone VM"
This reverts commit 5cbf10febe.

TEST=pkg/dds/devtools_observatory_connection_test.dart

Change-Id: I682d009f784b930094dae9b7d4e9a66efffb6ee8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198561
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-05-11 17:55:26 +00:00
Brian Wilkerson 6c1e344e3a Regenerate the diagnostic comments after a recent change
There is a test to catch the need to regnerate, but it appears to not be
running on the bots. We should find out why and fix that.

Change-Id: I4cc245933d68cc399ed33613acb4047303a3ef8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199304
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-05-11 16:57:54 +00:00
Tess Strickland fd31aa3f33 [vm] Move function stores into the AllocateClosure stub.
Now AllocateClosureInstr takes the closure function as a Value* instead
of as a const Function&, a new kFunctionReg is added to
AllocateClosureABI, and the AllocateClosure stub sets the closure
function internally instead of initializing it to null and requiring it
to be set post-allocation.

A convenience method known_function() is added to AllocateClosureInstr
which returns either the closure function, if known at compile time,
or null otherwise.

TEST=More refactorings, so just passing current tests.

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-simarm64c-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-linux-debug-ia32-try,vm-kernel-linux-debug-x64-try,vm-kernel-linux-product-x64-try,vm-kernel-linux-release-simarm64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-x64-try,vm-kernel-linux-debug-x64c-try
Change-Id: If843b401e0f282b191dd60b1c6c73c01f1d5bc70
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198285
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-05-11 16:54:14 +00:00
Tess Strickland 9a9e854515 [vm/tests] Make concurrency_stress_sanity_test trivially pass in AOT.
TEST=vm/dart{_,2}/isolates/concurrency_stress_sanity_test on ReleaseX64 trybots

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-nnbd-linux-release-x64-try,vm-kernel-linux-release-x64-try
Change-Id: I1aed2fdfbb30c5f063ab48d606d47482beab8210
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199243
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-05-11 14:07:04 +00:00
Tess Strickland 02a8dd90e1 [vm] Add a bare-bones AllocateClosure stub.
Also create a subclass of AllocationInstr, AllocateClosureInstr,
which is used when allocating closures.

Followup CLs add inputs to this instruction and to the AllocateClosure
stub, starting with the closure function. Adding these inputs allows
the related field to be set within the stub, instead of using
StoreInstanceField manually at each closure allocation point.

Since this CL only adds the initial stub/instruction implementation,
the overhead on snapshots is minimal: just the addition of the new
stub to each isolate.

-----

This CL also adds virtual and non-virtual methods to assembler_base.h
revolving around field loads and stores and attempted inline object
allocation, to ensure all architectures have these methods.

It also adds LoadFromSlot/StoreToSlot/StoreToSlotNoBarrier, which
appropriately calls one of the other methods based on whether the slot
is compressed or not and whether it is a boxed or unboxed field.

With these additions, the AllocateClosure stub generator can be defined
in an architecture-independent way.

TEST=Basically a refactoring, so check using current test suites.

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-simarm64c-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-linux-debug-ia32-try,vm-kernel-linux-debug-x64-try,vm-kernel-linux-product-x64-try,vm-kernel-linux-release-simarm64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-x64-try,vm-kernel-linux-debug-x64c-try
Change-Id: I71f5691307679f8d5e3604007699de4706f86eb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198284
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-05-11 11:22:44 +00:00
Tess Strickland 010523ee4a [vm] Fix handling of WeakSerializationReferences in v8 profile.
Instead of trying to lazily create artificial nodes when needed for
WeakSerializationReference (WSR) targets in all cases, create them
eagerly for targets in reachable WSRs, since those are guaranteed
to be needed.

Those for unreachable WSRs are still lazily created as needed, since the
WSR won't even be accessed by the clustered snapshot writer unless the
unreachable WSR is part of another unreachable object that has an
artificial node created.

This rework avoids some issues seen on upcoming CLs where the artificial
nodes for WSR targets weren't getting correctly generated.

-----

Also extend the v8 snapshot profile writer tests to check the sizes of
the text and data sections in ELF snapshots. That means the v8 snapshot
profile writer tests check up to three different measures, from most
precise to least precise, depending on the output mode:

* If writing an ELF snapshot directly: the sum of the sizes attributed
  to the text and data section symbols are checked to be exactly the
  same as the sum of the sizes of the objects in the profile.

* If writing an ELF snapshot either directly or via assembly: the sum
  of the sizes of the text and data sections are checked to be the same
  as the sum of the sizes of the objects in the profile. If using an
  assembler that merges text and data sections, then account for the
  padding between the sections using an approximate check.

* For all: Check that the size of the snapshot as a whole is
  approximately equal to the sum of the sizes of the objects in the
  profile, accounting both for possible padding and for the global
  header information and non-data/non-text sections like the dynamic
  symbol section.

TEST=vm/data{,_2}/v8_snapshot_profile_writer_test

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-precomp-mac-release-simarm64-try
Change-Id: I66e0e7fdb5bb98045621bf516f150a4723e08147
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198942
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2021-05-11 11:21:44 +00:00
Vyacheslav Egorov 34add230f6 [vm/compiler] Add --print-precompiler-timings
This flag allows dumping timings of various precompiler passes.

TEST=precompiled dart2js with --print-precompiler-timings

Change-Id: I54d6fdf26c25a0e43ae4f2717e833e09e9321d81
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198407
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-05-11 11:15:53 +00:00
Jonas Finnemann Jensen 53448def73 Bump pub
New commits include:
```
$ git log --format="%C(auto) %h %s" 0e657414a472e74ca5dd76ae0db50cc060251dec..00c00e8adf9706bebe8f94483b7663c5f36f59d2
 00c00e8a Vendor tar (#2987)
 291705ca Being gradual migration to null-safety (#2988)
 c5f52a37 Fix CI (#2989)
 74040a45 Update to analyzer 1.5.0, migrate from deprecated AnalysisSession.getParsedUnit() (#2975)
 ce951d70 Fix dry-run tests for publishing  by ensuring there is a server to reject requests (#2978)
 018c9650 Update LICENSE (#2944)
 2614f15c Revert "Vendor package:tar and package:chunked_stream (#2932)" (#2940)
 12d9f457 Handle package:tar cancellations
 255a3091 Vendor package:tar and package:chunked_stream (#2932)
 86bf8b20 Handle relative git-url-paths correctly when --directory (#2919)
 3716a681 Let `pub add` fail if extra arguments are passed (#2927)
 a03ac729 Minor cleanup to reduce risk of using path.current (#2924)
 e87b7b66 Added null check for name in UserInfo class (#2918)
 056a8c9a pub deps --json (#2896)
 53a69e27 Fix .packages entries of relative path deps when using --directory (#2916)
 d6308efc pub upgrade command shows count of discontinued packages (#2908)
 51744805 Upgrade to the null safe versions of all dependencies (#2913)
 e0d538c7 Introduce .pubignore (#2787)
 79f3a8b9 pub outdated: added clear message when no outdated packages. (#2898)
 22463872 `cache clean` (#2904)
 11e7b2ce `publish --dry-run` informs that the server might do more checks (#2883)
 b6977d50 Remove untrue assert (#2884)
 35841f8d Merge branch 'cherry_picks_for_2_12'
 0db3255b Don't fail on failed status listing (#2877)
 53e8ecca Don't allow outdated taking arguments (#2872)
 e83a1dc1 Enable asserts when testing pub (#2754)
 178f2edb Add --directory option (#2876)
 5aadb70e Don't fail on failed status listing (#2877)
 4bf8a927 Remove unused field (#2878)
 73ad5426 Don't allow outdated taking arguments (#2872)
 9a70949e Use Dart library to read and write tar files (#2817)
 2f74230c Do not recommend decativating packages (#2871)
 b1697a27 Use full error message string in CommandResolutionFailedException (#2870)
 16a6210d Upgrade `downgrade --help`: `downgrade` actually updates `pubspec.lock` (#2859)
 6e240ea9 Use cached version listings as heuristic when prefetching (#2851)
 58152f7c Allow trailing slash in PUB_HOSTED_URL (#2856)
 b1bf9a33 Handle poor package-listing responses robustly. (#2847)
 d941bd24 Fix request metadata when overriding dependencyType (#2848)
```

Change-Id: Id7cc4c09e74c02a92bcafe1a9d9bab9431900540
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199040
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Jonas Jensen <jonasfj@google.com>
2021-05-11 10:45:53 +00:00
Dmitry Stefantsov 9f750ca0d3 [cfe] Add flags field to Extension and use it for 'extension type'
TEST=Checked by existing tests.

Change-Id: I436c0322124165f52195ebef402d7ab9104bbb30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198763
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-05-11 10:15:43 +00:00
Martin Kustermann c9cb86ec5d [vm/concurrency] Add isolate stress test generation code
There are 3 parts to this CL:

  * A helper script that recursively lists test suite directories, runs
    tests and sees if they pass, run within reasonably time and pass
    some filters. This is used to discover the set of tests that can be
    included in the isolate stress test.

  * A helper that reads a list of test files from a json file and
    generates a stress test.

  * A sanity test run on normal bots to ensure the test generation as
    well as stress test compilation works (to avoid making the json file
    out-of date with broken tests)

Future CLs will add a new builder that will generate and run the stress
test in various configurations.

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

TEST=vm/dart{,_2}/isolates/concurrency_stress_sanity_test

Change-Id: Ib74918f4558038fff77b97b8ba880499773eefd4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199240
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-05-11 09:35:23 +00:00
Dong-Heon Jung a4e4659c82 Replace OS::PrintErr with THR_Print in bitmap
- Stack bitmap is not printed correctly with print_ssa_liveranges

Closes https://github.com/dart-lang/sdk/pull/45980
https://github.com/dart-lang/sdk/pull/45980

TEST=not needed

GitOrigin-RevId: 47db0a93f94cb9bf1d663ad8d2a7431a6e6aafb9
Change-Id: I14da937330f2825a311f835cd394933c6b52d190
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199260
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2021-05-11 07:16:33 +00:00
Konstantin Shcheglov fa521e4c71 Don't report deprecated hints from deprecated constructors.
Change-Id: I4b0413186653ec1a8df36462178e9f3ad268371c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199180
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-05-11 04:45:13 +00:00
Stephen Adams 823b429d86 [dart2js] js_ast.Name does not need to be Comparable
- js_ast.Name is no longer Comparable
- _NameReference is used on demand rather than for every occurrence.
  This saves 50MB in the big link scenario.
- remove unused asVariableUse() method


Change-Id: I37f55044d394b7e047ca88c527641471bc94c641
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198981
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2021-05-11 01:53:33 +00:00
Robert Nystrom 8efd49860f Add a tool to detect orphaned Dart files in "test/".
Change-Id: I20322067f2cb65c858adfbfef5f785322b8a7a6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198060
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2021-05-11 01:23:03 +00:00
Konstantin Shcheglov 85ca8d6472 Store element model in binary format, and ASTs for initializers.
Internal presubmit looks green.
https://test.corp.google.com/ui#id=OCL:371613550:BASE:372858992:1620628216332:c292dc2

Golem shows about 13% less cold memory, and 30% faster edit.
Other benchmarks are not significantly different.
http://shortn/_R1Y4E7Z2rV

Change-Id: I12acec9c46d4f834f8cb2bea1cf9e1e92a341bbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196502
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-05-10 22:32:33 +00:00
Konstantin Shcheglov 32480240e7 Remove 'overrideWorkspace' from ContextLocatorImpl.
Change-Id: Ib8cb8120d843e1f8be57a888401fe469c801f378
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199100
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-05-10 20:49:40 +00:00
Konstantin Shcheglov 5b8ae4c571 Issue 45879. Initializing formals, AKA field formal parameters are effectively final.
Bug: https://github.com/dart-lang/sdk/issues/45879
Change-Id: I9967c722c62ff811164be87f1fe505cd125d2f50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199064
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-05-10 20:48:51 +00:00
Nate Bosch ddee46ea0c Revert "Update to the latest shelf and shelf_static"
This reverts commit 1f9fcfd999.

Reason for revert: Breaks internal tests.

Original change's description:
> Update to the latest shelf and shelf_static
>
> Change-Id: I6b8e4d39de4147d8b27132877ca2fc6a93a96761
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198882
> Reviewed-by: Kevin Moore <kevmoo@google.com>
> Commit-Queue: Kevin Moore <kevmoo@google.com>
> Auto-Submit: Nate Bosch <nbosch@google.com>

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

Change-Id: I2aa86c3df68518e1b64598abe5dfa8f053632b0d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199120
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2021-05-10 20:31:11 +00:00
Konstantin Shcheglov bea3d47c46 Issue 45935. Test for yield null into a Stream of non-nullable.
Bug: https://github.com/dart-lang/sdk/issues/45935
Change-Id: I45ad487c33e07a5415c9a88ab4789d56d9f6a5dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199061
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-05-10 19:40:11 +00:00
Konstantin Shcheglov a3f5e14649 Issue 45959. Report PRIVATE_COLLISION_IN_MIXIN_APPLICATION when implicit Object supertype.
Bug: https://github.com/dart-lang/sdk/issues/45959
Change-Id: I064c70a1bf869fae09c2f56271a212b910d853ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199062
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-05-10 19:34:30 +00:00