This CL improves the stack traces that accompany exceptions. Whenever an
async function is entered, we remember how we got there. This is similar
in spirit to package:stack_trace but the implementation is more efficient
and memory usage can be more easily reasoned about.
Tracking causal stack traces:
- [x] Upon entry to an async function, capture the synchronous stack trace prefix and store it into the closure.
- [x] Upon entry to an async* function, capture the synchronous stack trace prefix and store it into the closure.
- [x] Before returning from an async function, clear the Thread's asynchronous stack trace.
- [x] After resuming an async function, load the sychronous stack trace prefix into the Thread.
- [x] Filter stack traces to remove async machinery.
Service protocol changes:
- [x] Send causal async stack trace.
Observatory changes:
- [x] Display causal async stack trace below async functions.
Fixes https://github.com/dart-lang/sdk/issues/27661R=asiva@google.com, rmacnak@google.com
Comparisons: https://docs.google.com/a/google.com/document/d/10r6jEqr8OCiDZ4y9SYU_uOimcHiOGAZMly2ghTErALI/edit?usp=sharing
Review-Url: https://codereview.chromium.org/2646443005 .
In Flutter, this caused
RangeError (index): Index out of range: index should be less than null: 0
Uint32List.[]= (dart:typed_data)
_HashVMBase&MapMixin&&_LinkedHashMapMixin._insert (dart:collection-patch/compact_hash.dart)
This reverts commit 0ae4ae5033.
TBR=fschneider@google.com
Review URL: https://codereview.chromium.org/2023423002 .
- Do some minor modifications to the intrinsifier code to not do redundant fingerprint checks and avoid code duplication.
These changes result in a text segment size savings of about 110k.
Old Sizes:
text data bss dec hex filename
3801418 7696 19261 3828375 3a6a97 (TOTALS)
New sizes:
text data bss dec hex filename
3690342 7696 19261 3717299 38b8b3 (TOTALS)
Review URL: https://codereview.chromium.org//1134623004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45704 260f80e4-7a28-3924-810f-c04153c831b5
- don't manually truncate values before passing them to TypedData._[set|get]<Type> - these methods already have truncating semantics;
- don't call into runtime for endianess conversion, implement it in pure Dart instead (with an intent to provide optimized version on platforms that support fast byte-swapping instructions);
- force inlining of these methods (change the order of checks in the ShouldWeInline to guarantee inlining of whitelisted methods).
Unrelated change:
- tweak output of Function::CheckSourceFingerprint to be immediately copy&paste useful.
R=fschneider@google.com
BUG=http://dartbug.com/22107
Review URL: https://codereview.chromium.org//860963002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43038 260f80e4-7a28-3924-810f-c04153c831b5
The method recognizer is now in a separate file and the intrinsifier uses the
same infrastructure. Each function is marked at initialization time, so that
recognizing a method is a fast operation (reading a field from the Function object)
I cleaned the symbol table from unused symbols since I had to regenerate the
binary snapshot in the repository anyway for this change.
I had to rename the methods that are duplicated between the recognized method list
and the intrinsics list to match the naming convention used by the method recognizer.
I left the other intrinsics unchanged for now. They will be renamed in a future CL.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//468793004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39444 260f80e4-7a28-3924-810f-c04153c831b5