This comment was relevant in a previous revision of the patterns
parsing logic and I neglected to revert it.
Bug: https://github.com/dart-lang/sdk/issues/50035
Change-Id: Ia4034d66c3cc354e2ea6f2e1485380bccf7333dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261700
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
`internal/patch.dart` is changed to be an actual part of
`dart:_internal` and backends are changed to all use the `patch`
constant from `dart:_internal` in `@patch` annotations.
This is done in preparation for changing the import uri of a
patch library builder to be its file uri, with which the
`internal/patch.dart` part can no longer declare itself as
`part of 'dart:_internal';` through a patch library.
Change-Id: I884e939d4a56782e64fb527cdf900769c2b2fcfd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224946
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
The original code assumed that only the initial symbol in the
dynamic symbol table had an empty name, and so any symbol with an
empty name was checked as if it was the initial symbol.
However, it turns out that in at least one case on our testing
infrastructure, the assembler generates a dynamic symbol with an
empty name.
Thus, we change the test to check the initial symbol separately
from the rest of the symbols in the symbol table.
TEST=vm/dart{,_2}/use_add_readonly_data_symbols_flag
Bug: https://github.com/dart-lang/sdk/issues/50071
Change-Id: Ie5d443ee2a45f8fb3400955d8bdfb3e726ab028a
Fixed: 50071
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261820
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
To create a Dart standalone executable on MacOS, we modify the
dartaotruntime executable to add the snapshot contents, and the
VM looks into the executable on disk to find the snapshot to load.
Previously, we did this by adding a new 64-bit segment load command
with a single section, where the section's file offset and size
describes the inserted snapshot. This meant the Mach-O header size increased by 152 bytes.
Originally, this wasn't an issue as there was plenty of padding, but
later clang updates removed most of this padding, and so writing the
new header actually overwrote the initial contents of the first section
in the file, which happens to be the __text section. In addition, since
the first section's offset was now declared to be within the header,
utilities that strictly validated the Mach-O format, like codesign,
would report errors.
This CL changes it so that we actually reserve space in the
dartaotruntime header using the -add_empty_section flag to the linker.
In addition, we change from using a segment load command to using a
(40 byte) note load command. This is because a segment load command
specifies that the contents should be loaded in memory, but we don't
use that loaded version. Instead, the VM reloads it from the executable
on disk so it can appropriately mmap the different parts of the
snapshot. A note section instead just declares a section of the
executable as arbitrary data that the owner can read from the file
and use as desired, which is semantically closer to our current usage.
This CL also adds a test to pkg/dartdev/test/commands/compile_test to
ensure that corrupting a random part of the snapshot in the executable
causes signature verification to fail.
This CL also reverts CL 256208, thus relanding the clang changes
starting from June that originally raised awareness of the issue by
greatly reduced the amount of padding after the load commands.
TEST=pkg/dartdev/test/commands/compile_test
Bug: https://github.com/dart-lang/sdk/issues/49783
Change-Id: Iee554d87b0eabaecd7a534ca4e4facfefbce6385
Cq-Include-Trybots: luci.dart.try:analyzer-mac-release-try,dart-sdk-mac-arm64-try,dart-sdk-mac-try,pkg-mac-release-arm64-try,pkg-mac-release-try,vm-kernel-precomp-mac-product-x64-try,vm-kernel-precomp-nnbd-mac-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260108
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
This change is a small incremental step, but should allow us to delete
the public NoSuchMethod constructor in dart:core. The change simply creates
a private constructor in the dart2js patch file and uses that instead.
https://github.com/dart-lang/sdk/issues/49529
Change-Id: I51cb2ec3b7f169a6cb831e753a3e5e9bf0752dbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260940
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
The scavenger should assume it visits pointers exactly once. This Contains was probably covering up a double visit that was probably fixed with the introduction of the compactor.
TEST=ci
Change-Id: I975cb27e1fedf9fbc0b0d46d33dd374204907037
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261780
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
This fixes one of the issues noted in https://github.com/Dart-Code/Dart-Code/issues/4181, where all example regions would be returned for a code block instead of only those that matched the requested region.
This was because the code that handles comments didn't go through helpers in `_DartNavigationCollector` that does the filtering.
Change-Id: I58931c02f0e4f538c246dc8fc0c3e57895cad5fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261365
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
This change generalizes no_such_method_restriction_stack_trace_test so
that it recognizes all circumstances where there is stack obfuscation
(not just Javascript builds).
Fixes test failures on `vm-kernel-precomp-obfuscate-linux-release-x64` bot.
Fixes#50074
Bug: https://github.com/dart-lang/sdk/issues/50074
Change-Id: I53f3eaa6ae3cf3585b3d4c492d80dd1e72ca216b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261621
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
And all the other things it didn't mention.
And update the `==` documentation too.
Change-Id: Iccd4b046b0632db788e44b02799d1f8d5541d766
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260881
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
This fixes a few minor issues:
- Setting a new selection position did not remove a previously set selection range (which could result in a mismatched offset/length due to how the resulting change merges the position/range)
- Setting a new selection range did not update a previously set selection position
- Inserting new changes before a change that sets a selection range only updated the selection position, not selection range
- Setting a selection range/position after another change that inserts only updated the selection position to compensate and not the selection range
These issues led to cases where selection ranges could be incorrect, or even overlap with linked edit groups that could cause errors that caused code action requests to fail.
Fixes https://github.com/Dart-Code/Dart-Code/issues/4184
Change-Id: I43e2a8361c97b2eccb2d6b426a75eda5cc811e06
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261682
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This adds a test for the dartdoc "See code in examples/api..." navigation in the analysis_plugin, and changes things so that it doesn't walk the directory tree to find the examples directory more than once per compilation unit.
Change-Id: I1938396b160ca2d21b08214f79fb1c7ddbf6a388
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261281
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Greg Spencer <gspencer@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Make a constant lazy if it involves creating a list that is too long
for the `array.new_fixed` instruction, or, for composite constants, if
one or more of its sub-constants are lazy.
Also read lazy string constants directly from a data segment instead
of writing them to linear memory first.
Change-Id: Iea26460580e6134cd3e26eaaa84cb0dde09016dd
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261402
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
We shouldn't fail ("Future already completed") if the timing allows multiple errors from the bad input to arrive during the test run.
Change-Id: I358b8401b865c22d5808c22e463dea0e6416f6ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261602
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
This change restores `parseParenthesizedExpressionOrRecordLiteral`,
`parseArguments`, and `parseArgumentsRest` to the way they looked
prior to adding parser support, and instead adds new methods
`parseParenthesizedPatternOrRecordPattern` and
`parseExtractorPatternRest` that are specialized for patterns parsing.
Bug: https://github.com/dart-lang/sdk/issues/50035
Change-Id: I104e031a796ef7f217cd427e1a9ae94a04dafa7b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261620
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Make `dart compile exe -v` forward gen_snapshot output in
verbose mode.
Fix --write_code_comments_as_synthetic_source_to=... flag. There
was a change to Dwarf writer API which broke it.
Motivated by https://github.com/dart-lang/sdk/issues/50059
TEST=manually
Change-Id: I0431925f724a9b24e938bdb9d7ae1019143da83a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261360
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Using ring (or other similar types) of recorders in PRODUCT
does not make sense because you can't extract the information
they record without vm-service. Additionally "ring" (default
recorder type) preallocates ~4Mb of memory to store the data.
This CL adds a "none" recorder which simply drops all data
and has no memory overhead and makes this default recorder
in PRODUCT.
We also change code to only allow none, callback, systrace
and file recorders in PRODUCT.
TEST=manually
Bug: b/237989929
Change-Id: I52d6ff8bf766e8fa0969eab0bf2adc45dd9a57c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261320
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
- Prep work for non-moving promotion.
- The generations still have different alignment offsets.
- Old-space pages now participate in the page cache.
- Fix boolean/null bit tricks to assert the right requirements on the alignment of a page's first object.
TEST=ci
Change-Id: I4369d8c6af73228e162c226d411914868bafed33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260401
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
If a concrete class implements an interface containing a name that's
private to a different library, any attempt to invoke that name will
result in an exception getting thrown. Previously, such attempts
would result in the call being diverted to noSuchMethod.
This change closes a loophole in Dart's privacy system, and paves the way for
a future implementation of promotion for private final fields (see
https://github.com/dart-lang/language/issues/2020).
Bug: https://github.com/dart-lang/sdk/issues/49687
Change-Id: Ie55805e0fc77dc39713761a80a42c28bd0504722
Tested: language tests
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255640
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>