* Clear bytecode for all functions including closures and field
initializers, so their object pools are not preventing constant
objects from being reclaimed by GC.
* Bytecode reader should use dynamic invocation forwarders in AOT too.
* Fix assertion in RegisterTypeArgumentsUse (type arguments in
generic closure functions could come from _prependTypeArguments call).
Change-Id: I2154c87f30720607288ec12012a6d0ec1db618dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118365
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Platform::Init (now Platform::InitOnce) was only being called directly
from the CL embedder and could not be invoked via any path in the embedding
API. Platform::InitOnce is now invoked in both dart::bin::BootstrapDartIo and
dart::embedder::InitOnce.
Fixes https://github.com/dart-lang/sdk/issues/37586
Change-Id: I594908895c19e3058f707f920e265e79ca4cecd7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117591
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Consider the following situation:
class A { foo() {...} }
class B extends A { foo() {...} }
During AOT compilation (in case FLAG_lazy_dispatchers == false)
Resolver::ResolveDynamicAnyArgs was not looking for possible methods
when getter is requested. As a result, if method extractor A.get:foo
has been created, but B.get:foo hasn't, then lookup for B.get:foo
incorrectly returns A.get:foo (instead of null).
Similar situation was previously fixed for a particular call site of
ResolveForReceiverClass (which uses ResolveDynamicAnyArgs):
https://dart-review.googlesource.com/c/sdk/+/30520
However, there are more calls to ResolveForReceiverClass in the compiler
where its incorrect result may be used.
Change-Id: I4ebd6b91157cc048b94e5a5ce182c42dc808f4f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118260
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
We also now don't try to share parts of strict FunctionType(s).
So, I'm removing the corresponding tests.
If we decid that we need this, the correct place to do this is
the type algebra.
Change-Id: I4f7d9df892f8606af8f0403358e56d4a07bdd025
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118321
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This reverts commit 96b8401cfc.
Reason for revert: works incorrectly because kernel-to-il emits multiple initializing stores for the same field. see language_2/field_parameter
_test
Original change's description:
> [vm/compiler] Drop redundant initializing stores of null
>
> Dart objects are allocated null-initialized so initializing stores of
> null value can be removed from the graph.
>
> Issue https://github.com/dart-lang/sdk/issues/38454
>
> Change-Id: I1ba0c3a21462ba8a3409fc648027b4ebf0b1040e
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118286
> Reviewed-by: Samir Jindel <sjindel@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
TBR=vegorov@google.com,kustermann@google.com,sjindel@google.com
Change-Id: Ic0c51986168cb51316d3872514719b34cfc780cb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118289
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Not doing it can lead to the same input producing "different" outputs.
Note that this is a follow-up to cdcec63569
where I forgot about the incremental summary-only case.
Change-Id: Idf76c3839f46c468a62350968b353be7235d91b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118287
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Dart objects are allocated null-initialized so initializing stores of
null value can be removed from the graph.
Issue https://github.com/dart-lang/sdk/issues/38454
Change-Id: I1ba0c3a21462ba8a3409fc648027b4ebf0b1040e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118286
Reviewed-by: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Before this CL we would miss some dependencies when recording
dependencies because we cache certain calculations that upon calculation
can mark things as needed.
Change-Id: If9ff872021b0fb77cbcc787112bb91f3ade71243
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118281
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Printing out the flow graph before and after round trip serialization
revealed slight differences between the flow graphs that might lead
to either bugs or different results in compilation. Remove these
differences.
Also in this change:
* Remove cases where printing or serializing a flow graph could have
the side effect of creating new `CompileType`s or `AbstractType`s
not previously in the graph.
* Ensure reaching types for `Value`s are cloned if the binding
definition changes and check that reaching types either have no
owner or are owned by the `Value`'s definition with the
FlowGraphChecker. (Before this change, we had `CompileType`s in
the graph whose owner had long since been removed from it.)
* Adds `ASSERT`s to check that unexpected non-canonical `Instances`
are not allowed as the value of `ConstantInstr`s and adds some
canonicalization that did not previously occur.
Bug: https://github.com/dart-lang/sdk/issues/36882
Change-Id: I334ffa2a6383291a7cb318343c71bd55a41269a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117143
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
Before this CL we would miss some dependencies when recording
dependencies because we don't finalize exports of dill libraries we have
already finalized.
This was a previous speed-optimization that worked fine before recording
dependencies, but - as outlines above - doesn't work together with
recording dependencies.
Change-Id: I3d9abe949e2b614e9bcd03711e7b92f586373ec5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118043
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
This flag consumes a time in seconds and calculates the correct capacity
for the sample buffer so it can contain at least that many seconds worth
of samples based on the maximum number of samples that can be chained to
represent a stack and the sampling rate.
Providing a value to this flag will likely greatly increase memory
consumption, so a warning message is printed which contains the
information used to calculate the buffer capacity as well as the size of
the resulting buffer in bytes. Example output:
** WARNING ** Custom sample buffer size provided via --sample-buffer-duration
The sample buffer can hold at least 120s worth of samples with stacks depths of up to 128, collected at a sample rate of 20000Hz.
The resulting sample buffer size is 3532800000 bytes.
Fixes https://github.com/dart-lang/sdk/issues/37924
Change-Id: I58aff6da268b9a6b02258021d2be8bf4f80ae999
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117208
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
There is still a couple of write in type_algebra, should be changed
together with using nullability prefixes there.
R=paulberry@google.com
Change-Id: I090eae3dbd709c8bc76da6038a940f12fd9726f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118106
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>