Rationale:
Useful to implement the simulator, but also useful
in the future when compiler wants to constant fold
operations related to bit reversal.
https://github.com/dart-lang/sdk/issues/38346
Change-Id: I2f09ba6b1897202b5c07a2cff771afd7bbc99495
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119703
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
This is now consistent with Set and Map constants.
Change-Id: I4a65f372eeeaaba5d6b7c229c452ba4dc7870708
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119582
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Rationale:
We are adding library support for bit operations:
lowZeroBitCount/highZeroBitCount/nonZeroBitCount
The rbit on AM32 will enable very efficient direct
native implementations of these operations in the
DartVM codegen.
https://github.com/dart-lang/sdk/issues/38346
Change-Id: Icedf4af301b5c8011922fccb1530a9c28e5c0964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119600
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
Rationale:
We are adding library support for bit operations:
lowZeroBitCount/highZeroBitCount/nonZeroBitCount
The rbit on AM64 will enable very efficient direct
native implementations of these operations in the
DartVM codegen.
https://github.com/dart-lang/sdk/issues/38346
Change-Id: I4456a622d7bad1a2cfbf9383927c76983c1de9ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119586
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
This allows navigation to work from migrated files, but some navigation
from unmiograted files doesn't work.
This also causes the content of the output directory to be deleted
before generation starts so that old files won't confuse the user.
Change-Id: I0007d811e56b82cb6b91582e3237c7383ae2d060
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119660
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Block nodes inside BlockExpression are not serialized separately in
kernel binary, so attached metadata is not preserved.
This change fixes Fixes pkg/kernel/test/metadata_test test failure
revealed by https://dart-review.googlesource.com/c/sdk/+/119520.
Change-Id: I38c2cde6311e001f16faf2641762aaf42dd6d2b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119527
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Like the constant pool, this pool is populated when the flag
`--populate-llvm-constant-pool` is used. This pool contains the `Function`
objects that were compiled, and each `FlowGraph` node in the serialized flow
graphs will contain extra information labeled by `llvm-index` which is the
index of its corresponding `Function` object in the pool.
Also fix up printing of the constant and function pools when the flag
`--print-llvm-constant-pool` is used so that the output is buffered to avoid
overlapping output from concurrently running isolates.
Bug: https://github.com/dart-lang/sdk/issues/38297
Change-Id: I67739500c665e509ed16becc2e6bca7fe4928eb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119543
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
The interpretation of the subtype check result depends on the mode. In partial
NNBD mode all type errors that wouldn't be errors in non-NNBD programs should
become warnings. In full NNBD mode all such errors are errors. This CL adds
the mode explicitly to the interface of the subtype check as a parameter.
Bug: http://dartbug.com/38673
Change-Id: I14bcdd260618530cfdd8189c01abba7469a16679
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119545
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
The code from these precompiled constructors is thrown away,
and if we are adding constants to the LLVM constant pool, then
we may add constants that will not actually appear in the final
program which may cause issues for tree shaking.
If these constructors are actually used, then they will be
recompiled normally.
In addition, we also do not add unreferenced constants to the
constant pool. That is, these constant definitions will not have
an `llvm_index` value in their serialized form when the LLVM
constant pool is populated.
Bug: https://github.com/dart-lang/sdk/issues/38661
Change-Id: I2a3702fd3f174504a5f01458064306cd687d7949
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119339
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Fuchsia is about to turn on ShadowCallStack for ARM64. Once this is enabled, we need to treat R18 like a preserved register. Generated Dart has not accessed this register because it is reserved on iOS, and in the absence of Dart exceptions this would be sufficient for us to be ShadowCallStack compatible. However, our exception handling mechanism jumps past all the C++ frames between the Dart exit frame and Exceptions::JumpToFrame, skipping code that would pop from R18.
Add save/restore of R18 in the invocation stubs, and restore of R18 in the jump stub. The latter prevents the ShadowCallStack from overflowing for code that has lots of exceptions without a native call.
Bug: https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=37449
Change-Id: I2ce6e46624c8d72507e7afa7a44839b1f0def556
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119481
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
There are no changes other than the sorting.
Change-Id: Ifcb6874324714cad954138a857416b6046bd276e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119585
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This change should also reduce the number of flaky failures and fix issue where `pub run -c test` would fail for certain tests.
Change-Id: I6010346b8a916958d46985e45600ef5a4dc760c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119500
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
very constrained support for fixing `diagnostic_describe_all_properties` for the boolean field case.
still todo:
* tests for no debugFillProperties method
* tests for getters
* support for ColorProperty -- for Color
* support for EnumProperty -- for any enum class
* support for IntProperty -- int
* support for DoubleProperty -- double
* support for IterableProperty -- any iterable
* support for StringProperty -- string
* support for TransformProperty -- Matrix4
* support for DiagnosticsProperty for any T that doesn't match one of the other cases
(at least)
See: https://github.com/dart-lang/sdk/issues/38633
Change-Id: Ie6875f49914e54d3b4539fcb51a231da688bdf18
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119536
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Based on a discussion where the current wording made it seem necessary
to create a `TestException` class for the sole reason of avoiding
direct usage of `Exception`.
Also remove usage of unnecessary `new` in doc.
Change-Id: I7abe84e8719af056b3f82e1d7e08faa9a641591d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118369
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
The modular test framework relies on temp files and a multi-root
file system. The uri of a script from this kind of tests uses a
specific scheme we can use to identify it and allow the import in
tests.
Change-Id: I94f81bac3a920546f1d33186fb9d9ca555d6cf8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119301
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
I got the hello world wasm file from the emscripten team and got it
running using a fake implementation of WASI's fd_write function. This
necessitated adding support for memory exports.
Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: I139a4e868d437e2232bf4260e5cc26d8c598ac2c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119061
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Create ddc only modular test suite. Serves as the base for upcoming diffs adding
NNBD tests.
Change-Id: I03364a63074173f203a1aee7ef7ae4d6f1be90eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119485
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
This is used by published versions of analyzer_plugin, so removing it
would be a breaking change. We'll remove it in a future breaking
change release of the analyzer.
Change-Id: I18f27dd32556e6d570b2a3747570a0595fdfa5d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119482
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
With summary1 out we don't need this method and the flag.
R=brianwilkerson@google.com
Change-Id: I1d8d8e78f5a457294d5dc3500172b130dbe320ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119522
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This CL adds a test for what was fixed in
79cc54e519, namely that when loading a
concatenated component, the uriToSource map shouldn't have its values
overwritten with objects with no source in them.
Change-Id: Ief899295d0b4ab97cbfe598a39bb47441d38c3ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119542
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
In my measurements this changes the time it takes to write the sdk by
-11.1274% +/- 0.624366% (via slightly modified
pkg/kernel/test/binary_bench.dart AstToBinary out/ReleaseX64/vm_platform_strong.dill)
Change-Id: I4c5cbe17f42b70ef361b2edda0b33c8fc1727b63
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119540
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Instead of storing the PC offset inside the StackMap object, store it instead
in the `Array` containing `StackMap`s in `Code` objects. That is, the `Array`
provided by `Code::stackmaps()` no longer contains just `StackMap` objects, but
instead contains `Smi`s and `StackMap` objects in alternating fashion. Each
`Smi` is the PC offset for the `StackMap` object that follows.
This ends up changing very little code outside of `StackMap`,
`Code::GetStackMap`, and `StackMapTableBuilder`, as there are only two types of
`StackMap` users:
* Users that call `Code::GetStackMap` already have the PC offset.
* Users that call Code::stackmaps() can just fetch the PC offset from the
returned `Array` instead.
On 64-bit architectures, we will use more space to represent the PC offset
as a Smi in the Array than the old uint32_t field. However, the drop in total
number of StackMap objects due to an increased ability to canonicalize
them should offset this. On 32-bit architectures, we can only represent
30 bit PC offsets, not 32 bit PC offsets, but that shouldn't be a problem
in practice except for pathological cases.
_Numbers from building the Flutter gallery in android_release mode_
Since PC offsets are no longer in the `StackMap` objects, this enables
a lot more canonicalization than before. Previously, we generated
49379 `StackMap`s, but now we only generate 16139 `StackMap`s, just under
a third of the original number. This is because there were a lot of
`StackMap`s that differed only in their PC offset, and now they can
be canonicalized into the same `StackMap` object.
When building the Flutter gallery with android_release, the app.so size
drops from 11276896 bytes to 10908256 bytes, a difference of 368640
bytes, or 3.27%.
Using the AOT snapshot profiling support, we see the following drops:
Heap snapshot size drops from 10.7 MB to 10.4 MB.
`Code` | Before | After | Difference
---------------------------------------------------------
Shallow size | 352363 | 352363 | 0
Retained size | 9114801 | 8796064 | -318737
Percent of snapshot | 81.2% | 80.7% | -0.5%
`(RO)StackMap` | Before | After | Difference
---------------------------------------------------------
Shallow size | 49381 | 16141 | -33240
Retained size | 893965 | 286613 | -607352
Percent of snapshot | 7.97% | 2.63% | -5.34%
`StackMap` | Before | After | Difference
---------------------------------------------------------
Shallow size | 844584 | 270472 | -574112
Retained size | 844584 | 270472 | -574112
Percent of snapshot | 7.53% | 2.48% | -5.05%
As we'd expect from the `StackMap` numbers above, we end up using a little
under a third of the space for `StackMap`s. We actually use even less space
(32.0% of the original) than the drop in `StackMap` numbers (32.7%), because
each `RawStackMap` instance is 32 bits smaller due to dropping the `pc_offset_`
field. Note that even though these PC offsets now show up in the
`Code::stackmaps()` `Array`, we can see this is still a net drop in space used
by looking at the retained size of `Code` objects.
Bug: https://github.com/dart-lang/sdk/issues/35274
Change-Id: I0910a43e7a5a7e2e721676209196be1884c5a71c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119147
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>