To avoid accidental code that calls stubs without emitting proper
(deopt-id, deopt-env) metadata, we enforce that it's always present for
stub calls and add another GenerateNonLazyDeoptableStubCall for cases
where it's intentionally omitted.
The environment has in many cases been still emitted before, due to the
usage of `pending_deoptimization_env` though we make code pass it
explicitly (just as the deopt-id). We may want to consider deprecating
this `pending_deoptimization_env`.
Issue https://github.com/dart-lang/sdk/issues/45213
TEST=Existing test suite.
Change-Id: I93f1d5ba4d74da5f9afa4b526ad57b9d032ca99e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197164
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Make expect use `Never` to signal non-completion instead of depending on `meta`.
Change-Id: Ibb4230e6b0cfbf995ad91a31c6620525cf6a8918
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194244
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
This class is used during summary linking to do some basic resolution
of ASTs reconstituted from summaries. To prepare for some resolution
work I have in the pipeline, I need to ensure that resolution always
has access to a properly initialized FlowAnalysis object; this rework
makes that possible.
Previously, the lifetime of the AstResolver class was inconsistent;
some callers created one for each AST node to be resolved, and others
shared a single instance for resolving many loosely related nodes.
Now we consistently allocate a fresh AstResolver each time resolution
is needed; this allows AstResolver to use late fields to lazily create
the visitors it needs for resolution.
Also, previously the API for AstResolver was a single resolve() method
with a complex set of behaviors to allow it to handle all the use
cases. Now there are three simpler methods to handle the three use
cases (resolveAnnotation, resolveConstructorNode, and
resolveExpression).
Change-Id: I891ae621d4a188d906332cb05b6b7f9a50d59dcd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198860
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
The "RunWithMutatorsStopped" wrapper is used in places where the invoked
callback can cause deoptimization of code. It should therefore ensure
it's running with a "deopt safpoint operation scope" to ensure mutators
are stopped at well-defined places that allow lazy-deopt.
Issue https://github.com/dart-lang/sdk/issues/45213
TEST=Existing code base, will add "fuzzer"-like test to nightly/weekend builders.
Change-Id: Icb9a4183c13fab0f084e481c10dfc56a0308126a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197162
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
The optimizing compiler can insert box instructions at various places
during the optimization pipeline. There is no guarantee that a box
instruction will get a proper (deopt-id, deopt-env) assigned to it - in
many places it will not.
Furthermore StoreInstanceField's into "unboxed fields" might cause
box allocations to happen. Those stores might also not have deopt
information associated with them.
In general we require stackmaps when allocation slow paths go to runtime
and cause GC. If GC throws OOM we theoretically would also need deopt
information in order to populate correct catch-entry state. Though OOM
is uncommon and the VM could decide to ignore the top-frame - if it's
missing deopt information - since box allocations aren't something
users are in control of (as opposed to user-allocated objects inside
try/catch).
=> This CL makes box allocations go to a runtime entry that doesn't
support lazy-deopt. While being in those runtime entries the mutators
will also not participate in "deopt safepoint operation" requests.
Issue https://github.com/dart-lang/sdk/issues/45213
TEST=Existing test suite.
Change-Id: I1b61f77e3166da82efad08bb49bc1756576d220c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196928
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
This extends the existing safepoint operation mechanism by allowing to
perform two different operations:
* "gc safepoint operations": All mutators are stopped at places where
it's safe to GC. It therefore requires stackmaps to be available for
all optimized mutator frames.
* "deopt safepoint operations": All mutators are stopped at places
where it's safe to GC, but also safe to lazy-deopt mutator frames.
It therefore requires deopt-id/deopt-info to be available for all
optimized mutator frames.
Mutators can be asked to block for any of those two safepoint operations.
If a mutator is at a place where its safe to GC it will respond to "gc
safepoint operations" requests, if a mutator is additionally at a place
where it's also safe to lazy-deopt it will respond to "deopt safepoint
operation" requests.
Depending on how the runtime was entered (which is tracked via the
[Thread::runtime_call_deopt_ability_] value) - the mutator might
participate in both or only in gc safepoint operations.
During the start of a "deopt safepoint operation", the safepoint handler
will request all threads to stop at a "deopt safepoint". Some threads
might first want to initiate their own "gc safepoint operation"
(e.g. due to allocation failure) before they reach a "deopt safepoint".
We do allow this by letting the safepoint handler own a "deopt safepoint
operation" but still participate in other thread's "gc safepoint
operation" requests until all mutators are checked into places where
it's safe to lazy-deopt at which point the "deopt safepoint operation"
also owns a "gc safepoint operation".
In order to facilitate this, the Thread's safepoint_state will be
extended to consist of the following bits:
* AtSafepoint
* SafepointRequested
* AtDeoptSafepoint
* DeoptSafepointRequested
* BlockedForSafepoint
Issue https://github.com/dart-lang/sdk/issues/45213
TEST=vm/cc/SafepointOperation_*
Change-Id: Icdc2827718f6780818f99b829a5e806d6bb5b130
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196927
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
As a pre-requisite of partitioning our safepoints into "gc only
safepoints" and "lazy-deopt'able safepoints" we'll let mutators keep
track of whether a runtime call into the VM is deoptable.
A mutator is lazy-deopt'able except for one particular case: When the
mutator calls into the VM from a place where no deopt-id/deopt-env
gets recorded (e.g. StoreInstanceField's box allocation goes to
runtime).
If a mutator is in the VM in a non-lazy-deopt'able state, it cannot call
out to the embedder, transition from "vm" to "native" state, ...
A future change will make new non-lazy-deopt'able runtime entries taking
advantage of this CL.
Issue https://github.com/dart-lang/sdk/issues/45213
TEST=Existing test suite & tests in future CLs.
Change-Id: I30dbee02dc839b2ba9632b20ffa233aff4d58f64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196922
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
* FunctionInvocation and LocalFunctionInvocation nodes are now supported.
* Handling of List getters is added to InstanceGet.
* Removed incorrect constant evaluation of .hashCode and .runtimeType
for List constants.
Issue: https://github.com/dart-lang/sdk/issues/45340
Change-Id: I73f3e64e805c0753325463b3e777a6c1b7d0b5fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198181
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
There was a rare mismatch between arguments and parameters when
inlining a constructor body.
The full arguments at the call site of a constructor body (always in a
generative constructor factory) and the parameters at inlining would
not agree on needing a 'box' for the constructor's closed-over mutated
variables (parameters and locals) when the box was needed only for
locals closed over in an assertion.
The fix is to make the condition for accepting a box match the test
for generating the box in the caller.
Bug: 45943
Change-Id: I3b056cb710ffac72bec6943809e04472a838e5bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198741
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
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>
This change is a pure refactoring. It extracts 3 duplicated code
snippets into helper methods. This is needed to reduce number of
places where PropertyGet and MethodInvocation nodes are created, as
these nodes are going to be replaced with InstanceGet and
InstanceInvocation nodes soon.
Issue: https://github.com/dart-lang/sdk/issues/45340
Change-Id: I694805a3761fd389ac8ee005d12ffb9bb9543ea7
TEST=ci
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198581
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This CL just converts one checker_test case into the modern test cases in
resolution/type_inference. Many more of the tests in checker_test deal with
method inference and overrides, which I think should be its own separate test
class in its own CL.
Change-Id: I7ff6787f6a0c343e7948bd6152acc7d579af4afb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198742
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Change-Id: If3a0e3ea3f0f0e4465bf8f875071c92c674600c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197167
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
I noticed that in the Flutter framework, `@protected` members are called from outside of instance methods. @Hixie responded:
> protected allows access from the same file
I think this should be documented.
Closes https://github.com/dart-lang/sdk/pull/45937https://github.com/dart-lang/sdk/pull/45937
GitOrigin-RevId: c1a86d4039aeaa5a2126b505cad28e10fe361b0a
Change-Id: If0be693897abe10197516bdf854ec45fcb1be7fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Safari has a bug that makes it a syntax error for a function name
to overlap with names of parameters in functions with default
parameter values.
This CL changes DDC to generates code to circumvent this issue
when emitting top-level methods. Fortunately, the Safari bug
doesn't trigger with ES6 methods, so we don't need to do anything
for Dart instance methods.
The only other occurrence of named functions in DDC are
`function*` generators that we emit. Those take no arguments,
so we don't need any additional renaming there.
Fixes#43520
Change-Id: I2e4588701a294a8f3c5b47956826ada4ed973e6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198200
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
For yielding functions (async, sync*, async*) we need to look for
annotations on the outer function instead of the synthetic inner
function associated with the handler frame.
Fixes https://github.com/dart-lang/sdk/issues/45673
TEST=runtime/observatory{,_2}/tests/service{,_2}/notify_debugger_on_exception_yielding_test.dart
Bug: https://github.com/dart-lang/sdk/issues/45673
Change-Id: I8b1718b3614852f6f8db98811177b21fe587fea1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198408
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
The compounds transformation converting fields into getters and setters
now retains the annotations on the getters so that they can be read
during recompilation.
This splits up `_replaceFields` into `_findFields` and `_replaceFields`.
`_findFields` works for both transformed and non-transformed compounds.
This splits up `_compoundClassDependencies` out from
`_checkFieldAnnotations`. The former is run on all compounds
transitively reached from the compounds being compiled, the latter only
on the compounds being (re)compiled.
`manualVisitInTopologicalOrder` now visits compounds from all libraries,
not just the ones in the libraries being (re)compiled. It is responsible
for filling the `compoundCache` in topological order. And, this CL
introduces the `InvalidNativeTypeCfe` to support processing compounds
with invalid fields, which might be nested later in other compounds.
Bug: https://github.com/dart-lang/sdk/issues/45899
TEST=pkg/front_end/testcases/incremental/crash_05.yaml
TEST=tests/ffi(_2)/*
Change-Id: I07a2214fd460f4d5e6a84df81e8b140dd80401dc
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try
Fixed: 45899
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198281
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
c++17 should be passed to -std=... and not to -x option.
Change-Id: I13e21d0ec98bcebe2ca537903e1bd399e287852a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198401
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
This is a reland of 4e34ea06a9TBR=athom@google.com
Original change's description:
> [pkg/test_runner] Write experiments to results.json
>
> Change-Id: I32423ddf665a24443de1ad60ca8f323f5c6d3aca
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196489
> Reviewed-by: Alexander Thomas <athom@google.com>
> Commit-Queue: Karl Klose <karlklose@google.com>
Change-Id: I894616f77cb47df25c8da46d2bf6ddb87734db41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198404
Reviewed-by: Karl Klose <karlklose@google.com>
Commit-Queue: Karl Klose <karlklose@google.com>
'''
> git cl lint
runtime/vm/compiler/frontend/kernel_to_il.cc:2614: \
Declaration has space between type name and * in \
TargetEntryInstr *null_ftav [whitespace/declaration]
'''
TEST=Built and ran some existing tests.
Change-Id: I8095a0ea93cce9b57ce4e4965476b1e0a66e7ff0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198402
Auto-Submit: Clement Skau <cskau@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
This reverts commit 4e34ea06a9.
Reason for revert: The data does not show up in bigquery
Original change's description:
> [pkg/test_runner] Write experiments to results.json
>
> Change-Id: I32423ddf665a24443de1ad60ca8f323f5c6d3aca
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196489
> Reviewed-by: Alexander Thomas <athom@google.com>
> Commit-Queue: Karl Klose <karlklose@google.com>
TBR=karlklose@google.com,athom@google.com
Change-Id: Ifccdf3a6031dd55bebfe5d282bcce21c5ab5632a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198403
Reviewed-by: Karl Klose <karlklose@google.com>
Commit-Queue: Karl Klose <karlklose@google.com>
Change-Id: I32423ddf665a24443de1ad60ca8f323f5c6d3aca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196489
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Karl Klose <karlklose@google.com>
Fixes https://github.com/dart-lang/sdk/issues/45912
TEST=manually remove root certificate for pub.dev, confirm that dart is not able to establish https connection in default configuration to pub.dev, confirm that it can connect with the flag.
Change-Id: I51af7994d7cd7371a17877844dc1bf39cd5e54ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198442
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Add certificates from "ca", "trust" and "my" stores in addition to "root".
Improve certificate tracing: print certificates as they are added.
Clean up error logging.
Fixes https://github.com/dart-lang/sdk/issues/45909
TEST=remove certs from current user store, see requests fail to connect, add cert to local machine store, confirm connection works.
Change-Id: Ied234098d56b406c9868602a2b806786ae3740be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198241
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
This is a reland of 8a21ab195a
Original change's description:
> [VM/runtime] Refactor the representation of type parameters in the VM.
>
> This introduces a new VM internal class 'TypeParameters' representing the declaration of a list of type parameters, either in a class or function.
> The reference to (or use of) a type parameter is still represented by the existing 'TypeParameter' class.
>
> Fixes https://github.com/dart-lang/sdk/issues/43901
> Fixes https://github.com/dart-lang/sdk/issues/45763
>
> TEST=existing ones and a regression test
>
> Change-Id: I1fde808bf753cc1cb829f2c4383c1836651cee80
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189942
> Commit-Queue: Régis Crelier <regis@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
This fixes https://github.com/dart-lang/sdk/issues/45911
TEST=existing ones and a regression test
Change-Id: I709d38b1df3d73fe3c9796d5aca3cbbdcf77fd38
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198380
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>