When doing fine grained invalidation and reload we might end up losing
`is_implemented` bit and some other class-hierarchy related bits
on a class if we only reload the library where class is declared
but not transitive closure which depends on that library.
Consider:
library a;
class A {}
library b;
class B implements A {}
If we do a change to library `a` which does not impact the outline
then we do not need to reload `b`. This will cause class A to
be replaced with a new `Class` object in the class table - and lead
to us losing various CHA related bits.
This CL update ProgramReloadContext::RebuildDirectSubclasses to
handle this correctly, we also rename it to
RestoreClassHierarchyInvariants and make it share implementation
with ClassFinalizer (which contained almost identical function).
Fixes https://github.com/flutter/flutter/issues/151032
TEST=vm/cc/IsolateReload_IsImplementedBit
Change-Id: Ie620592befecb89897d6e8d46175ef07348bf11d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/374040
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Issue 54063: Adding in file quick fix support for missing semicolons and associated test
R=srawlins@google.com
Bug: https://github.com/dart-lang/sdk/issues/54063
Change-Id: Ia1a20129e3c630d977ab3d40bf8e79b0ed852936
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373326
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Ann Mossman <mossman@google.com>
Auto-Submit: Ann Mossman <mossman@google.com>
This is almost identical to the fix for completing at the beginning of a
method invocation. There's probably a more consistent way to do this,
but I'm not sure what that is at the moment. (I think we used to do this
in `completionNode` but were skipping some nodes we shouldn't have been.)
Change-Id: I3f220e0e79a91721b0c1235fdfc0f511ee7400a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373902
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Work towards https://github.com/dart-lang/linter/issues/4991
Here I just take all of the existing rules marked with
`Category.errors` (which are not removed or deprecated), and re-examine
what category or categories they fall into.
I add new categories:
* "binary size" (not super accurate for JS-compile apps, but "binary"
is still a common industry term for the JS app that is delivered to
the browser)
* "documentation comment maintenance"
* "error-prone"
* "language feature usage"
* "memory leaks" (note, different from "binary size"; mostly
memory-leak related but may contain other things?)
* "non-performant"
* "unintentional"
* "unused code"
For multiple rules, I considered adding a "best practices" category
too, but this also seems tragically vague. But for rules like
"control_flow_in_finally", "avoid_catches_without_on_clauses", etc.
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: I043a509120e7347283d6ab10e8eb73859830abc0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371921
Reviewed-by: Marya Belanger <mbelanger@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Also updates `tool/machine.dart` for recent `LintRule` and category changes.
Change-Id: I58200e465e7c372881d0c0af406e606b09b0a844
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373885
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Make co19/LanguageFeatures/Augmentation-libraries/augmenting_types_A09_t05
less broken.
Change-Id: I267041b0c567dd84fd81fed7d530c1522e9fa062
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373883
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This avoids accidentally using the converter when talking to plugins, (at least for now) URIs are never expected, and file paths should always be used regardless of which mode the server is in.
This unfortunately touches a _lot_ of code, so I've pushed in many separate patch sets to Gerrit.
Fixes https://github.com/Dart-Code/Dart-Code/issues/5156
Change-Id: I312c3e2cbc35a05a078aaa0138aec7288b3c7dd6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373745
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Instead of
<obj> is Class(JSUint16ArrayImpl)
generate
<obj> is JSUint16ArrayImpl
in type test functions.
Change-Id: I98e294291f91d3a117052e42b774a907c95ad6b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/374001
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
This is a reland of commit 8b1aa1860f
This relands the commit with the following changes to avoid regressions
and some random changes:
- Add inline annotations to `IntToWasmInt` extensions.
These methods are 3 instructions long and often become just one
instruction when inlined, but wasm-opt still doesn't inline them,
turning a single `i64.lt_u` and similar into a function call.
- Revert changes from `length.leU(index)` to `index.geU(length)`.
I had done this change because I find `if (index >= length) throw`
easier to read than `if (length <= index) throw`, but the change
introduced some larger changes in the wasm-opt output. These changes
are probably harmless, but to minimize unintentional changes I
reverted these changes for now.
Original change's description:
> [dart2wasm] Use single unsigned cmp instead of two cmps when possible
>
> wasm-opt doesn't optimize `0 < x || x > y` when y is known to be
> positive (e.g. a positive integer constant), so we do it manually.
>
> We also do it in a few places where `y` is not known to be positive in
> the Wasm code, but we know it's always positive, for example when it's a
> length.
>
> Example improvement in the wasm-opt output:
>
> ```
> (func $_newArrayLengthCheck (;426;) (param $var0 i64) (result i64)
> local.get $var0
> i64.const 2147483647
> - i64.le_s
> - local.get $var0
> - i64.const 0
> - i64.ge_s
> - i32.and
> - i32.eqz
> + i64.gt_u
> if
> i32.const 46
> i32.const 0
> @@ -19190,13 +19172,8 @@
> i64.const 97
> i64.sub
> local.tee $var3
> - i64.const 0
> - i64.ge_s
> - local.get $var3
> i64.const 5
> - i64.le_s
> - i32.and
> - i32.eqz
> + i64.gt_u
> if
> local.get $var0
> local.get $var6
> @@ -19810,10 +19787,10 @@
> global.get $global4
> array.new_fixed $Array<_Type> 2
> )
> ```
>
> Closes#56083.
>
> Change-Id: Idb1dd0d0809b26be8aec3d082aa341c59e1a353d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373663
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Commit-Queue: Ömer Ağacan <omersa@google.com>
Change-Id: I822ca612e5c8d5d33ba443107b72e9f1021c5c4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/374000
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
This allows internal Set classes to be referenced by our runtime.
Context: incoming changes to our generic types (required for hot reload) requires that RTIs be passed to generic classes on instantiation. Moving our Set implementation into our private runtime and making their classes public allows us to directly reference them without clobbering names externally.
Change-Id: Ie47b3263ebbf2650d314b5285a2d50f3abd1a664
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373327
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
This reverts commit 8b1aa1860f.
Reason for revert:
This caused at least two issues:
(1) wasm-opt doesn't inline the simple helpers introduced in this CL,
for example:
```
(func $IntToWasmInt|geU (;217;) (param $var0 i64) (param $var1 i64) (result i32)
local.get $var0
local.get $var1
i64.ge_u
)
```
Even though when inlined this becomes just one instruction.
This causes diffs like:
```
i64.const 1
i64.add
local.set $var1
+ local.get $var2
local.get $var10
struct.get $JSArrayBufferImpl_80 $field2
call $wasm:js-string.length (import)
i64.extend_i32_u
local.tee $var3
- local.get $var2
- i64.le_u
+ call $IntToWasmInt|geU
if
```
(2) Changing `length.leU(index)` to `index.geU(length)` causes missing
some optimizations like the following:
```
local.get $var0
ref.cast $JSArrayBufferImpl_80
local.tee $var3
struct.get $JSArrayBufferImpl_80 $field2
call $wasm:js-string.length (import)
- drop
+ i64.extend_i32_u
+ local.tee $var4
+ i64.const 0
+ i64.lt_u
+ if
+ i64.const 0
+ i64.const 0
+ local.get $var4
+ ref.null none
+ ref.null none
+ call $RangeError.range
+ call $Error._throwWithCurrentStackTrace
+ unreachable
+ end
```
Here the `i64.const 0; i64.lt_u` always produces `0`, but wasm-opt
doesn't do this optimization.
The Dart changes that caused this diff:
```
- if (WasmI64.fromInt(length).leU(WasmI64.fromInt(index))) {
+ if (index.geU(length)) {
```
Original change's description:
> [dart2wasm] Use single unsigned cmp instead of two cmps when possible
>
> wasm-opt doesn't optimize `0 < x || x > y` when y is known to be
> positive (e.g. a positive integer constant), so we do it manually.
>
> We also do it in a few places where `y` is not known to be positive in
> the Wasm code, but we know it's always positive, for example when it's a
> length.
>
> Example improvement in the wasm-opt output:
>
> ```
> (func $_newArrayLengthCheck (;426;) (param $var0 i64) (result i64)
> local.get $var0
> i64.const 2147483647
> - i64.le_s
> - local.get $var0
> - i64.const 0
> - i64.ge_s
> - i32.and
> - i32.eqz
> + i64.gt_u
> if
> i32.const 46
> i32.const 0
> @@ -19190,13 +19172,8 @@
> i64.const 97
> i64.sub
> local.tee $var3
> - i64.const 0
> - i64.ge_s
> - local.get $var3
> i64.const 5
> - i64.le_s
> - i32.and
> - i32.eqz
> + i64.gt_u
> if
> local.get $var0
> local.get $var6
> @@ -19810,10 +19787,10 @@
> global.get $global4
> array.new_fixed $Array<_Type> 2
> )
> ```
>
> Closes#56083.
>
> Change-Id: Idb1dd0d0809b26be8aec3d082aa341c59e1a353d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373663
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Commit-Queue: Ömer Ağacan <omersa@google.com>
Change-Id: Iac5428037b0c19d76e4c841a1b6623b7305ff702
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373800
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
Bug: https://github.com/dart-lang/sdk/issues/55562
Change-Id: I38a2cbf87e48ac44bd762ff2583190d476e38db8
Tested: New test in http_connection_factory_test.dart
CoreLibraryReviewExempt: dart:io-only - I probably shouldn't have collected reviewers for this so it doesn't apply to the wasm/web
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367820
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Change-Id: I24775461fb690abdd0a47c5b4e23776c9fe5bfe0
Bug: https://github.com/dart-lang/sdk/issues/54901
Tested: TLS traffic verified in Wireshark, exception behavior verified with a Python test server, property changes verified by unit test
CoreLibraryReviewExempt: dart:io only
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365664
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
This reverts commit 44d4451476.
Reason for revert: b/350443042
Original change's description:
> Reapply "[ Service ] Start DDS and serve DevTools when the VM service is started via dart:developer"
>
> In the previous version of this change, if the user had 'dart' on their
> PATH and invoked 'dart compile js' (which spawns the VM service after
> compilation completes), the VM service would attempt to spawn DDS using
> './dart' as the executable path instead of 'dart'. This would result in
> DDS failing to start, causing the VM to print an error and hang.
>
> This updated change checks to see if the parent directory of
> `Platform.executable` is '.' and then verifies if './dart' exists or
> not. If it doesn't, 'dart' is likely on the user's PATH and should be
> used directly as the executable path.
>
> See https://github.com/dart-lang/sdk/issues/56087 for details.
>
> This reverts commit 4b88698e48.
>
> TEST=pkg/dds/test/control_web_server_starts_dds_with_dart_on_path_test.dart
>
> Change-Id: Id0f1dadd01d9202cbf7717f31393b43171cf3968
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373561
> Auto-Submit: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Derek Xu <derekx@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>
Change-Id: I424c4b91b0b108ae4c9dffa0059ed90c918897e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373744
Reviewed-by: Siva Annamalai <asiva@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Auto-Submit: Ivan Inozemtsev <iinozemtsev@google.com>
While the completion scenario is valid, it's probably an unlikely case.
I discovered the issue because it's one of the cases that was frequently
reporting failures in the completion metrics tool. With this change,
the failure count is now down to 249 (1.96% of attempted completions).
Change-Id: I1c9104352c14eb758040e3e0e3a2d2fafc4f909d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373780
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
It was using class id as a hash for non-primitive values which led to
quadratic behavior on functions with large number of non-primitive
constants.
Instead start using the same hash which is used for canonicalization
of constants.
Fixes https://github.com/flutter/flutter/issues/150182
TEST=ci
R=alexmarkov@google.com
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64-try,vm-aot-dwarf-linux-product-x64-try,vm-aot-linux-release-arm64-try
Change-Id: I7ea19edd63b5b7698fda02adccf4fa7e2ebb4b13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373661
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
wasm-opt doesn't optimize `0 < x || x > y` when y is known to be
positive (e.g. a positive integer constant), so we do it manually.
We also do it in a few places where `y` is not known to be positive in
the Wasm code, but we know it's always positive, for example when it's a
length.
Example improvement in the wasm-opt output:
```
(func $_newArrayLengthCheck (;426;) (param $var0 i64) (result i64)
local.get $var0
i64.const 2147483647
- i64.le_s
- local.get $var0
- i64.const 0
- i64.ge_s
- i32.and
- i32.eqz
+ i64.gt_u
if
i32.const 46
i32.const 0
@@ -19190,13 +19172,8 @@
i64.const 97
i64.sub
local.tee $var3
- i64.const 0
- i64.ge_s
- local.get $var3
i64.const 5
- i64.le_s
- i32.and
- i32.eqz
+ i64.gt_u
if
local.get $var0
local.get $var6
@@ -19810,10 +19787,10 @@
global.get $global4
array.new_fixed $Array<_Type> 2
)
```
Closes#56083.
Change-Id: Idb1dd0d0809b26be8aec3d082aa341c59e1a353d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373663
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
Includes the following commits:
- Rename members when they collide with return/parameter type names
- Update Web IDL to 3.49.0
- Add MAC_FF_META to KeyCode constants
- Account for static members in MDN docs
- Update doc comments, bump version to 1.0.0-wip
Change-Id: I0b87aa845af0ea093782d09a9a52abc09824d24a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373723
Commit-Queue: Kevin Moore <kevmoo@google.com>
Auto-Submit: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
The angled brackets are rendered as HTML.
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: Id7afcd4f3825b9643ed50c48ad98c1201ba2405f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Sam Rawlins <srawlins@google.com>
Fixes https://github.com/dart-lang/sdk/issues/56100
Also privatize and inline some code.
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: Ie9fea09cd719a62d2ef58373deaeb1fd43fa9cef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373601
Commit-Queue: Sam Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
I believe that we're computing the same values as we were before, but
the tests won't prove that. I couldn't think of any way to test this.
If you have any concerns and/or can think of a way to test it, do let me
know.
Change-Id: I489a2642b9b0345ad40fdc4afa9283eba5f65b3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373581
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>