Dispatch interface calls via hashtable rather than inline cache.
InterfaceCall doesn't need to take arguments descriptor into account
when doing method lookup.
Change-Id: I30eae6ea638d1d2ad2cf3ff073c653fee3377f31
Reviewed-on: https://dart-review.googlesource.com/c/86106
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
This reverts commit 11d081d115
Reason for revert: Breaks parsing less common conditionals (e.g. b ? c = true : g();)
Original change's description:
> Add support for simple nullable type return value in generalized function type
>
> This only supports nullable return values of the form
>
> <identifier> '?' 'Function' '(' ...
>
> This is an increment CL in the ongoing effort to add nullable type support
> as outlined in https://github.com/dart-lang/language/issues/110
Change-Id: I99bce29619d4e448193e3c81fa86a982791b1f77
Reviewed-on: https://dart-review.googlesource.com/c/87283
Reviewed-by: Dan Rubel <danrubel@google.com>
If the --use-bare-instructions flag is enabled we will:
* Make call sites load the target directly from the pool (instead of
the code object) - this saves one instruction (and an indirect load)
* Ensure the object pool will have direct entry addresses by:
- Letting the clustered snapshot reader change any StubCode::UnlinkedCall()
in the object pool by it's monomorphic entry
- Change the code patcher to patch SwitchableCalls by writing the
monomorphic entry into the pool (instead of the code object)
Issue https://github.com/dart-lang/sdk/issues/33274
Change-Id: I4e41fc8e4461bde477cc559a6a4fccaaf3a350b5
Reviewed-on: https://dart-review.googlesource.com/c/86160
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
This is the final CL which adds a new --use-bare-instructions flag to
the VM.
If this flag is set during AOT compilation, we will:
* Build one global object pool (abbr: GOP) which all code objects
share. This gop will be stored in the object store. The PP register
is populated in the enter dart stub and it is restored when
returning from native calls.
* Gets rid of the CODE_REG/PP slots from the dart frames. Instead the
compiled code uses the global object pool, which is always in PP.
* Starts emitting pc-relative calls for calls between two dart
functions or when invoking a stub.
Limitation: We only emit pc-relative calls between two code objects
in the same isolate (this is because the image writer is writing
instruction objects for vm-isolate/main-isolate seperately)
* We do compile-time relocation of those static calls after the
precompiler has finished its work, but before writing the snapshot.
This patches all the instruction objects with pc-relative calls to
have the right .text distance.
* We emit a sorted list of code objects in ObjectStore::reverse_code_table,
which will be used by the AOT runtime to go back from PC to Code
objects (where all metadata, e.g. stack maps, catch entry moves, pc
descriptors are available).
Issue https://github.com/dart-lang/sdk/issues/33274
Change-Id: I6c5dd2b1571e3a889b27e804a24c2986c71e03b6
Reviewed-on: https://dart-review.googlesource.com/c/85769
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Some completion tests (overrides) are valid when we make ChangeWorkspace
changes, because /completionTest.dart is not in /home/test. So, for
consistency I'm changing all tests to work with files in /home/test.
R=brianwilkerson@google.com
Change-Id: I050eedaf8da0aa47cdbc2d80195afa2ee23cdd01
Reviewed-on: https://dart-review.googlesource.com/c/87301
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This API does not work in CFE world because CFE does not see classes
created dynamically.
Fix UseDartAPI benchmark that was using this API and was broken as a result.
Change-Id: If691373d32ac5b8ff23e350ce2eb5ed44045b1f1
Reviewed-on: https://dart-review.googlesource.com/c/87183
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Auto-Submit: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
This reverts commit 7720689931.
Reason for revert: Breaks parsing less common conditionals (e.g. b ? c = true : g();)
Original change's description:
> Add support for prefixed nullable type
>
> This adds support for nullable types of the form
>
> <identifier> '.' <identifier> '?'
>
> and
>
> <identifier> '.' <identifier> '?' 'Function' '(' ...
>
> This is an increment CL in the ongoing effort to add nullable type support
> as outlined in https://github.com/dart-lang/language/issues/110
>
> Change-Id: I526aecbe64bacbd442cea0b4c52d36ff23b0443b
> Reviewed-on: https://dart-review.googlesource.com/c/87083
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Dan Rubel <danrubel@google.com>
TBR=brianwilkerson@google.com,danrubel@google.com
Change-Id: Ib5e74b4aad239f561a33eae9d95dffa2693037f7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/87282
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
The megamorphic miss stub might not be initialized at the point in time
when we access it.
Fixes https://github.com/dart-lang/sdk/issues/35405
Change-Id: If20622bd4f3b14d6ece5a8de6f006d7081d6cf76
Reviewed-on: https://dart-review.googlesource.com/c/87322
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
This was perhaps overlooked during refactoring. The current link doesn't
work.
Change-Id: Ia4f1378ba5c16a3ca1386e5fbebd1c78d824aa4e
Reviewed-on: https://dart-review.googlesource.com/c/87076
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Change all the places that still used old-style asynchronous async in
Fasta. These were mostly in testing.
Change-Id: I102209aa54c7c6e658b9d6ec98167af62bf12f3e
Reviewed-on: https://dart-review.googlesource.com/c/87074
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Rationale:
Refactor DartFuzz so that long lists of values appear
in separate file, making the actual fuzzing code easier
to read. Also, this prepares generating some of the
lists automaticaly (such a library methods). Note that
*no* version bump is required, since this refactoring
does not change behavior.
Change-Id: Ic58eb7bc1aa63f48ec0d37e3c2399917786086bd
Reviewed-on: https://dart-review.googlesource.com/c/87266
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
This adds support for nullable types of the form
<identifier> '.' <identifier> '?'
and
<identifier> '.' <identifier> '?' 'Function' '(' ...
This is an increment CL in the ongoing effort to add nullable type support
as outlined in https://github.com/dart-lang/language/issues/110
Change-Id: I526aecbe64bacbd442cea0b4c52d36ff23b0443b
Reviewed-on: https://dart-review.googlesource.com/c/87083
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
Was needed for pkg:dartdoc, but that dependency has been removed
Change-Id: I2d314f8400e3ea5d905864e8728384dd3dc86800
Reviewed-on: https://dart-review.googlesource.com/c/87263
Reviewed-by: Janice Collins <jcollins@google.com>
This improves the default JS display of exceptions/errors from DDC
compiled code. This gives a better "default" experience if JS code
(or a JS engine, like browers/Node.js) ends up catching Dart exceptions.
Change-Id: Ib2dda6eee710f8b536d5ed7223e0101310a137b3
Reviewed-on: https://dart-review.googlesource.com/c/84446
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Rationale:
Having a literal null checked by CheckNull with
a subsequent Redefinition resulted in some strange
unboxing that crashed AOT (fix courtesy Slava!).
Note that we still have some ambiguity around
adding/removing environments from instructions
that may deoptimize, but this change fixes all
prior related DartFuzz failures.
https://github.com/dart-lang/sdk/issues/35335
Change-Id: Ifb50d8cddf93e57758b2bbb83ad397ea281e9307
Reviewed-on: https://dart-review.googlesource.com/c/87280
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
This uncovered a bug in dev_compiler that was showing up at compile
time--it was defaulting the enableAsserts flag to null, causing a null
pointer exception during kernel constant evaluation.
Change-Id: I2c75ffdc494f8d768aa98d67ef8257a20e74b9cd
Reviewed-on: https://dart-review.googlesource.com/c/86982
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
In Dart2, mixin application classes are generated by kernel and type resolution
is performed by kernel. In Dart1, using the VM parser, these tasks were done
during class and type finalization.
Change-Id: I927b1446d906ffd76ed9591c96e0d974df09f3bf
Reviewed-on: https://dart-review.googlesource.com/c/87025
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Make package_build tests work on Windows
Change-Id: I136aa4120aea5c55b125f4866b4c5f24e8d15812
Reviewed-on: https://dart-review.googlesource.com/c/87243
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
This CL adds a [ReversePcLookupCache] which, based on a list of code
objects, builds up a binary searchable table for mapping PCs to Code
objects (where all the metadata is available, like stackmaps, ...).
This CL also adds stack walking support for "bare instruction" frames.
In a later part we will start emitting the sorted list of code objects
(via the new field in the object store) under a flag.
Issue https://github.com/dart-lang/sdk/issues/33274
Change-Id: I3c06c12bc0fb266dc1bd843a4a11b5208773151d
Reviewed-on: https://dart-review.googlesource.com/c/85746
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Until we plan to publish these, it helps tools track what are our public
packages
Change-Id: I5bb692fd6f3da5cfdc9b759d55375435c7885b83
Reviewed-on: https://dart-review.googlesource.com/c/87220
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
This includes _BasicWorkspacePackage for _BasicWorkspace, BazelWorkspacePackage
for BazelWOrkspace, GnWorkspacePackage for GnWorkspace, and
PackageBuildWorkspacePackage for PackageBuildWorkspace.
Bug: https://github.com/dart-lang/sdk/issues/34232
Change-Id: I686b529f460a108b8477d109d07fb29563dd7314
Reviewed-on: https://dart-review.googlesource.com/c/81523
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
- We can now skip checks on tearoffs of functions called only via tearoffs.
- We don't always insert a check when intrinsifying the an unchecked call to set indexed.
- We only build the unchecked entry-point of regular methods when inlining to reduce code size.
Change-Id: I2e6a647409130385cda03906e734a3c161d56ab4
Cq-Include-Trybots: luci.dart.try:vm-kernel-win-release-x64-try, vm-kernel-optcounter-threshold-linux-release-x64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-linux-release-x64-try, vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/86562
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
We'll succeed with an empty list for InconsistentAnalysisException but allow other exceptions to go up and be handled by the server.
Change-Id: I2325d1f53c58a606d5d7c0b84885e68670f48c73
Reviewed-on: https://dart-review.googlesource.com/c/87180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
dart2js internal compiler errors exit 253 and don't produce a core dump, but
rather dump the relevant debug information as a stacktrace on stdio. This
change disables uploading crashes in that case, which would otherwise fail
because core dumps can't be located for the dart2js process, causing the test
step to fail.
Change-Id: I6154bd205c8cccb9c62d007e6071fea8b4196a96
Reviewed-on: https://dart-review.googlesource.com/c/87075
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
Start ordering instructions before writing them out in AOT snapshots.
This is done by:
* discovery of relevant code objects
* ordering of the code objects (currently simply discovery order)
* relocate any pc-relative calls by patching up pc-relative calls with
the actual distance
* producing image writer commands which tell it in which order and at
which .text offsets to write out instructions
Note: Our compiler currently does not emit any pc-relative calls. This
will be added later on.
Issue https://github.com/dart-lang/sdk/issues/33274
Change-Id: I0153c32a7427ea395e80489efadd5513fe7ca371
Reviewed-on: https://dart-review.googlesource.com/c/85745
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
We soon should warn when the flag is used, since it's not supported anymore.
Closes https://github.com/dart-lang/sdk/issues/35393
Change-Id: Ie08fa97d8ca0d8066cfc7d442648c018690dd43f
Reviewed-on: https://dart-review.googlesource.com/c/87165
Auto-Submit: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>