Finish the OutOfMemoryError implementation.
This copes with the double-OOME case.
Also check that I don't leave local references in a newly-attached thread's
local reference table, and fix the leaks this discovered.
Also fix the code that implements fillInNativeStackTrace to cope with the
situation where we're not able to allocate (because we're throwing
OutOfMemoryError and there's not enough space left for our arrays).
Also fix the order of checking for a pending exception and popping the
local references in the JNI native method invocation stub. (This fixes
the warnings we'd been seeing from the IndirectReferenceTable in test 064.)
Also improve some -Xcheck:jni output.
This fixes test 061.
Change-Id: Icc04a2c06339bd28d6772190350a86abfc5734b8
diff --git a/src/thread.h b/src/thread.h
index 0d0f107..52e01f2 100644
--- a/src/thread.h
+++ b/src/thread.h
@@ -313,9 +313,6 @@
void SirtVisitRoots(Heap::RootVisitor* visitor, void* arg);
- // Pop the top SIRT
- void PopSirt();
-
// Convert a jobject into a Object*
Object* DecodeJObject(jobject obj);
@@ -574,7 +571,9 @@
Context* long_jump_context_;
// A boolean telling us whether we're recursively throwing OOME.
- uint32_t throwing_OOME_;
+ uint32_t throwing_OutOfMemoryError_;
+
+ Throwable* pre_allocated_OutOfMemoryError_;
// TLS key used to retrieve the VM thread object.
static pthread_key_t pthread_key_self_;