--code-comments should be passed both at compile/training-time and run-time to get
comments in the disassembled instructions.
The required --disassemble-* flags need only be passed at run-time. Flow-graph printing
is not yet supported because we don't save flow-graph like assembly comments.
This functionality is excluded from product builds.
Change-Id: If35fbb08cff6eae40069f916ecec9c6f589c0cad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124989
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
I don't recall what I was thinking when I decided to change the
nullability of the type to "always" when doing this downcast--AFAICT
it doesn't make any sense.
Change-Id: I41d1d2a30722010d2b9b93bb53979ce881e24319
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124905
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
A similar abort was removed in the refactor in 5cce1e4a.
Change-Id: I9921c3f9f2bbe36c4560388471f93356c2d1f12d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125200
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
When we are writing a snapshot, canonicalize all entries within
CompressedStackMaps payloads. We do this by creating a global table
of stack map information (bit counts + bit payload) that we store
in the isolate object store, and then for each existing CSM, we
replace it with an alternate version that refers to the global table.
This gets back some of the canonicalization we lost when we moved from
individual StackMap objects to per-Code CompressedStackMaps objects.
Here, we also represent the global table as a CompressedStackMaps
object. This means that there are three types of CompressedStackMaps:
* The original version that directly contains all entry information.
* The version where each entry is just the PC offset delta and an
offset into the global table payload.
* A version representing the global table where the entries are like
the original version except they don't contain a PC offset delta.
-----
The impact on AOT snapshot size when compiling the Flutter Gallery
in release mode:
armv7: Total size -0.88% (Isolate RO: -5.05%, Isolate snapshot: +0.00%)
armv8: Total size -1.04% (Isolate RO: -5.28%, Isolate snapshot: +0.00%)
-----
Bug: https://github.com/dart-lang/sdk/issues/35274
Change-Id: I1ce0f8b3cc58e2f11584f3c218e0fdf8984b799b
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120667
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Change Expression.getStaticType to take a StaticTypeContext instead
of a TypeEnvironment.
The StaticTypeContext provides access to the TypeEnvironment and the
current 'this type' as well as determining the nullability state of the
enclosing library.
This change is needed to support nnbd types for getStaticType and also
serves as a step towards supporting caching during static type
computations to avoid repeated computations of the same (complex)
expressions.
Change-Id: Ied974dff7f6f7c3c8f262aa80c8dea5c674662f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124683
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Also fix bracketing for "reject" compiler output (flutter/issues/35924).
Change-Id: I0a0d14665520cf5eb4594cc4e5e552c0b35a136e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124914
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Fix vm/cc/OldGC_Unsync to not change FLAG_marker_tasks while incremental marking is in progress.
Fix vm/cc/IterateReadOnly to not mark the heap as read-only while marking or sweeping are in progress.
Remove unnecessary WaitForGCTasks leftover from background finalization.
Bug: https://github.com/dart-lang/sdk/issues/39299
Change-Id: Ib3340e514b44230b9735b74b1f2012ca9b998d50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124824
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Compare 6354b0b97d, which did the same for direct old-space allocations.
Change-Id: Ifc047b48dfa10891ea7f1b39794f5fdbc7cf2ec8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124841
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Previously, when the migration engine found a type that was implicitly
or explicitly dynamic, it assumed the type was meant to be nullable.
This seemed reasonable (since, after migration, `dynamic` indeed
allows null), but it caused unnecessary nullabilities to be
propagated. With this change, the migration engine tracks whether
dynamic types can be nullable or not, just as it does for all other
types. This cleans up a number of tricky corner cases in the
migration engine that were getting in the way of fixing up uses of
`always` and `never` nodes.
Note that if a `dynamic` type is determined to be non-nullable, it
will still be `dynamic` after migration; this change merely prevents
nullabilities from being needlessly propagated from that dynamic type
to other types.
Note that we still assume `dynamic` is nullable when it occurs in an
already-migrated library or as the result of a dynamic dispatch.
Change-Id: I380d0907f3489d0b84f3fdd7164113daae24274e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125084
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
When the CFE compiles an application as a whole (reads in all source
code), the interface targets to members of mixin applications are the
original mixin classes.
When the CFE compiles an application modularly (dependencies are
supplied as kernel files), the interface targets to members of mixin
applications are the copied members in the mixin application classes.
This slight difference does not surface in any test failures. Yet if we
start running our AOT kernel pipeline, we will deduplicate the mixin
application classes. This leaves dangling references (with no target).
The C++ AOT compiler, `gen_snapshot`, will crash if it hits any of
those.
Issue https://github.com/dart-lang/sdk/issues/39375
Change-Id: I17a57370a87cfbdc174829c2e68ecdb7c4a9757e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124993
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
That build step still *fails* because of other static errors in the
migrated corelibs + patch files, but it no longer *crashes*.
Change-Id: Ia763a13bd45cecb148e02ce22d4ed2cc6fdfdfa8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125002
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
This reverts commit ea57b1e62c.
Reason for revert: Please see https://buganizer.corp.google.com/issues/144304690
Original change's description:
> [VM/nnbd] Pass nullability when creating Class::DeclarationType.
>
> Passing nullability rather than forcing kLegacy helps slightly reduce the number
> of Types in the VM and in snapshots.
> This allows to remove the kludge about declaration type of Null being kNullable.
> Also pass nullability when creating a simple type may help.
>
> Note that CFE is still producing super types and some interface types that are
> non-nullable, even with nnbd features disabled. But this should get fixed and
> further reduce the number of types in the snapshot.
>
> Change-Id: I397f00902026ee5bc91d36328f4156427702efdb
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124480
> Commit-Queue: Régis Crelier <regis@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
TBR=rmacnak@google.com,alexmarkov@google.com,asiva@google.com,regis@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: Icae0a69cda6cc531bba4d5d12471e7267a277340
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125102
Reviewed-by: Siva Annamalai <asiva@google.com>
This reverts commit 3771dddf43.
Reason for revert: see https://buganizer.corp.google.com/issues/144304690
(This CL is dependent on https://dart-review.googlesource.com/c/sdk/+/124480 which caused the regression).
Original change's description:
> [VM/nnbd] Force the DeclarationType of a class to have legacy nullability.
>
> This is a workaround to avoid caching a non-legacy type (possibly provided
> by the CFE) as the canonical type of a non-generic class and later returned as
> the runtime type of an instance of this class.
>
> Hopefully fixes https://buganizer.corp.google.com/issues/144304690
>
> Change-Id: Iaea364b9b743b05bde600f0aa784d5a8105728d7
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124920
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
> Commit-Queue: Régis Crelier <regis@google.com>
TBR=rmacnak@google.com,alexmarkov@google.com,asiva@google.com,regis@google.com
Change-Id: If8b2671f3cf4b0d080ba9f0472738326fec701d3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125100
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
The issue is:
lib/src/logger.html, line 107, inserted !:
In this case the single reason detail reads "node with no info (type(2171))" with no destination.
The problem is that InstrumentationInformation.nodeInfoFor is only
considering a limited set of possible sources of nullability nodes
(the primary nodes of decorated types passed to the instrumentation
listener methods `implicitReturnType`, `implicitType`, and
`implicitTypeArguments`). It needs to also consider decorated types
passed to `explicitTypeNullability`, `externalDecoratedType`, and
`externalDecoratedTypeParameterBound`, and it needs to walk these
decorated types recursively to discover all the nodes they point to.
Additionally, the logic in InstrumentationInformation.nodeInfoFor is
inefficient; it walks through all the implicit types in every source
file, which means that it is O(N) in the size of the code being
migrated. Since it is called O(N) times, this is an overall runtime
complexity of O(N^2).
I've prototyped a possible fix using an expando to compute
NodeInformation for each node once at the time it's reported to
instrumentation. This is incomplete and intended as a starting point
for discussion. Work that still needs to be done:
- We don't produce a sensible description string for nullability nodes
associated with AST nodes, so we present unhelpful text to the user
like "A nullable value can't be used as the explicit type ???"; it
would be nicer to say something like "A nullable value can't be used
as positional argument 0 of Level.>=". We may want to consider
modifying the instrumentation API to make it easier to generate a
useful string here.
- I haven't verified that the description string we produce for
external decorated types is helpful.
- I haven't verified that the we produce a useful link for external
decorated types.
- We should probably get rid of the data structure
NodeInformation.explicitTypeNullability (which has similar
inefficiencies) and change over code that was using it to use the
new approach.
Change-Id: I2cf2fe47cd70d7e5cc6e3da309851288668e8a62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124902
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>