Threads in the native or blocked states don't prevent safepoints, so they may run concurrently with a safepoint operation like GC. It is not safe for handles to be allocated while the GC is visiting them, so these threads must not allocate handles. Assert only threads in the VM or generated states, which prevent safepoints until they check in, may allocate handles. (Generated code does not allocate handles, but leaf runtime entries remain in the generated state.)
Bug: https://github.com/dart-lang/sdk/issues/34883
Change-Id: I1a211778f7ef96b53a2405f0ee9dde7871b122b6
Reviewed-on: https://dart-review.googlesource.com/c/81540
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Mostly tests; 1 non-test bug in propagating an error through Dart_SetReturnValue.
This is progress towards asserting thread->excution_state() == kThreadInVM in Object::Allocate.
Change-Id: I6a59549868ab317b3c0d32aa42f3661289cbf456
Reviewed-on: https://dart-review.googlesource.com/71720
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
These reports provide information tied to token positions in the
Dart source program.
SourceReport can generate multiple kinds of reports. Right now it
implements code coverage and call site reports. In the future it
could provide, for example, valid breakpoint sites or source-level
profiles.
Scripts are refered to by index within the report and a script table
is tacked on the end. This avoids a bit of duplication.
In a future cl I will expose this reporting through the vm service.
After that, we can remove our older coverage/callsite code.
----------
Very simple, sample coverage report:
{
"type": "SourceReport",
"ranges": [
{
"scriptIndex": 0,
"startPos": 0,
"endPos": 4,
"compiled": true,
"coverage": {
"hits": [],
"misses": []
}
},
{
"scriptIndex": 0,
"startPos": 6,
"endPos": 10,
"compiled": false
},
{
"scriptIndex": 0,
"startPos": 12,
"endPos": 39,
"compiled": true,
"coverage": {
"hits": [ 23 ],
"misses": [ 32 ]
}
}
],
"scripts": [
{
"type": "@Script",
"fixedId": true,
"id": "libraries\/15\/scripts\/test-lib",
"uri": "test-lib",
"_kind": "script"
}
]
}
R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org/1533653003 .