Commit graph

89297 commits

Author SHA1 Message Date
なつき
afe9219026 [infra] Support for Alpine Linux Sysroot
Closes https://github.com/dart-lang/sdk/pull/51044

TEST=manually tested by the contributor

GitOrigin-RevId: 86c85da0680047e08caf81cc4c12098ae85c0d2b
Change-Id: I591d7e17ce3a87cf8ce8380c9511f70d738d44c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279267
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-01-19 10:36:51 +00:00
Josh Soref
9e4dc755cb Spelling pkg
Closes https://github.com/dart-lang/sdk/pull/50921

GitOrigin-RevId: 6b1ca502b6722b0a987f33ace66f65cbd2c24e23
Change-Id: I74e4ff3c8e759c576036d6b791bd7734ebd215d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278536
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-01-19 10:06:29 +00:00
Johnni Winther
e6b89b2a8d [cfe] Add test for exhaustive checking vs non-nullable expression in weak mode
Change-Id: I314c27665239aa878520e9c7cb6d2d2c55b9de34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279176
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2023-01-19 09:01:50 +00:00
Johnni Winther
60fd2a131c [_fe_analyzer_shared] Extract stack checker for reuse
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>
2023-01-19 07:57:06 +00:00
Joshua Litt
abae306239 [dart2wasm] Add more test coverage for int in static interop APIs.
Change-Id: I6f77eeefb14e557be65c09a56ed814ab1702fac2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278804
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2023-01-19 04:46:47 +00:00
Riley Porter
329cb2088a [js_util] Add unsignedRightSift operator to js_util
Change-Id: Ibbf10bc5428e01e9f2bca24cf99489b186c7ba9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278995
Commit-Queue: Riley Porter <rileyporter@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2023-01-19 03:16:33 +00:00
Daco Harkes
3868b30e21 [vm] Fix RISC-V build
TEST=risc-v sdk bot

Change-Id: I57df7b0ff267931b6dd5fe00260d80a42d1789b6
Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-riscv64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279179
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2023-01-19 00:00:08 +00:00
Ryan Macnak
79bcad6453 [vm, compiler] Use a proper sentinel instead of a string to represent eliminated values.
- 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>
2023-01-18 23:34:12 +00:00
Alexander Markov
b4764ced52 [tests] Fix lib/mirrors/reflected_type_generics_test/01
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>
2023-01-18 22:35:38 +00:00
Ahmed Ashour
c3367ced2a [cfe] tests to handle Windows EOL
Bug #50938

Change-Id: I01aeaa83f3a1a1dd143379986821da35450732a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278510
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-01-18 22:12:27 +00:00
Konstantin Shcheglov
1560314571 Separate NullAssertPattern and NullCheckPattern.
Change-Id: I819c2de5abf57007051d8dfa957924d1624469cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279276
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-01-18 21:57:07 +00:00
Konstantin Shcheglov
5ab0fe05e9 Test for PatternAssignment in ForPartsWithExpression initialization.
Change-Id: Iaf69c334010f584245a5a11b9cd9a615f18cea76
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279275
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-01-18 21:42:38 +00:00
Srujan Gaddam
34ab46ab33 [pkg:js] Add dart:_engine to denylist for top-level lowerings
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>
2023-01-18 21:38:50 +00:00
Srujan Gaddam
f93b5482af [pkg:js] Transform childen in export creator
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>
2023-01-18 21:34:35 +00:00
Daco Harkes
d2ef97258c [vm/ffi] Replace FfiNative with Native
See API design discussion in bugs below.

TEST=tests/ffi/native_assets/*

Design doc: http://go/dart-native-assets

Bug: https://github.com/dart-lang/sdk/issues/49803
Bug: https://github.com/dart-lang/sdk/issues/50097

Change-Id: Id6e6eb94c6eb39ccaaa637448583a40ab6110d12
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-precomp-win-debug-x64c-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265084
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-01-18 21:08:38 +00:00
Daco Harkes
9a8508ebff [vm/ffi] FfiNative assets
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>
2023-01-18 21:08:38 +00:00
Daco Harkes
476e13a5e9 [vm] Enable annotations on libraries in AOT
We have no use cases for this until the dependent CL.
TEST=dependent CL

Closes: https://github.com/dart-lang/sdk/issues/50539

Change-Id: Iee91f90ddd474cef3b7218def4d3e716ab2639ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272421
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-01-18 21:08:38 +00:00
Konstantin Shcheglov
5d18663a7d Remove TestPathTranslator and other related utilities.
Change-Id: I1d32824f9e8b6d154b2de970790bdfa32b9aee0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279272
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-01-18 21:00:49 +00:00
Danny Tuppeny
4fdbe1b47d [dds] Pass existing DDS URI in existingDdsInstance exception
Work towards a better fix for https://github.com/flutter/flutter/issues/118609.

Change-Id: I7db8bd74cc272a2bb1df3a04e6f1d7b82b877ddb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279175
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-01-18 20:36:07 +00:00
Sam Rawlins
305358e8ce [analyzer] Introduce WarningCode for non-spec warnings.
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>
2023-01-18 20:28:38 +00:00
Ryan Macnak
49a135ab7e [vm] Extend the hash_table.h templates to support weak sets.
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>
2023-01-18 20:16:11 +00:00
Konstantin Shcheglov
68c32274c7 Fix joining variables in switch statement.
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>
2023-01-18 19:32:42 +00:00
Daco Harkes
b41c70463e [tools] Fix gn.py -aall on MacOS hosts
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>
2023-01-18 19:10:51 +00:00
Ahmed Ashour
49c7d93042 [cfe/analyzer] add CompileTimeErrorCode.CONTINUE_LABEL_INVALID
Fixes #49852

Change-Id: Ic4d475d383dba51ad438de5ef7f928ce5d105e12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277481
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-01-18 19:10:46 +00:00
Erik Ernst
af51dc4249 Add tests about primitive equality
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>
2023-01-18 18:34:30 +00:00
Konstantin Shcheglov
a0de31dfe8 Report UNUSED_LOCAL_VARIABLE for pattern variables.
Change-Id: I4ee5c20a4b8ab90107bf7af454fa147538fd1474
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279232
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-01-18 18:33:28 +00:00
Ryan Macnak
d23d074bb9 [vm] Fix determining the scope class for evaluation with mixin applications.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/51027
Change-Id: I02b31187c2dd81ff61db01d5922a2b283e7f2541
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279238
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-01-18 17:48:31 +00:00
Martin Kustermann
3e05b6849e [gardening] Remove unused field
TEST=Fixes build due to unused-private-field warning.

Change-Id: Ieff80e1a376ff225dda3ed78a5e22fff923341d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279174
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-01-18 17:38:29 +00:00
Tess Strickland
c8ca74d380 [vm] Fix broken failure code in Dwarf::WriteLineNumberProgram.
TEST=riscv64 build combined with CL 279174

Bug: https://github.com/dart-lang/sdk/issues/51051
Change-Id: I016f3a67510ea2a1fa8067aa61fa485ecb5cf172
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-kernel-precomp-asan-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279177
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-01-18 17:21:13 +00:00
Kallen Tu
6e9556c3de [analysis_server] Add semantic highlighting for mixin class modifier.
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>
2023-01-18 16:36:11 +00:00
Sam Rawlins
59561320dc [dartfuzz] Remove duplicate map keys
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>
2023-01-18 15:57:00 +00:00
Sam Rawlins
5fe2f3bce2 [analyzer] Fix options-parsing tests on Windows
Change-Id: I8b625783e1273f052db7864395821ccaf4307c59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279075
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-01-18 15:33:39 +00:00
Kallen Tu
73bdcabc9f [cfe] Report error when mixin classes have a generative constructor.
Change-Id: I89dd5dd54b7d309563e639362dc8cfe204caec11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279060
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-01-18 15:28:42 +00:00
Alexander Markov
3fc896f7b2 [vm/compiler] Avoid introducing mismatched representations during instruction canonicalization
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>
2023-01-18 15:23:07 +00:00
Keerti Parthasarathy
2acdf0cb60 Add tests for patterns for fixes/assists.
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>
2023-01-18 14:50:38 +00:00
dependabot[bot]
f27a5fec6a Bump github/codeql-action from 2.1.37 to 2.1.38
Closes https://github.com/dart-lang/sdk/pull/51022

GitOrigin-RevId: fea3f63b1c5432bdc603f148a94ffa3742a64ede
Change-Id: Ie2cdfb252e42d3f30e2fbc6a71e6548dba0f7dbe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278948
Reviewed-by: Alexander Thomas <athom@google.com>
2023-01-18 14:30:09 +00:00
Aske Simon Christensen
46f3efb8eb [dart2wasm] Inlined and optimized some int and double operations.
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>
2023-01-18 13:37:22 +00:00
Johnni Winther
be1a45173a [cfe] Create const variable for ExpressionPattern
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>
2023-01-18 13:08:44 +00:00
Ömer Sinan Ağacan
15c1801eb2 [dart2wasm] Check typed array lengths on allocation
Change-Id: Ie141665b87a4e6923fc799cab97391c10e83230b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279088
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2023-01-18 11:49:26 +00:00
Ömer Sinan Ağacan
4c89d9f6e2 [dart2wasm] Improve Wasm stack error messages
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>
2023-01-18 10:13:19 +00:00
Emmanuel Pellereau
3b97b75a99 Revert "[vm] Extend the hash_table.h templates to support weak sets."
This reverts commit a1dd92d345.

Reason for revert: breaks google (b/265897936)

Original change's description:
> [vm] Extend the hash_table.h templates to support weak sets.
>
> Make the canonical string table weak.
>
> TEST=ci
> Bug: https://github.com/dart-lang/sdk/issues/50648
> Change-Id: I04d84a917bd71469d43483cefba8165628b9a63f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278673
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>

TBR=rmacnak@google.com,asiva@google.com,dart-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I5f5f1dc3327d02165c3cec70b74a61ce9ef9667b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/50648
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279280
Reviewed-by: Emmanuel Pellereau <emmanuelp@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Emmanuel Pellereau <emmanuelp@google.com>
2023-01-18 10:02:06 +00:00
Ömer Sinan Ağacan
5037cc9536 [dart2wasm] Remove duplicate RangeError.checkValidRange implementation
Change-Id: Iaaa969ad21fa70a83b880f43421f381eb1113298
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279160
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2023-01-18 10:01:46 +00:00
Johnni Winther
376886ed1d [cfe] Add caseOffsets to internal SwitchCase node
This prepares for reporting exhaustiveness errors on pattern cases.

Change-Id: I01cdf3f8226a68e4549aed4a85560742bc0804dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279161
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-01-18 09:26:58 +00:00
Ömer Sinan Ağacan
1294fef2bb [dart2wasm] Fix toString of _NaiveInt32x4
Change-Id: I7f091a729c41b94dcf1dc16b643af38c14eab12d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279098
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2023-01-18 09:04:27 +00:00
Ömer Sinan Ağacan
a74dc549cb [dart2wasm] Add more runtime type overrides to typed data lists
Change-Id: I58337c28b8b2ec8767b11952c18c28060573f608
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279090
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2023-01-18 09:00:38 +00:00
Martin Kustermann
163f30f1b5 [vm] Ensure unoptimized compilations do not have an active isolate
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>
2023-01-18 08:45:31 +00:00
Jens Johansen
2cfc0146e1 [analyzer] Keep stats about slow queries around longer
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>
2023-01-18 08:26:58 +00:00
Ryan Macnak
02284fa846 [infra] Create configurations to move the "misc" builders to NNBD.
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>
2023-01-18 07:13:38 +00:00
Kallen Tu
ef147e4c68 [cfe] Report error when mixin classes have a non-Object superclass.
Mixin class modifier cannot be applied to classes whose superclass is
not 'Object'.
Spec for reference: https://github.com/dart-lang/language/blob/master/accepted/future-releases/class-modifiers/feature-specification.md#static-semantics

Change-Id: Ib84ea86d257d2b0a9345d5f91e81b48f599cd2b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278812
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-01-18 03:42:08 +00:00
Nicholas Shahan
1b2ecbda40 [ddc] Cleanup JavaScript files in packaged SDK
- 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>
2023-01-18 01:34:57 +00:00