Distinguish the various pre-allocated OutOfMemoryError use cases.
The pre-allocated exception "OutOfMemoryError thrown while trying to
throw OutOfMemoryError; no stack trace available", can be thrown in
three occasions:
1. OOME thrown while throwing an exception (not necessarily an OOME);
2. OOME thrown while throwing an OOME;
3. OOME thrown while handling a stack overflow.
To improve error reports, replace the unique pre-allocated OOME
exception with three different exceptions for these three use cases.
Noe that we were already manually dumping a stack trace in case #2.
This change implements this for case #1 too.
Test: art/test.py
Bug: 68251879
Bug: 77567088
Bug: 77844013
Change-Id: I84cd15b729b4d0bd7bf6c831caeb0eb93c458114
4 files changed