Let tryMalloc field over-sized allocation errors.

Change-Id: I691b8eeca74b7e018f86753b00b7f117d5872916
diff --git a/vm/alloc/Alloc.h b/vm/alloc/Alloc.h
index eba53df..8128651 100644
--- a/vm/alloc/Alloc.h
+++ b/vm/alloc/Alloc.h
@@ -63,12 +63,6 @@
 };
 
 /*
- * Call when a request is so far off that we can't call dvmMalloc().  Throws
- * an exception with the specified message.
- */
-void dvmThrowBadAllocException(const char* msg);
-
-/*
  * Track an object reference that is currently only visible internally.
  * This is called automatically by dvmMalloc() unless ALLOC_DONT_TRACK
  * is set.
diff --git a/vm/alloc/Heap.c b/vm/alloc/Heap.c
index bbf2cc4..dcc6e42 100644
--- a/vm/alloc/Heap.c
+++ b/vm/alloc/Heap.c
@@ -161,25 +161,6 @@
 }
 
 /*
- * We've been asked to allocate something we can't, e.g. an array so
- * large that (length * elementWidth) is larger than 2^31.
- *
- * _The Java Programming Language_, 4th edition, says, "you can be sure
- * that all SoftReferences to softly reachable objects will be cleared
- * before an OutOfMemoryError is thrown."
- *
- * It's unclear whether that holds for all situations where an OOM can
- * be thrown, or just in the context of an allocation that fails due
- * to lack of heap space.  For simplicity we just throw the exception.
- *
- * (OOM due to actually running out of space is handled elsewhere.)
- */
-void dvmThrowBadAllocException(const char* msg)
-{
-    dvmThrowException("Ljava/lang/OutOfMemoryError;", msg);
-}
-
-/*
  * Grab the lock, but put ourselves into THREAD_VMWAIT if it looks like
  * we're going to have to wait on the mutex.
  */
diff --git a/vm/oo/Array.c b/vm/oo/Array.c
index 314231c..4b14b21 100644
--- a/vm/oo/Array.c
+++ b/vm/oo/Array.c
@@ -41,14 +41,6 @@
     size_t size;
 
     assert(arrayClass->descriptor[0] == '[');
-
-    if (length > 0x0fffffff) {
-        /* too large and (length * elemWidth) will overflow 32 bits */
-        LOGE("Rejecting allocation of %u-element array\n", length);
-        dvmThrowBadAllocException("array size too large");
-        return NULL;
-    }
-
     size = offsetof(ArrayObject, contents);
     size += length * elemWidth;