It needs to check whether the class the type arguments field is in
has compressed pointers, not whether TypeArguments has compressed
pointers.
Since we need the class to know whether compressed pointers are in
play, remove the version that just takes the offset.
TEST=Existing tests.
Change-Id: Ie6de8e0b2366b86f99a7fda362809dd1e10f99b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199484
Auto-Submit: Tess Strickland <sstrickl@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
I'm not convinced that this is the right way to cache comments, so
feedback is welcome.
Change-Id: I2bd393b80e05c26199020e19daf0eadeb99d8c2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199303
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
After 7131d318 landed, the instruction size for the modified function
(which removes all but one closure) shrank enough to more than outweigh
the extra nodes that get attributed to it compared to the original.
TEST=pkg/vm_snapshot_analysis/test/instruction_sizes_test
Cq-Include-Trybots: luci.dart.try:pkg-mac-release-try
Change-Id: I05f2dbd6ec2850a66b38c9f70fb67a905208c384
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199660
Auto-Submit: Tess Strickland <sstrickl@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
There could be also 'cipd' dependencies which are not compatible with git cloning/checking-out logic
Change-Id: I25243a07e119e73176857e19a83b3e9e632346c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199560
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Instead of specifying FINAL_COMPRESSED and VAR_COMPRESSED, the
macros for defining boxed native slots use the class's
ContainsCompressedPointers() predicate to determine whether a Slot
points to a compressed field.
Also use owner.HasCompressedPointers() when getting a Slot for a
particular Field.
TEST=Refactoring, so just running against the current test suite.
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: I4bf25ffa2dbe89dc9a922305820dc4b752f47d13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198044
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
When we switched from allocating closures with AllocateObject to
using AllocateClosure, a couple of places that needed to check for
IsAllocateClosure() were missed. This caused AllocateClosureInstrs to
never have a NotAliased Identity(), which then forced some
AllocateUninitializedContextInstrs to be kept instead of eliminated.
TEST=Checked using benchmarks that saw regressions due to this change.
Change-Id: If63d4cae190453233429b5657cbe177cac265074
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199430
Commit-Queue: Tess Strickland <sstrickl@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Auto-Submit: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
BARRIER_MASK requires 8 low bits and HEAP_BASE requires 32 high bits. Combine them into a single register HEAP_BITS, and use ARM's shifted operands to continue accessing the relevant bits in a single instruction.
TEST=ci
Change-Id: I5a4cd43fec2d19615239ec5cec2ac282d17c461c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198100
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
In each library where an import is removed, the library uses some elements
provided by the import, BUT there is another import which provides all of the
same elements, and at least one more which the library uses.
In this change, we remove the imports which can be simply removed in favor of
the other already present imports.
See https://github.com/dart-lang/sdk/issues/44569 for more information.
Change-Id: I38a6422e5fc59767fe54eae78a5e24357f1cc030
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199461
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
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>
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>
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>
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>
-----
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>
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>
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>
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>
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>
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>