Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[vm] Cleanup Dart_Get/Set/HasStickyError API and use isolate's sticky…
… error only as a backup for thread's sticky error Both thread and isolate have sticky error fields. Dart API was using isolate's sticky error, while Dart code was using thread's sticky error. There was a one-way move of a thread's sticky error into isolate when thread was unscheduled. This causes a problem as error in the isolate may go unnoticed and repeated unscheduling/re-scheduling might end up overwriting the error in the isolate (which triggers the assertion). To solve this problem, this CL: * Cleans up Dart API which manipulates isolate's sticky error, so isolate's sticky error is never set directly. * When sceduling an isolate to a thread, sticky error is moved back from isolate (if any). With this changes, thread's sticky error is always used if thread is running, and isolate's sticky error is only used to hold sticky error while isolate has no thread. Fixes #35590 Change-Id: I99b128cac363ca2df75f6e64c083b1ec36c866ce Reviewed-on: https://dart-review.googlesource.com/c/89442 Reviewed-by: Ryan Macnak <rmacnak@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com>
- Loading branch information
1 parent
5b1daaa
commit b10f179
Showing
11 changed files
with
48 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
// VMOptions=--intrinsify | ||
// VMOptions=--no_intrinsify | ||
|
||
import "dart:isolate"; | ||
import "dart:async"; | ||
import "package:expect/expect.dart"; | ||
|
||
isomain1(replyPort) { | ||
final regexp = new RegExp('[ab]c'); | ||
while (true) { | ||
Expect.equals(4, regexp.allMatches("acbcacbc").length); | ||
} | ||
} | ||
|
||
void main() { | ||
for (int i = 0; i < 20; ++i) { | ||
ReceivePort reply = new ReceivePort(); | ||
Isolate.spawn(isomain1, reply.sendPort).then((Isolate isolate) { | ||
new Timer(new Duration(milliseconds: 50), () { | ||
print('killing isolate $i'); | ||
isolate.kill(priority: Isolate.immediate); | ||
}); | ||
}); | ||
reply.close(); | ||
} | ||
} |