We're adding these types to `dart:ffi` rather than `package:ffi` so that
they can be used with `FfiNative`s.
Adds `NativeType`s for the following C types:
* unsigned char
* signed char
* short
* unsigned short
* int
* unsigned int
* long
* unsigned long
* long long
* unsigned long long
* uintptr_t
* size_t
* wchar_t
Because the C standard only defines minimum sizes for many of these
types, future platforms might diverge from the typical size even if all
platforms currently agree on a size. To avoid having to reification
later, we define all types as AbiSpecificIntegers rather than typedefs,
even if all current target platforms agree on the size.
Closes: https://github.com/dart-lang/sdk/issues/36140
TEST=tests/ffi/c_types_test.dart
Original patch in patchset 1.
* Removes `Char` for now until package:win32 has rolled to 2.3.8 in
Flutter. https://pub.dev/packages/win32/versions/2.3.8/changeloghttps://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8824468064587445729/+/u/Android_Views_Integration_Tests/stdout
* Adds `c_type.dart` in `ffi_source.gni` which should fix `IntPtr`
missing when analyzing `path_provider_linux`. (However, I was unable
to reproduce the issue locally.)
https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8824468064571399025/+/u/run_test.dart_for_flutter_plugins_shard_and_subshard_analyze/test_stdout
`/tmp/flutter_plugins.KZMNMC/packages/path_provider/path_provider_linux$ ~/flt/engine/src/out/host_debug/dart-sdk/bin/dart analyze --fatal-infos`
Change-Id: I89130cccba285fc9c483bb53f5710a302f2b104f
Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try,dart-sdk-mac-try,dart-sdk-win-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-canary-linux-debug-try,vm-fuchsia-release-x64-try,vm-kernel-gcc-linux-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-mac-debug-x64-try,vm-kernel-mac-release-arm64-try,vm-kernel-nnbd-win-release-ia32-try,vm-kernel-nnbd-win-release-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-win-release-x64-try,flutter-analyze-try,flutter-engine-linux-try,flutter-frontend-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229156
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
In https://dart-review.googlesource.com/c/sdk/+/214020
incremental_compiler_leak_test was renamed to
incremental_compiler_leak_tester temporarily because it started saying
we had possible leaks.
Looking into it now, a number of puzzeling this were found:
* Many SourceLibraryBuilders, SourceClassBuilders etc was alive despite
having been converted to DillLibraryBuilders (etc). They shoudn't be.
* Several Librarys (from kernels AST) came and went between
invalidations.
This all was caused by the VM sometimes keeping things around longer
than it should (probably a variation of
https://github.com/dart-lang/sdk/issues/36983).
This CL fixes it by explicitley nulling things out (and similar).
It re-enasbles the test and updates it to explicitley expecting a
certain number of instances for some classes (e.g. it now expect
0 SourceLibraryBuilders).
To be clear I don't think this has caused any "real" leaks, but:
* having things clear up too late is very confusing.
* we will probably use less memory now.
Change-Id: I3a439f23fc7ef26b156c6164a2c37f6352bc57b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229964
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
This change improves a few implementations of hashcodes in compiler.
Slightly improves AOT compilation time:
gen_snapshot 60.736s -> 58.920s (-2.9%)
(on a large Flutter app, compiled in release mode for arm64).
Also, the same large app can be now compiled with
--hash_map_probes_limit=1500, meaning that all hash maps in
the compiler perform less than 1500 probes when looking for an
element.
This change also adds a test which verifies that kernel compiler
itself can be compiled with --hash_map_probes_limit=1000.
This is a sanity check to ensure we do not have a very
badly distributed hashcode in the compiler.
TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/43299
Change-Id: I7a802709727a33760c4f1d13f7b2c8cb263852d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229940
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This cl makes Fuse an unnamed ordering node, and allows ors / ands
within the fuse. For examples of the benefits of this new Fuse, please
see:
pkg/compiler/test/custom_split/data/fuse_with_and/main.dart
and
pkg/compiler/test/custom_split/data/fuse_with_or/main.dart
Change-Id: I5076abcd617d138b03dc8944737c61645e42e038
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/228685
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
This adds (and tests) the computation of the libraries and their
macros classes/constructors needed for precompilation.
The data isn't used to trigger the precompilation yet.
Change-Id: Iefec9766b405cb3411f277695b315657a2d92b27
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229145
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
The relevant code will be moved to the new file after the Flutter patch
file lists have been updated.
TEST=ci
Change-Id: I37bd1f7124029e35b81dc4913962f2707bc02781
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229905
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
We do not have a byte code interpreter anymore, these runtime entries
are dead.
With enabling inlining for external functions (previous CL), the
`external-name` annotations can also be removed.
TEST=removes dead code
TEST=hashes: runtime/vm/compiler/recognized_methods_list.h
Change-Id: Ibf7f9598cfe52756f6645473f619cf8456f8f593
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229961
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Ideally this would be on MacroClassIdentifier but it isn't very feasible to do, at least not without using mirrors.
Change-Id: I543461fc677da3daeec4172489d1c7d846901382
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229945
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Before this CL, when doing expression compilation we would build scopes
like this:
[exp scope locals] -> [exp scope imports] -> [org scope]
Which means that if one looks up "Foo" in the (first) scope and
something with that name is available both via imports and via
the original scope one would find it via the import.
That's not what we want considering the expression compilation
library should pretend to be the original library.
Instead this CL copies the original scope into the expression
compilation local scope:
[exp scope locals + org scope] -> [exp scope imports]
Meaning that we would find the correct "Foo" if one was defined in
the original library and (another one by the same name is) available
via an import.
Fixes https://github.com/dart-lang/sdk/issues/48169
Change-Id: Ib9e089b465f7da1a4c5799a2165fd06c735ea7da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229904
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Change-Id: Ic3295690f9f4cf2d0a84cfbba59b7cd107c22f4f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230000
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Also allow the main thread to contribute to marking if concurrent marking does not complete before we hit the hard allocation limit.
TEST=ci
Change-Id: Ia6c35cf8b54adc6f1259c6bd03701c2c4cf849c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229284
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Step of releasing 2.16.
Change-Id: I9336289e71bcbb2cc5d298c9fb621aa6d14e99b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/227540
Auto-Submit: Lasse Nielsen <lrn@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
- Added the ClassMemberDeclaration interface to simplify some things and unify builder implementations.
- Adds tests for running macros on top level declarations
- Update the code for executing macros to allow function/variable macros to be ran on methods and fields.
- Other general cleanup and some minor bug fixes
Change-Id: I9bc60740c1b583e39179238cdcd68a78c110c3dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229621
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
For now just making it to not crash.
Change-Id: I415f0c7e17cc959f26f87acd2d662e7f6de3b39b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229780
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
There are quite a few TODOs left in the code, and I'll address them in
future CLs, but this appears to be consistent with the behavior of the
previous implementation and finishes the majority of the refactoring
changes.
Change-Id: I68093f6ac115f8b8b9b10bf93239fe4e2b9c6390
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229660
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Closes https://github.com/dart-lang/sdk/issues/25324
requestFullscreen returns a Promise and takes in an options parameter.
It also can be accessed either via `requestFullscreen` or
`webkitFullscreen` (only necessary for Safari). The bindings should be
updated to reflect this behavior.
Change-Id: I9401b6a1c8b3f9ac370aad8caac8295e0ee358b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229381
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
This is prep work for allowing the main thread to contribute during idle time or when waiting for the sweeper to catch up.
TEST=ci
Change-Id: Ia25c61a448bf5d2dada7d5b494ea08f3526d8740
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/228725
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>