This move the stack checking mechanism to a mixin to prepare for
reuse in the inference visitor.
Change-Id: I40a3ecb9ddd9e23a7044e28f8534cfb460a158bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279171
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
- Prevents the VM from behaving incorrectly when the Dart program happens to use the string "<optimized out>".
- Prevents the VM from executing eval functions for non-String classes with a String receiver.
TEST=<optimized out>
Bug: https://github.com/dart-lang/sdk/issues/51027
Change-Id: I4b6ee856492dee86d641a0200a40a25fa78bcb88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279261
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
This test case incorrectly assumed that type literal
'Predicate' is a generic type, where
typedef bool Predicate<T>(T arg);
However, it is instantiated to bounds and it is actually
bool Function(dynamic)
Fixes https://github.com/dart-lang/sdk/issues/51052
Change-Id: I793aa505ff2b910d646d7374a3d6fc917ed6794c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279271
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Along with dart:ui, dart:_engine also uses dart:_js_annotations
and therefore needs to be in this denylist to avoid a breaking
change.
Change-Id: Id60d278a9a3d8bc20c05ac895152d2aaacfb36de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279260
Reviewed-by: Riley Porter <rileyporter@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
Auto-Submit: Srujan Gaddam <srujzs@google.com>
We should visit the children of StaticInvocations, as they may
contain calls to createDartExport.
Change-Id: Ib2d91a60c48f3d2ddb5c6ef385114ea343d591ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279071
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Riley Porter <rileyporter@google.com>
Adds support for `asset: 'asset-id'` in `FfiNative`s.
Symbols in assets are resolved by
1. the provided [asset] (the bulk of this CL),
2. the native resolver set with `Dart_SetFfiNativeResolver` in
`dart_api.h` (old behavior), and
3. the current process.
Symbols in assets are resolved by the Dart VM through the mapping
provided in the `vm:ffi:native_assets` library:
```
@pragma('vm:ffi:native-assets', {
"linux_x64": {
"<asset1>": [
"absolute",
"<absolute-path>"
],
"<asset2>": [
"relative",
"<relative-path>"
],
"<asset3>": [
"system",
"<system-path>"
],
"<asset4>": [
"process",
],
"<asset5>": [
"executable",
],
}
})
library;
```
There are 5 asset path types. Symbols resolved in these asset types are
resolved as follows.
A. Absolute paths are dlopened, after which the symbol is looked up.
B. Relative paths are resolved relative to `Platform.script.uri`, and
dlopened, after which the symbol is looked up.
C. System paths are treated as absolute paths. (But we might explicitly
try to use `PATH` in the future.)
D. Symbols looked up in Process assets are looked up in the current
process.
E. Symbols looked up in Executable assets are looked up in the current
executable.
The native assets mapping can be provided in three ways.
X. In the invocation to `gen_kernel` with the `--native-assets`
argument. This uses the gen_kernel entry point for compiling
kernel.
Y. By placing a `native_assets.yaml` next to the
`package_config.json` used by the isolate group. This works for
`dart <source file>` and `Isolate.spawnUri(<dart source file>)`.
This uses the kernel_service entry point for compiling kernel.
Z. By sending a String containing the native assets mapping when
invoking the kernel_service directly from within the VM. Currently,
only used for unit tests.
TEST=tests/ffi/native_assets/asset_*_test.dart (X)
TEST=tests/ffi/native_assets/infer_native_assets_yaml_*.dart (Y)
TEST=runtime/vm/ffi/native_assets_test.cc (Z)
The library is synthesized from yaml in pkg:vm as AST.
Design doc: go/dart-native-assets
Bug: https://github.com/dart-lang/sdk/issues/49803
Change-Id: I8bf7000bfcc03b362948efd3baf168838948e6b9
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-nnbd-mac-debug-arm64-try,vm-kernel-nnbd-mac-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-win-debug-x64c-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-precomp-win-debug-x64c-try,vm-kernel-precomp-nnbd-mac-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264842
Reviewed-by: Martin Kustermann <kustermann@google.com>
Rename StaticWarningCode to WarningCode, leaving the spec ones as StaticWarningCode.
In this CL I do not introduce a new "type" for WarningCode, it is still "STATIC_WARNING". Later, we can make a new type, "WARNING", taking care for pkg/test_runner and DAS clients like IntelliJ.
Bug: https://github.com/dart-lang/sdk/issues/50796
Change-Id: Ife856b2beb7e9b6bf8203f365634f49846d03bf1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278997
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Make the canonical string table weak.
Remove incorrect assumption that a symbol not already existing implies there is no target. This would be true but for all the call-through-field/method-extractor nonsense.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/50648
Bug: b/265897936
Change-Id: I463807a5d8c064888abbdc3dc75e916c2bdc8fa5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279273
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Instead of joining pattern variables in shared case scope after every
top-level pattern, we now accumulate them, and join at the end of the
shared scope.
Change-Id: Icc1d426e53ccfe48a72e3194e1d7e96e6e90d781
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279264
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This CL changes `--arch all` to mean only 64 bit platforms on MacOS.
Running `tools/gn.py -aall` fails on MacOS hosts before this CL with:
> Exception: Failed to find a C host architecture for ia32. Need one
> of ['x86'] but only ['arm64', 'x64'] are available.
This was likely broken since
https://dart-review.googlesource.com/c/sdk/+/243642.
Change-Id: Ic024aeff037c3219e1569e1d91226931e0b80023
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279168
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Change-Id: Ife971f04010e801f58be48c578d6df11103fb29d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279165
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Added highlighting for the 'mixin' keyword on classes and fixed the BNF to be consistent with the spec.
Change-Id: Iaa5b32ba2d122f01d5ddaddc066ac8f4a50b9844
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279237
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
In dartfuzz_api_table.dart, both `DartType.VOID` and `DartType.VOID_NULLABLE` are added to the Map keys. At runtime, the last value for a given key wins, so I removed the `DartType.VOID` key-value pair.
In gen_api_table.dart, both `assertionErrorEncoding` and `errorEncoding` are added to the Map keys. At runtime, the last value for a given key wins, so I removed the `assertionErrorEncoding` key-value pair.
This CL should be a no-op.
Bug: https://github.com/dart-lang/sdk/issues/50796
Change-Id: Ifcfeb3e84930267f60efd2eb009a722f8ac2453e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279234
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
After 'SelectRepresentations_Final' mismatched representations
are not allowed. So 'Canonicalize' pass should not replace
an instruction with another instruction when they have
different representations.
TEST=vm/cc/IL_Canonicalize_RepresentationChange
Fixes https://github.com/dart-lang/sdk/issues/51019
Change-Id: I087e16cda6e196337e7636746172d9e28ae07374
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279230
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
At this point the tests are failing, as either the fix processor has to be updated or there are issues blocking the analyzer generating the required diagnostics.
Bug:49960
Change-Id: Ifa445ef1bf459b401bda335672364e745267799a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279227
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
In particular functions that will benefit from the subsequent unboxing
and value propagation by Binaryen are marked for inlining.
Change-Id: Id131de47b42af11f17e227003ee828eb02c5d3cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279097
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
This ensures that the expression is constant evaluated which is
need for exhaustiveness checking.
Change-Id: I5ff2e1dd29a84e051254667537d8c9ec681930f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279166
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Currently if I generate a `call` with incorrect number of values on
stack, I get an error like:
Unhandled exception:
local.get 0 i64
i64.const 1073741823 i64, i64
i64.gt_u i32
L1: if () -> ()
local.get 0 i64
i64.const 0 i64, i64
i64.const 1073741823 i64, i64, i64
ref.null Object i64, i64, i64, ref null Object
Underflowing base stack of innermost block
After this I usually need to check the type of the function being called
to see how many arguments it's expecting, with their types.
With this change we now report:
Unhandled exception:
local.get 0 i64
i64.const 1073741823 i64, i64
i64.gt_u i32
L1: if () -> ()
local.get 0 i64
i64.const 0 i64, i64
i64.const 1073741823 i64, i64, i64
ref.null Object i64, i64, i64, ref null Object
Underflowing base stack of innermost block: expected [i64, i64, i64, ref null Object, ref null Object], but stack contained [i64, i64, i64, ref null Object]
Change-Id: I3191ebf6112e90d341cd121a2afd2fc858282c68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279089
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
Our compiler shouldn't depend on current isolate, since it can
run on any isolate within an IG.
Doing this change, reveals two existing dependencies on current
isolate from compiler
- resolving native symbols in unoptimized compilations
- issuing of debug events for breakpoints
For the former we'll re-enter the currently active isolate that
triggered unoptimized compilation.
=> We may want to change that embedder API to not be based on
handles and instead give embedder a simple `const char*`.
For the ladder we'll enter the isolate corresponding to the
breakpoint debug event to be issued. We are at place where
all mutators are stopped, so that does seem okish.
=> Future could remove this by making Object Id Ring per-IG
Issue https://github.com/dart-lang/sdk/issues/48523
TEST=service_2/break_on_function_many_child_isolates_test/dds
Change-Id: Id246db5972ae505e82f637ce04bb2302bed76257
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278901
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
This CL keeps slow (500+ ms) requests around for longer (to a total of
1000 of them), saves the start time of the request and prints a little
more on the details page.
The overall idea is that having a record of slow requests is better
for debugging performance related issues than only having the newest
50 requests which basically requires one to "catch it" as it's being
slow.
Currently the 500 ms deadline for "slow" and 1000 requests saved was
just grabbed from thin air; we can adjust them later if needed.
Change-Id: Ib0d6e1fc2daad215d8745249abdc82f831a83785
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279087
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Change-Id: I3321b45c4ed3b021e3be95bf730ee2844bb9902b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275981
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
- Removes all versions of `dart_sdk.js` and `dart_sdk.js.map` from the
packaged SDK. All supported build systems compile their own versions
of these files.
- Removes `dart-sdk/lib/dev_compiler/kernel/common/run.js`.
No supported build system uses the "common" module system.
- Moves `dart-sdk/lib/dev_compiler/kernel/amd/require.js` to
`dart-sdk/lib/dev_compiler/amd/require.js` cleaning up the
unnecessary `kernel/` sub-directory.
Issue: https://github.com/dart-lang/sdk/issues/50700
Change-Id: Id4173ddec31a6c0260009924bf1e1ae3d3f32abf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275482
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>