Sorting is 2-3x faster for a 1024 element list and simple comparison function.
Change-Id: Iecb4dceb7155e430fcc2c0ddef977003d747ab9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315760
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
This change is almost trivial. The closure is stored on the callback's
RawReceivePort, not in the VM. So we can basically just remove the CFE
check and it pretty much works. The only problem is that we can't set
function.FfiCallbackTarget anymore, so most of the CL is dealing with
that.
A few places were deciding whether an FFI trampoline was a call or a
callback based on whether function.FfiCallbackTarget() was null. But
now the target will be null for async callbacks. So instead I've added
a new value to the FfiCallbackKind enum (and renamed it), and changed
those checks.
Sync callback closures will be a separate CL, because they're more
complicated.
Bug: https://github.com/dart-lang/sdk/issues/52689
Change-Id: I8e5dfb557362e679f66195b735c3c382e6792840
TEST=async_void_function_callbacks_test.dart
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316160
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Following the refactoring we started in previous CLs, this splits string
and int patch files into (1) patch files that only patch and don't add
implementation classes (2) files for implementation classes (3) helpers.
Changes:
- `string_patch` is split into `string.dart` and `string_patch.dart`.
- VM's `integers_patch.dart` copied as `int_patch.dart` and updated.
This was needed as `integers_patch` requires VM's library paths in
imports.
We needed to copy this file to be able to optimize based on
dart2wasm's implementation classes. However in this CL we copy the
file as-is and update import paths.
- VM's `string_buffer_patch.dart` copied to be able to use the string
implementation classes from the new library.
`string_buffer_create.dart` is merged ino `string_buffer_patch.dart`.
- `getHash` and `setHash` to set object identity moved to
`object_helper.dart`, to be able to use in string implementations.
- Redundant `new` keywords in copied files removed.
One TODO added in `string_buffer_patch.dart` when allocating a new
string to the buffer:
// _parts = _GrowableList.withCapacity(10)..add(str);
// TODO(omersa): Uncomment the line above after moving list
// implementations to a library.
_parts = [str];
We can enable the old code again after moving list implementations to a
library.
Change-Id: Ice5dba40b3ba894797028987d4b42cb0c0f0c230
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315821
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
The change in [0] has propagated now everywhere, so we can use
`utf8.encode()` instead of the longer `const Utf8Encoder.convert()`.
As the checked-in SDK has been rolled to include [0] we can now rely on
the better return type.
[0] https://github.com/dart-lang/sdk/issues/52801
TEST=ci
CoreLibraryReviewExempt: Minor cleanup.
Change-Id: I2c0144023e03b2c265582d83a7fb9469b02f1570
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313563
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Define debugger runtime API so the debugger can display objects without knowing DDC implementation details.
- Add new DDC debugger runtime API in `debugger.dart`
- Add helpers for getting some type information in new and old type systems
- Add tests
Closes: https://github.com/dart-lang/sdk/issues/52773
Change-Id: I8efa4cacebb0d73ef58b5360979089cba2039379
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311154
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Anna Gringauze <annagrin@google.com>
- Use `array.copy` and `array.fill` when possible.
- Use the Wasm array directly (instead of `[]` and `[]=`) when possible
to avoid redundant bounds checks.
- `_GrowableList.insert` is rewritten to avoid a redundant write when
the element is not added to the end.
- Remove redundant bounds checks when calling `Lists.copy`.
Change-Id: I08d96b56201cbb4ff24ca969b7fde8bcc1315e4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315120
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
Several locations in the core SDK contain `!` or `?.` operations that
will become unnecessary once the language feature `inference-update-2`
(which provides field promotion) is enabled. For example, in this
method from the class `_IOOverridesScope`, `_previous` refers to a
private final field, so after field promotion is enabled, the test `if
(_previous != null)` will promote it, and the `!` in
`_previous!.createDirectory` will become unnecessary:
Directory createDirectory(String path) {
if (_createDirectory != null) return _createDirectory!(path);
if (_previous != null) return _previous!.createDirectory(path);
return super.createDirectory(path);
}
Since the SDK is built in a mode where warnings like this result in
build failures, we need to temporarily change the logic into a form
where the same promotion effect is achieved through local variable
type promotion:
Directory createDirectory(String path) {
if (_createDirectory != null) return _createDirectory!(path);
var previous = _previous;
if (previous != null) return previous.createDirectory(path);
return super.createDirectory(path);
}
(Note that `_createDirectory` doesn't need to change, because it is a
non-final field, so it won't undergo promotion).
After `interface-update-2` has been enabled, I will make a follow-up
CL that removes the local variables and simply takes advantage of
field promotion, e.g.:
Directory createDirectory(String path) {
if (_createDirectory != null) return _createDirectory!(path);
if (_previous != null) return _previous.createDirectory(path);
return super.createDirectory(path);
}
Note: in theory it would be possible to do all this in a single step,
by atomically enabling field promotion and changing the SDK in the
same CL. However, I prefer breaking it up into stages like this,
because the act of flipping a langauge flag on tends to have
wide-ranging consequences, so I want the CL that does the flip to be
as small as possible.
Change-Id: I421c7661348bf407093ee64ef7f9dbfc0c04a353
Bug: https://github.com/dart-lang/language/issues/2020
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/314500
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Because it can, and therefore should.
Also update the methods to use `??` more, which should be
safe now that unsound null safety is no longer a thing.
Avoid chains of override-scopes by inlining the parts of the
outer scope which is not overridden.
Fix two bugs:
* `statSync` was checking whether `_stat` was non-`null`, then
calling `_statSync`.
* `socketConncet` did not pass source port to function.
CoreLibraryReviewExempt: Affects only VM.
Change-Id: I9d4971271305c52948d334f69ae71d750587ed97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/314880
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
New typed data implementation that optimizes the common cases.
This uses the best possible representation for the fast case with a
representation like:
class _I32List implements Int32List {
final WasmIntArray<WasmI32> _data;
int operator [](int index) {
// range check
return _data.read(index);
}
void operator []=(int index, int value) {
// range check
_data.writeSigned(index, value);
}
...
}
This gives us the best possible runtime performance in the common cases
of:
- The list is used directly.
- The list is used via a view of the same Wasm element type (e.g. a
`Uint32List` view of a `Int32List`) and with aligned byte offset.
All other classes (`ByteBuffer`, `ByteData`, and view classes)
implemented to be able to support this representation.
Summary of classes:
- One list class per Dart typed data list, with the matching Wasm array
as the buffer (as shown in the example above): `_I8List`, `_U8List`,
`_U8ClampedList`, `_I16List`, `_U16List`, ...
- One list class per Dart typed data list, with mismatching Wasm array
as the buffer. These classes are used when a view is created from a
list, and the original list has a Wasm array with different element
type than the view needs. `_SlowI8List`, `_SlowU8List`, ...
These classes use `ByteData` interface to update the buffer.
- One list class for each of the classes listed above, for immutable
views. `_UnmodifiableI32List`, `_UnmodifiableSlowU64List`, ...
These classes inherit from their modifiable list classes and override
update methods using a mixin.
- One `ByteData` class for each Wasm array type: `_I8ByteData`,
`_I16ByteData`,
...
- One immutable `ByteData` view for each `ByteData` class.
- One `ByteBuffer` class for each Wasm array type: `_I8ByteBuffer`,
`_I16ByteBuffer`, ...
- A single `ByteBuffer` class for the immutable view of a byte buffer.
We don't need one immutable `ByteBuffer` view class per Wasm array
type as `ByteBuffer` API does not provide direct access to the buffer.
Other optimizations:
- `setRange` now uses `array.copy` when possible, which causes a huge
performance win in some benchmarks.
- The new implementation is pure Dart and needs no support or special
cases from the compiler other than the Wasm array type support and
intrinsics like `array.copy`. As a result this removes a bunch of
`entry-point` pragmas and significantly reduces code size in some
cases.
Other changes:
- Patch and implementation files for typed data and SIMD types are split
into separate files. `typed_data_patch.dart` and `simd_patch.dart` now
only contains patched factories. Implementation classes are moved to
`typed_data.dart` and `simd.dart` as libraries `dart:_typed_data` and
`dart:_simd`.
Benchmark results:
This CL significantly improves common cases. New implementation is only
slower than the current implementation when a view uses a Wasm array
type with incompatible element type (for example, `Uint32List` created
from a `Uint64List`).
These cases can still be improved by overriding the relevant `ByteData`
methods. For example, in the example of `Uint32List` view of a
`Uint64List`, by overriding `_I64ByteData.getUint32` to do a single read
then requested bytes don't cross element boundaries in the Wasm array.
These optimizations are left as future work.
Some sample benchmarks:
vector_math matrix_bench before:
Binary size: 133,104 bytes.
MatrixMultiply(RunTime): 201 us.
SIMDMatrixMultiply(RunTime): 3,608 us.
VectorTransform(RunTime): 94 us.
SIMDVectorTransform(RunTime): 833 us.
setViewMatrix(RunTime): 506 us.
aabb2Transform(RunTime): 987 us.
aabb2Rotate(RunTime): 721 us.
aabb3Transform(RunTime): 1,710 us.
aabb3Rotate(RunTime): 1,156 us.
Matrix3.determinant(RunTime): 171 us.
Matrix3.transform(Vector3)(RunTime): 8,550 us.
Matrix3.transform(Vector2)(RunTime): 3924 us.
Matrix3.transposeMultiply(RunTime): 201 us.
vector_math matrix_bench after:
Binary size: 135,198 bytes.
MatrixMultiply(RunTime): 42 us.
SIMDMatrixMultiply(RunTime): 2,068 us.
VectorTransform(RunTime): 12 us.
SIMDVectorTransform(RunTime): 272 us.
setViewMatrix(RunTime): 82 us.
aabb2Transform(RunTime): 167 us.
aabb2Rotate(RunTime): 147 us.
aabb3Transform(RunTime): 194 us.
aabb3Rotate(RunTime): 199 us.
Matrix3.determinant(RunTime): 70 us.
Matrix3.transform(Vector3)(RunTime): 726 us.
Matrix3.transform(Vector2)(RunTime): 504 us.
Matrix3.transposeMultiply(RunTime): 53 us.
FluidMotion before:
Binary size: 121,130 bytes.
FluidMotion(RunTime): 270,625 us.
FluidMotion after:
Binary size: 110,674 bytes.
FluidMotion(RunTime): 71,357 us.
With bound checks omitted (not in this CL), FluidMotion becomes
competitive with `dart2js -O4`:
FluidMotion dart2js -O4:
FluidMotion(RunTime): 47,813 us.
FluidMotion this CL + boud checks omitted:
FluidMotion(RunTime): 51,289 us.
Fixes#52710.
Tested: With existing tests.
Change-Id: I33bf5585c3be5d3919a99af857659cf7d9393df0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312907
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
Now that we no longer need to put boxes in `core.dart`, it makes sense to move them out of `core.dart` so that we can patch these classes and their helper functions. This CL moves `BoxedInt` and `BoxedDouble` out of core patch, and moves some of their intrinsics / helpers to side libraries.
Tested: Dart2Wasm internal refactor of patch files.
Change-Id: I1dac95089a8bd9e2c8ee4f467a0d6f2792f9d665
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313900
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
In the new type system, allow native types that have a "peer" on
the Dart side to use that Dart type as their reified type.
This matches the semantics of the old type system for these types.
Change-Id: I62bf6cb1654d33549a6ea2c757e7e65fa81677a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313700
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
The purpose of the wasm_js_compatibility target is to facilitate experiments with a JS compatibility mode for Dart2Wasm. Initially, we're just going to focus on typed data, but this will give us a place to experiment with moving List and String to JS as well.
In addition, someday down the road we hope to experiment with two additional compatibility changes:
1) Exclusively using double for all Dart numbers
2) Allowing undefined to flow as null.
The two major benefits of this approach are:
1) Much faster JS interop
2) To make it easier to bring up Dart2JS applications on Dart2Wasm
The only downside will be access overhead on the Wasm side, but the JS builtins proposal could potentially bring us close to parity with Wasm builtins someday.
Tested: Wasm specific trivial refactor.
Change-Id: I2c09426b6999507c1de6e584e9bc7072a088bda9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313240
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Reviewed-by: William Hesse <whesse@google.com>
This is a reland of commit 16fcfe7eae
Original change's description:
> [dart:js_interop] Remove Object.toJS and JSNumber.toDart
>
> Modifies JSBoxedDartObject reified type on JS backends and also
> modifies JSBoxedDartObject.toDart now that a proper box is introduced.
> Also uses a JS symbol in JSBoxedDartObject.toDart for a property
> check so that different Dart apps don't accidentally share Dart
> objects. It's now an error to call this function on non-boxed objects.
>
> Fixes a type issue where creating a new object literal with the JS
> foreign function was resulting in dart2js thinking toJSBox would
> always throw. Changing the typeDescription to PlainJavaScriptObject
> instead of =Object fixes that issue.
>
> CoreLibraryReviewExempt: Backend-specific library.
> Change-Id: I5cfb1f32ff4328fafdf9831b0d8da806c39391d9
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/309082
> Reviewed-by: Joshua Litt <joshualitt@google.com>
> Commit-Queue: Srujan Gaddam <srujzs@google.com>
CoreLibraryReviewExempt: Reland.
Change-Id: If6b190f12bdf840b0259c5739f50d9bdcd27fd47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313600
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
This reverts commit 16fcfe7eae.
Reason for revert: Flutter changes haven't landed to google3 yet.
Original change's description:
> [dart:js_interop] Remove Object.toJS and JSNumber.toDart
>
> Modifies JSBoxedDartObject reified type on JS backends and also
> modifies JSBoxedDartObject.toDart now that a proper box is introduced.
> Also uses a JS symbol in JSBoxedDartObject.toDart for a property
> check so that different Dart apps don't accidentally share Dart
> objects. It's now an error to call this function on non-boxed objects.
>
> Fixes a type issue where creating a new object literal with the JS
> foreign function was resulting in dart2js thinking toJSBox would
> always throw. Changing the typeDescription to PlainJavaScriptObject
> instead of =Object fixes that issue.
>
> CoreLibraryReviewExempt: Backend-specific library.
> Change-Id: I5cfb1f32ff4328fafdf9831b0d8da806c39391d9
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/309082
> Reviewed-by: Joshua Litt <joshualitt@google.com>
> Commit-Queue: Srujan Gaddam <srujzs@google.com>
Change-Id: I469ad04db7b49ffef47a46ccac97e909e4865719
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313580
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Modifies JSBoxedDartObject reified type on JS backends and also
modifies JSBoxedDartObject.toDart now that a proper box is introduced.
Also uses a JS symbol in JSBoxedDartObject.toDart for a property
check so that different Dart apps don't accidentally share Dart
objects. It's now an error to call this function on non-boxed objects.
Fixes a type issue where creating a new object literal with the JS
foreign function was resulting in dart2js thinking toJSBox would
always throw. Changing the typeDescription to PlainJavaScriptObject
instead of =Object fixes that issue.
CoreLibraryReviewExempt: Backend-specific library.
Change-Id: I5cfb1f32ff4328fafdf9831b0d8da806c39391d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/309082
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Right now `utf8.encode()` has a static return type of `List<int>`
due to extending `Encoding` (which extends `Codec<String, List<int>>`).
We cannot easily change `Encoding` to extend `Codec<String, Uint8List>`
because that would also change `utf8.decode()` to require `Uint8List`
which would be a breaking change.
So instead we override `utf8.encode()` to have more precise return type.
Some parts of our SDK are run using the checked-in SDK, so it cannot
rely on the changed return type yet (until checked-in SDK is rolled).
So we use `const Utf8Encoder().convert()` as a temporary change, as
that already has `Uint8List` return type.
Issue https://github.com/dart-lang/sdk/issues/52801
TEST=ci
CoreLibraryReviewExempt: More precise return type for existing API
Change-Id: I2861d1f0eb3d292d8e3ec8437c0d441a2d2bd193
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254903
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Currently this throws a Wasm RuntimeError, which is difficult to
recover from.
Change-Id: I747682d6959b19746d6c98f2ea1b3fefd1ed2d03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312891
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
"[dart:html] Move NullWindowException to implementation"
This is a revert of bd3e6fa1a3 and
2b250992f9.
This adds some small code change to avoid a null-assertion being emitted
that would lead to a browser SecurityError.
CoreLibraryReviewExempt: Reland.
Change-Id: Iab52bb728b14fd0b2378b8923b0e1ea8ea930b12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311922
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
The iterable is used for the `keys` and `values` of `LinkedHashMap`.
The original code remembered the internal data list and used-count
when the iterable was created, and if the iterable was modified
between creating and iterating, the iterated values would not match
the map.
The solution is to not cache those values, and read them from the
hash table when creting the `Iterator` instead.
Fixes#48282
Tested: Added regression test to corelib/map_test
Bug: https://dartbug.com/48282
Change-Id: I79310615e7090556e6f45b0d7f297755951ef046
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312263
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
It's not supported, as it would prevent the value from being
garbage collected, defeating the purpose of Finalizer.
Not sure if an exception is worth it, so added the assert
as suggested in the bug tracker.
TEST=vm/dart{,_2}/finalizer/finalizer_attach_checks_token_test
Bug: #52731
Change-Id: Id7b457ca1a95e71c1a43d2d2c8569c35659952b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311020
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
The main contribution of this CL is unification of disparate
handling of various functions like `Future.timeout`,
`Future.wait`, `_SuspendState.createAsyncCallbacks` and
`_SuspendState._createAsyncStarCallback` into a single
`@pragma('vm:awaiter-link')` which allows Dart developers
to specify where awaiter unwinder should look for the next
awaiter.
For example this allows unwinding to succeed for the code like this:
Future<int> outer(Future<int> inner) {
@pragma('vm:awaiter-link')
final completer = Completer<int>();
inner.then((v) => completer.complete(v));
return completer.future;
}
This refactoring also ensures that we preserve information
(including Function & Code objects) required for awaiter
unwinding across all modes (JIT, AOT and AOT with DWARF stack
traces). This guarantees users will get the same information
no matter which mode they are running in. Previously
we have been disabling awaiter_stacks tests in some AOT
modes - which led to regressions in the quality of produced
stacks.
This CL also cleans up relationship between debugger and awaiter
stack returned by StackTrace.current - which makes stack trace
displayed by debugger (used for stepping out and determinining
whether exception is caught or not) and `StackTrace.current`
consistent.
Finally we make one user visible change to the stack trace:
awaiter stack will no always include intermediate listeners
created through `Future.then`. Previously we would sometimes
include these listeners at the tail of the stack trace,
which was inconsistent.
Ultimately this means that code like this:
Future<int> inner() async {
await null; // asynchronous gap
print(StackTrace.current); // (*)
return 0;
}
Future<int> outer() async {
int process(int v) {
return v + 1;
}
return await inner().then(process);
}
void main() async {
await outer();
}
Produces stack trace like this:
inner
<asynchronous suspension>
outer.process
<asynchronous suspension>
outer
<asynchronous suspension>
main
<asynchronous suspension>
And when stepping out of `inner` execution will stop at `outer.process`
first and the next step out will bring execution to `outer` next.
Fixes https://github.com/dart-lang/sdk/issues/52797
Fixes https://github.com/dart-lang/sdk/issues/52203
Issue https://github.com/dart-lang/sdk/issues/47985
TEST=ci
Bug: b/279929839
CoreLibraryReviewExempt: CL just adds @pragma to facilitate unwinding
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-product-x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-dwarf-linux-product-x64-try
Change-Id: If377d5329d6a11c86effb9369dc603a7ae616fe7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311680
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
This reverts commit a356f71b71.
Reason for revert: This should be handled by throwing an exception when
the methods of the returned window are called, not when it is opened.
This would be a noisy breaking change that we don't want for 3.1. For
now, revert until the change that affects the individual methods is
landed.
Original change's description:
> [dart:html] Throw exception if Window.open opens null window
>
> Window.open silently allows a null window to be opened, and
> issues arise later when users try to use the non-null wrapper.
> This CL changes that to throw an exception if the window is null.
> This exception can be caught and recovered from. This avoids the
> larger breaking change of making this API nullable.
>
> CoreLibraryReviewExempt: Backend-specific library.
> Change-Id: I9a53a477cb370c3bc6bc26b2162ce66c5af166aa
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/306910
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Commit-Queue: Srujan Gaddam <srujzs@google.com>
CoreLibraryReviewExempt: Revert in backend-specific library.
Change-Id: I5007b7d7aa608bfc8e5827b5f967af5573d0b758
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/309000
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
This reverts commit 14a3051552.
Reason for revert: b/289195983
Original change's description:
> [dart:html] Move NullWindowException to implementation
>
> Window.open may open a null window in more cases than expected.
> Users may not care that the window they get back is invalid if
> they never use it. Therefore, this CL moves the exception to
> the implementation of the returned window in order to reduce
> noise, but still give a way for users to recover if they wish
> to do so.
>
> CoreLibraryReviewExempt: Backend-specific library.
> Change-Id: I005cf80630cfb4db2f5ec2012cfcd0161ad10ff1
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311460
> Commit-Queue: Srujan Gaddam <srujzs@google.com>
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
Change-Id: Id7c514a80fdcaa18a7eb0acdcb7f36477a04d966
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311843
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Ivan Inozemtsev <iinozemtsev@google.com>
More details about the design:
https://docs.google.com/document/d/1QDjyY_6wOTOgURwpeYMKU9qEz0gKxx2MUrdruC6Kp6c/edit?usp=sharing
Change-Id: Ie3985d86dca7f5010044ca46c33ca177588c0f69
Bug: #37022
CoreLibraryReviewExempt: Reviewed by vm and api groups. web and wasm groups not affected because FFI isn't on those platforms.
TEST=async_void_function_callbacks_test.dart, ffi_callback_metadata_test.cc, other front end tests
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/305900
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Closes#31670
In `add` and `addStream` mention that int values which are too large are
truncated to bytes.
R=lrn@google.com
Change-Id: Idf276fc65592e21766659e9d89dd687c441b7357
CoreLibraryReviewExempt: Doc changes only.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310768
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
In order to have the browser send a new request for each retry (each new appended script tag), a query token must be appended to the URI. We don't include any extra tokens on the initial request.
Change-Id: I846660894c16345a441193cd9c7b4784364a3c54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311200
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
Window.open may open a null window in more cases than expected.
Users may not care that the window they get back is invalid if
they never use it. Therefore, this CL moves the exception to
the implementation of the returned window in order to reduce
noise, but still give a way for users to recover if they wish
to do so.
CoreLibraryReviewExempt: Backend-specific library.
Change-Id: I005cf80630cfb4db2f5ec2012cfcd0161ad10ff1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311460
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Repeated calls to Uri.base result in repeated calls to Uri.parse.
Reparsing is necessary only when the location changes.
Bug: b/281079996
Change-Id: I091a6f1ac2f454643e95bbfddf59b24172ef7da5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311155
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
- Only include the script tag src if it differs from the previous log entry.
- Use single letters for each event field's key.
- Fix some typos.
- Remove 'uri' from download event as it can be inferred from script tag src and part file name.
Change-Id: Ib7916ea5e92720a10c7e1e1cab2e535fae2bbf49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311180
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
Closes#33384
Similar to a notice in the doc for `HashSet` where it is also unsafe to
change `hashCode` while an object is in the collection.
R=lrn@google.com
Change-Id: I0e609656fccd563ecf71d4be5ecadafc1a6da891
CoreLibraryReviewExempt: Doc changes only.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310774
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Closes#27740
Mention the convenience constructors `fromhandlers` and `fromBind` in
the class level doc.
Describe the default behavior of each handlers.
R=lrn@google.com
Change-Id: Ica55d5a2f531e11106085122aa32173cc436991a
CoreLibraryReviewExempt: Doc changes only.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310765
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Closes#7797
Most of the other suggestions have already been added, add an explicit
mention of shorcutting for `contains`, `firstWhere`, and `single`,
R=lrn@google.com
Change-Id: I53c254839f198a368fcb8734c3f7983b9b3ccad4
CoreLibraryReviewExempt: Doc changes only.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310767
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>