This is the first step in deleting legacy DDC!
* Default all invocations of DDC to run the kernel version.
* Disable all tests that run analyzer DDC.
* Detect the most likely case when invoked with an analyzer
summary and print instruction to update build_web_compilers
dependency.
I will follow up with deletions, and a rename of the test configurations/
builders to reclaim the names (ddc vs ddk, dartdevc vs dartdevk).
Issue #38777
Change-Id: I1477f0274b6b7f345a5e19d2b3f93797c454a09e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127067
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
The nullability of runtimeType must be consistent with the nullability of
a class DeclarationType. Currently, it is always kLegacy. However, this
needs to be set to kNonNullable when the NNBD experiment is enabled.
Note that the nullability of the null instance remains kNullable.
Change-Id: I4ba974c2551c3a7fbd190b02175804090f9b48b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125721
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
Legacy types are considered equal to their non-nullable variant.
Type hash is modified to be consistent with the new definition.
Change-Id: If90f7f13cf77e519d5b90b57d9dbf4988f71be13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126283
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Arguments to simd type constructors were being checked in the bootstrap
natives entrypoint but not elsewhere. Checking for null in Dart code
ensures that we don't accidentally miss these checks in AOT.
The changes to sdk_nnbd are required in order to ensure the number of
arguments passed to native code match the number of arguments from the
non-NNBD implementation (we needed to remove the implicit type args
parameter).
Fixes https://github.com/dart-lang/sdk/issues/39518
Change-Id: Iaf7d8790c154f1e85db613b6dc84004c8013df9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126905
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
This was a case missed when fixing #33891, and fixes#36798
Change-Id: I96e177a7d8020635e191d829afdec45f888658a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127500
Reviewed-by: Alan Knight <alanknight@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
The list being viewed can sometimes itself be a sublist view, but the
default view() constructor doesn't take that into account, and instead the
caller needs to be aware of the case. This change makes all such uses use
offsetInBytes, even in cases that's not needed, so it's trivial to audit
that it's always used correctly. In the cases it's not needed, it just gets
the value 0 and it's a no-operation. In the cases it's needed, it fixes a
bug, such as in _WebSocketProtocolTransformer.add().
Closes#39589
Change-Id: I6e9bd5510f48ce378bdec2c64b56fe789dfb27ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127165
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
The CL also updates a number of pragma annotations to be conditional on
non-product mode.
Change-Id: Ia00b5089d54bbb8f6f6006ef67d65859ab56c132
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127004
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Original change was broken by the fact that DDC expects all types marked as
native have all their superclasses marked as native when the super classes are
compiled.
In this case `MapMixin` from dart:collection was not being marked as native and
the only reason it was working before was that the library dependency enforced
the necessary order.
* Now `MapMixin` is explicitly marked as native.
* Added a test case to use some of the API on `window.localStorage` that is
inherited from the MapMixin class.
Change-Id: I1584bfb86179016ee12c2acc5cfbbe81d086841e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126906
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Change-Id: I82ad71f3db9a7c04d87cad62662760f1b104ad68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126733
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
This is done by collecting all frames on the current stack until an async/async* frame is hit
which has yielded before (i.e. is not in sync-async case).
From there on it finds the closure of the async/async* frame and starts traversing the listeners:
while (closure != null) {
yield_index = closure.context[Context::kAsyncJumpVarIndex]
pc = closure.function.code.pc_descriptors.LookupPcFromYieldIndex(yield_index);
<emit pc in frame>
closure = closure.context[Context::kAsyncCompleterVarIndex]._future._resultOrListeners.callback;
}
Bug: https://github.com/dart-lang/sdk/issues/37668
Change-Id: I97030d22e529bf8a74ecd30a8a2589cfe57ad330
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122644
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
The compile_platform template assumes that the output will be in the root-out-dir, and because of that the generated .deps file contains relative paths that only work if the output is in that folder.
It would be nice to fix compile_platform to be more flexible about this, but for now moving the output up fixes the issue that modifications in the sdk were not triggering a rebuild.
Change-Id: Ifc1e7adb23d6911a9f71c341b7968e0a9b1d4973
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126122
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
This reverts commit 3c9e924073.
This CL was breaking the internal build.
Change-Id: Ic4e6df070f2a87ac88ef97f0e6b07d53c13ceadc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125925
Auto-Submit: Vijay Menon <vsm@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
Reviewed-by: David Morgan <davidmorgan@google.com>
This will make it possible to use the script to create a patched sdk
for dart2js and the vm (some followup needed), which will be useful
to migrate their libraries to nnbd.
In the future, we should be able to leverage this new logic to
write tests that ensure our sdk is warning-free (there are > 80 real
warnings today even on the non-nnbd sdk)
In detail, this CL includes:
* loading the libraries data from libraries.json, this removes the need for a
hand-crafted libraries.dart that replicates the data in libraries.json.
* auto-generates a libraries.dart in the patched sdk that can be used to run
dartanalyzer or to compile an sdk with dartdevc-legacy.
* script simplifications in patch_sdk.dart
* removed tracking of modification stamps. This didn't appeared to be
used by the ninja rules. I believe it was used to reduce local
iteration cycles when we were first developing the sdk itself.
* use Uri directly instead of package:path - this simplifies things,
especially since the libraries_specification is Uri-based as well.
* switch to use package:args for parsing options
* added an option to merge part files in a single file. I've noticed that the
analyzer provides some false positive errors in part files, but once merged
they are no longer shown. In particular, we are clearly hitting limitations of
dartanalyzer on the patched sdk. At this time the old patch-script generated
an sdk with 1500 warnings, this new script reduces it to 500 (not sure why),
with merging of part files it goes down to 80.
Change-Id: I6bbaf92ef4554f00c8bf6b38d19bf79d44fb3e94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125780
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Update DartTime.parse to support arbitrary precision fractional seconds. So it now conforms to ISO8901 and RFC3339 standards.
Closes#24205Closes#39350https://github.com/dart-lang/sdk/pull/39350
GitOrigin-RevId: 66f15b6e646a65b7955c7b617647b8edfd680481
Change-Id: Ife2211e6cce5922b59cdde0d30ed3ef887cffcf9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124903
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Change-Id: I5bcb7c40be12ee1dc887620281b4807469d67bbb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125729
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
This moves ddc to use the same logic to compile the sdk.dill as all other
backends. This will also enable us in a subsequent CL to generate the dart_sdk.js
files from a precompiled .dill file, and hence improve overall caching on local
rebuilds.
Change-Id: I02e178baa5497a5bee2de42e3423176ca97ceaef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125446
Reviewed-by: Nicholas Shahan <nshahan@google.com>
This is some preparation for the NNBD migration where the existing downcasts and
possible nullable accesses will be errors.
- Downcasts have been replaced with covariant parameters.
- Local variables have either been declared with a specific type or given
initial values so that they can become non-nullable in the future.
- Remove a pointless `is! int` type check. The parameter is an int.
Change-Id: I3a0358d83a181eee5576c2062128d89d197ba3e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125303
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Change-Id: Ie4d5164759c1d4a8c19e216bfac50b116271f1a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125342
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Setting the `enableTimelineLogging` property of `HttpClient` to true results in
timeline events being created for HTTP connections and HTTP requests.
Timeline events contain general connection information, including:
- Request type
- Status code
- Request / response headers
- Cookies
- Non-sensitive proxy information
- Relevent error messages for failed connections
Change-Id: Ibe16a312ab5398c9ae886ea07bea5ca70b63e440
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123540
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
This is practically a copy of the change in
https://dart-review.googlesource.com/c/sdk/+/118040 but applied to the non-nnbd
sdk.
Even though there is no intent to run the non-nnbd sdk with the non-nullable
experiment, we need to add this annotation because of how we
intend to gradually start testing NNBD. The libraries.json under
sdk_nnbd is allowed to point to libraries under the non-nnbd sdk in order to
temporarily build without errors until all patch files are migrated and all CFE
issues are addressed.
Change-Id: I53c1123a8d86c10695832a8a0ad35adb7b4d92fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125181
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
This is some preparation for the NNBD migration where the existing downcasts and
possible nullable accesses will be errors.
- Downcasts have been replaced with covariant parameters.
- Local variables have either been declared with a specific type or given
initial values so that they can become non-nullable in the future.
Change-Id: Ie871095ee26771833318d1dfce2b5986afaf8c69
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125227
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Walk through http headers class. Since http header uses case-insensitive headers, noFolding() implicitly assumes field name is lower-cases. It is used to compare to lower-cases field name. Validate the field name before it is stored and also add a test case for noFolding().
Change-Id: I58f8a0ed0d366281e1e7a8c60fd46ff81c8ee796
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121773
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
This unblocks changing this logic for NNBD since they are now forked.
The custom logic for FutureOr has been problematic to represent in the patch
files. They need to be callable from the class but they can't be static methods
in Dart because they reference the generic type argument. It is a design quirk
of the runtime representation that the type argument is captured in the wrapping
closure and in scope that allows the existing implementation to work.
In a future change I will thread an NNBD flag through the compiler to emit
different logic for the FutureOr type tests when running with NNBD.
Change-Id: I9463e3cd375f8098592ea84e956e833952f41bb3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123921
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
- Cache the Rti in a property on the constructor.
- Put the dodgy closure logic behind the cache to move the _isClosure
test off the fast path.
- Allow different closure.runtimeType.toString() results. The old result is not
worth preserving because it shows a 'type' that does not otherwise exist. The
actual closure.toString() is still informative.
Change-Id: I7f30e5975ce289fa6b85a22c65f76e80055ef548
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124021
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
This CL
* adds a GN flag "include_dart2native" off by-default (switched on explicitly for our GN build)
* ensures every GN build of the "create_sdk" target has a working dart2native (except ia32)
* removes not-working dart2native script from ia32 dart-sdk (no AOT support in ia32)
* removes the "dartaotruntime" GN target, since it is the same as "dart_precompiled_runtime"
This should ensure every downstream consumer of the "create_sdk" GN target will
have a working version of dart2native.
For the particular "dart-sdk" we create on dart-sdk-{linux,windows,mac}
we will override the default AOT compiler&runtime with the product mode,
which produces smaller AOT snapshots and has smaller AOT runtime (making
the native executables significantly smaller)
Change-Id: Ib5042589297cdb055c41dc56abdff86a4612ef5c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123724
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
Since we cache everything on the first call to
`_computeLibraryMetadata`, if we haven't called `trackLibraries` for
some module before the first time we fetch libraries then it will never
be available.
Change-Id: If0c8d5835fb95e244797631d6452bd154eec30e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120936
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
This can be used in combination with `dart:ffi` to allow C code to post
messages asynchronously back to Dart.
Issue https://github.com/dart-lang/sdk/issues/38544
Change-Id: I0293337785a3555b4147e25f1a904f333da62c52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118565
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Create Rti objects with an initial 'is' method that replaces the
'is' method with a specialization. This moves the specialization of
the 'is' method until the Rti is used in a test, which should slightly
reduce the Rti creation cost, and permit more ambitions specializations.
Also add specialization of checks for top types.
Change-Id: I4218a73f2916ddba23991d11db350ee4b36be354
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121860
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Passed library name instead of URI to "checkDeferredLoad" in the
generated JS. The URI was only used to report errors on library load at
runtime - the user should be able to to find the URI in the dart import
statemement instead.
Closes https://github.com/dart-lang/sdk/issues/37623
Notes:
- The URI is also stored in the deferred library's source map. If finding
this information on load failure is too inconvenient, we might consider
storing the URI in the main source map as well, and making sure that the
URI is loaded from the source map on load failure at runtime, for better
error reporting for users who have access to the source maps.
- Not sure how much work is needed for this to be done, so leaving this
until the need arises.
Change-Id: I90caa560e7c57c61e810b9ca4cfc648cddba5905
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122200
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Anna Gringauze <annagrin@google.com>
readIntoSync does not document what the return type of the function is, though it could be infered from the behavior of the non-sync method.
Change-Id: Ie62b5b4e5ea469a0dc841219f1515ac917325355
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122409
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Jonah Williams <jonahwilliams@google.com>
* Rely on type promotion instead.
* The is! type promotion isn't working in the CFE yet.
Change-Id: Ia4c8b4bcbac50cd0ab07c60f7440ef3837675b7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122179
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Will be used for runtime subtype changes in future CLs.
Change-Id: I53ba10c994f13300541b3ae7a9e14d52c3836771
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121821
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
- Start the kernel isolate only when a compilation is needed
- Remove some dead code and state in the loader path
Change-Id: I39e14cd79cda18b155af6334a11635c44e2fc11f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121923
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
https://dart-review.googlesource.com/c/sdk/+/113904 previously "fixed"
printing for the old RTI by only using the new implementation if
USE_NEW_RTI was passed. This change fixes the root cause of the printing
failures, so we can fully switch to the new implementation.
Change-Id: Iaca56566ebebbaaad15d312c3e57204859417a9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121903
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Removes deprecated `load`, `store`, `allocate`, `free`, and `asExternalTypedData` methods from Pointer because these have been replace by extension methods and `package:ffi`.
Closes: https://github.com/dart-lang/sdk/issues/38860
Change-Id: I76d21bcfd2fdd6ee504a51db821345125beb92d2
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-reload-mac-release-simdbc64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-precomp-mac-release-simarm_x64-try,dart-sdk-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121708
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Uses a temporary representation for nullable and legacy types that is subject to
change.
Updated subtype test to include expectations when running with strict mode
checks.
Does not yet include support for:
* Required named parameters
* Weak checking modes (currently only strict checking)
* Caching the results of a check for a later lookup
Issue: #38128
Change-Id: I60935c071affdb56c368e9555fce8f86931103e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119537
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Isolates are not supported at all on the web anymore. Remove references
to a legacy limitation on the web.
Change-Id: I661c04068e8c77435de91638017c86452441fa56
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121777
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
This has coupled changes in package:ffi and package:tflite_native which are pinned in DEPS.
This CL includes the required analyzer changes from https://dart-review.googlesource.com/c/sdk/+/121647.
Issue: https://github.com/dart-lang/sdk/issues/38611
Change-Id: I712a886fd28ce0a2954fc42c90e1dfa495057732
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-reload-mac-release-simdbc64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-precomp-mac-release-simarm_x64-try,dart-sdk-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121422
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Change-Id: Iace87105cf2a1fa4aacc579b07c9760329c7d160
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119420
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Terry Lucas <terry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
This changes the API docs to (1) be specialized to the specific types and (2) have more precise wording.
Change-Id: I14fa37bd162f846c19e62443c53dd051eaa62ad3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121427
Reviewed-by: Kathy Walrath <kathyw@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
If parent is a param in the TimelineTask.withTaskId() constructor, we have the possibility of running into this situation:
TimelineTaskA - id 0
TimelineTaskB - id 1
TimelineTaskC - id 2 - parentId 1
TimelineTaskD - id 0 - parentId 2 (this task created with TimelineTask.withTaskId(0, parent: C))
TimelineTaskE - id 3 - parentId 0 (now who is the parent of E? D or A?)
If we do not allow the user to specify parent in the withTaskId() constructor, we remove the possibility of this clash. This clash happens because the user was able to inject an event with id 0 into an async tree defined by the parent parameter.
By removing the parent parameter from the withTaskId() constructor, we can rely on different sources of truth for the different TimelineTask constructors.
- If taskId is specified via TimelineTask.withTaskId(), then that is the source of truth for inferring the async event tree (events with the same async id are in the same async tree).
- If parent is specified via TimelineTask(parent: parent), then that is the source of truth for inferring the async event tree.
- If neither taskId nor parent are specified (e.g. TimelineTask()), we default to timestamp inference.
Change-Id: I491a20cf1d1aaea744ab92e56602269390e73fb0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121680
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
Release notes: https://github.com/dart-lang/dartdoc/releases/tag/v0.28.8
This also reverts the workaround in ff23f546db by dacoharkes@.
Instead of crashing, dartdoc v0.28.8 displays some fairly spammy warnings that the functionality is unimplemented.
warning: Comment reference resolution inside extension methods is not yet implemented, from dart-ffi.DoublePointer.value: Field value.location
warning: unresolved doc reference [address], from dart-ffi.DoublePointer.value: Field value.location
warning: unresolved doc reference [Double], from dart-ffi.DoublePointer.value: Field value.location
warning: unresolved doc reference [value], from dart-ffi.DoublePointer.value: Field value.location
warning: unresolved doc reference [Float], from dart-ffi.DoublePointer.value: Field value.location
Issue: https://github.com/dart-lang/sdk/issues/38786
Change-Id: Ie8fef572f5d50bd7f031b498c0cd066a4765c493
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121644
Commit-Queue: Janice Collins <jcollins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Janice Collins <jcollins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Fixes imports (the order of patch files is not defined, so the imports need to be equal in all files).
Change-Id: I2dc16f4930253b25c7ae6ab6b0699581f9e2dd46
Cq-Include-Trybots: luci.dart.try:flutter-engine-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121428
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Follow up of https://dart-review.googlesource.com/c/sdk/+/117547
This gets rid of unnecessary allocations in hot loops with indexed loads and stores.
Issue: https://github.com/dart-lang/sdk/issues/38172
Change-Id: I37a4b1aba00084e465d47cce79bb9963e1afc104
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-mac-debug-simdbc64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-reload-mac-release-simdbc64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-precomp-mac-release-simarm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119645
Reviewed-by: Martin Kustermann <kustermann@google.com>
Also clean up test/benchmark/sample code using nullptr and fix pubspec.yaml in the SQLite sample.
Fixes https://github.com/dart-lang/sdk/issues/37362
Change-Id: I6fa0522374af28020ef8f096ac22b23712aedb5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121122
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Added ability to recognize a MethodMirror to be a mirror of an extension member
Added ability to recognize a VariableMirror to be a mirror of a static
extension field.
Change-Id: I56715a491bba0d8cafb2796ebb755bd339e147c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120760
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Merge the two copies of a function that convert a JS promise to a Dart
Future. Reuse this function for the specialized case of converting to a
`Future<Map>`.
- Rename `convertNativePromiseToDartFuture` to the shorter and more
widely used `promiseToFuture`. Update one existing use of the old
name.
- Make the method generic to match the previous implementation of
`promiseToFuture`.
- Update the code generator template to not emit the second copy of the
method.
- Use the existing `promiseToFuture` with a `.then` call to implement
`promiseToFutureAsMap`. Update the doc comment to follow best
practices.
- Duplicate all above changes to nnbd SDK copy.
Change-Id: Ib3bbf17477efec3666b24fd4019ca8ce68f0b5b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119174
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Original CL in patchset 1.
Fix for simdbc in patchset 4.
Fix for arm32 precompiled in: https://dart-review.googlesource.com/c/sdk/+/120660/
This CL optimizes Pointer operations in hot loops for Pointer<NativeInteger/NativeDouble/Pointer> (not for structs).
Design: go/dart-ffi-pointers-il
It provides roughly a 100x speedup for the FfiMemory benchmark. The next 5x speedup is to get rid of allocations due to `load` and `store` not being inlined.
FFI API is changed to enable optimizations:
* Disable dynamic invocations of Pointer.load / Pointer.store.
* Disallow implicit downcast of argument passed to Pointer.store.
* Stop zeroing out Pointer.address on Pointer.free().
Issue: https://github.com/dart-lang/sdk/issues/38172
Related issues:
Closes: https://github.com/dart-lang/sdk/issues/35902 (Disallowing dynamic invocations of Pointer ops.)
Closes: https://github.com/dart-lang/sdk/issues/37385 (Function variance checking)
Change-Id: I3921a595fd05026d6ca565ace496771d7c1d877b
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-mac-debug-simdbc64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-reload-mac-release-simdbc64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-precomp-mac-release-simarm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120661
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
This CL optimizes Pointer operations in hot loops for Pointer<NativeInteger/NativeDouble/Pointer> (not for structs).
Design: go/dart-ffi-pointers-il
It provides roughly a 100x speedup for the FfiMemory benchmark. The next 5x speedup is to get rid of allocations due to `load` and `store` not being inlined.
FFI API is changed to enable optimizations:
* Disable dynamic invocations of Pointer.load / Pointer.store.
* Disallow implicit downcast of argument passed to Pointer.store.
* Stop zeroing out Pointer.address on Pointer.free().
Issue: https://github.com/dart-lang/sdk/issues/38172
Related issues:
Closes: https://github.com/dart-lang/sdk/issues/35902 (Disallowing dynamic invocations of Pointer ops.)
Closes: https://github.com/dart-lang/sdk/issues/37385 (Function variance checking.)
Change-Id: I96058d8b5b49052eb6999f084372e6f08b4f6f17
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117547
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This reverts commit e866f043cf.
Reason for revert: Breaks google3.
Original change's description:
> [dartdevc] cleaning up unused web files
>
> Dependent on these google3 changes: https://critique.corp.google.com/#review/272749649
>
> Change-Id: I9e89142cd5b2a619acfc35badb9cf3c549b3be9c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119587
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Commit-Queue: Mark Zhou <markzipan@google.com>
TBR=scheglov@google.com,vsm@google.com,markzipan@google.com
Change-Id: I1db094d94d699d4d18c4091f57c7cb775eb95dd5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120040
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
Specifying a parent will result in an argument being added to 'start'
events for that TimelineTask named 'parentId', which contains the task
ID of the parent. This is to be used by DevTools to show relationships
between asynchronous tasks that are not currently supported in the trace
event format used by Catapult.
Change-Id: Id0a030f018f5a6ac1e3b0ef2e89c1cd732790f02
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119520
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
Reviewed-by: Siva Annamalai <asiva@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>
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>
Working on a fix to not force http headers to be lowercases.
Most of headers are listed in http.dart like HttpHeaders.acceptHeader. But there are some places which use hard code string("Accept") to refer to certain header.
Replace raw strings for consistency.
Change-Id: Ieba77428173123b7b144885ab5c92642d63de580
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118649
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Fixes#38311
Add a new utility method `isDartFunction` to check whether an object is
a Dart function as opposed to a native JS function by checking if it has
a `_runtimeType` attached.
When wrapping with `allowInterop` skip wrapping objects that are not
Dart functions.
Change-Id: I4e199f255db46d3825cccc3af9a72b7711e27626
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118476
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
This change adds the required support to benchmark DDC just like dart2js.
The ddb tool gains the following options:
--compile-vm-options=VM-OPTIONS
The value of the DART_VM_OPTIONS environment variable set when running
dartdevc. This option is required to measure the memory use of
dartdevc while compiling.
--packages=PACKAGES-FILE
The .packages file to use when compiling. This option is required for
special benchmarks with a .packages in a subdirectory and is generally
useful.
--out=OUTPUT-FILE
Write the compiled javascript to this path and the other generated
files along it. This option makes the benchmark configuration easier
and is generally useful.
The dartdevc and dartdevc.bat scripts in the released Dart SDK now gains
support for the DART_VM_OPTIONS environment variable, just like the dart2js
scripts. This feature is needed to measure the memory usage of the Dart VM
executing dartdevc.
tools/bots/try_benchmarks.sh now tests that ddb can compile and run
benchmarks using the needed features.
Change-Id: Ib1ef07b0888a8c0cf900fe2fbb5697aab733db08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118440
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
Mostly fixes unresolved references but fixes some other small issues as well
Bug: https://github.com/dart-lang/sdk/issues/37880
Change-Id: I5747c3c90d66d23859e021fc6bd07cc7cd9700d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103741
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
- Move all VM patch files from the lib directory to
sdk/lib/_internal/vm/lib
- Move all VM patch files from the bin directory to
sdk/lib/_internal/vm/bin
- Fixed paths for above patch files in libraries.yaml file.
- Created copies of these patch files in sdk_nnbd directory
- Cleaned up *.gni files by removing the unused dart patch files lists.
Change-Id: I3109d22f3b729a073a6b40175a0d29162a455830
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117685
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Fixes the changes to assembly snapshot writer in SIMARM_X64 mode. This unfortunately can't be tested until the ELF loader is available.
Take 2 is in patchset 1.
Change-Id: Ib8b067dd4f09dcba3b142705e9cb4dfbf4e3eb53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117726
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
and remove all references to it in tests and the SDK build scripts.
Change-Id: I728770c460042596ddd14efecdc52bcf0580f592
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117584
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Currently this only supports functions that take and return numeric
types. Byte arrays, and callbacks will come later, in a separate
wrapper package.
Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: I7bb82be83cbbb6062736b3e958f89d021f1af4bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114586
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
processIncomingMessage() was creating List<int> to hold uncompressed bytes,
which is very wastefull if size of the message is large (spending a word
for each byte).
Changed processIncomingMessage() to use BytesBuilder for uncompressed bytes.
This fixes flaky out of memory failure on service/get_vm_timeline_rpc_test with
bytecode in dartk-optcounter-linux-release-ia32 configuration. In that test size of
uncompressed message exceeded 130MB, causing 1GB memory allocation (512MB List
was expanded).
Change-Id: Ic5a78a13bd431f5ad97496907a84a3f7ba01c1fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117121
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
- Drop optional `new`.
- Rename `constr` to `ctor` for consistent variable names.
- Use spaces around `=` in a JS expression where the DDC copy was
already doing so.
- Add explicit return type of `void` on `operator []=`.
- Fix typos that were already fixed in DDC copy.
- Remove unnecessary organizational comment.
Change-Id: I85aff3429b7b9358dd4866a570dddbe9b26a5d48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116826
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
Fixes#38280, Fixes#24576
- Add "Low level" to the library doc comment and add a sentence about
preferring to use `package:js`.
- Add doc comments on `allowInterop` and `allowInteropCaptureThis`.
- Remove the docs that discuss what dart2js "may" do in the future.
- Tweak some comments on classes to use a noun over a verb - "A proxy
on" over "Proxies".
Cleanup:
- Use `///` consistently.
- Ensure the docs are identical between the two copies of the file, this
minimizes the diff.
Change-Id: I7f904d77b2d9dd537201dd53a29d7ef74289aa86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116555
Reviewed-by: Kathy Walrath <kathyw@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
This matches the behavior in the Chrome and Fuchsia tracing macros.
Change-Id: I7e5759409af5262e6e2596384c67a2eb70d48cd2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114545
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Towards #33134
Functions called through allowInterop or allowInteropCaptureThis wrappers will
use the `dart.dcall` code path which checks argument counts and types. This will
make these calls stricter to match dart2js semantics.
In the long term we want to make dart2js accept _extra_ arguments, at which
point we'll also want to make DDK loose in the same way. For now we want DDC
to be strict.
Change-Id: Ibf1dabf141273229770f8328f9ca7bfb9f4fb5db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113754
Commit-Queue: Nate Bosch <nbosch@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
The original change is in Patchset 1.
The dependency contains the fix for the non-bare-instructions bot.
Change-Id: Iab02ab0736a2ee9144b667d2777ca526341b2a36
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-android-release-arm-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-bare-linux-release-x64-try,vm-kernel-precomp-mac-debug-simarm_x64-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115241
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>