Fix a few UNIMPLEMENTEDs.
The pre-allocated OOME is per-thread in art, and already handled
in Thread::VisitRoots. We don't have pre-allocated instances of the
other two exceptions.
Change-Id: I3d874e0760411188408941424925e2eaeb71d6b7
diff --git a/src/java_lang_reflect_Array.cc b/src/java_lang_reflect_Array.cc
index b1ae682..f1456b1 100644
--- a/src/java_lang_reflect_Array.cc
+++ b/src/java_lang_reflect_Array.cc
@@ -27,9 +27,6 @@
// Recursively create an array with multiple dimensions. Elements may be
// Objects or primitive types.
-//
-// The dimension we're creating is in dimensions[0], so when we recurse
-// we advance the pointer.
Array* CreateMultiArray(Class* array_class, int current_dimension, IntArray* dimensions) {
int32_t array_length = dimensions->Get(current_dimension++);
Array* new_array = Array::Alloc(array_class, array_length);
@@ -93,8 +90,10 @@
DCHECK_LE(num_dimensions, 255);
for (int i = 0; i < num_dimensions; i++) {
- if (dimensions_array->Get(i) < 0) {
- UNIMPLEMENTED(FATAL) << "ThrowNegativeArraySizeException(dimensions[i])";
+ int dimension = dimensions_array->Get(i);
+ if (dimension < 0) {
+ Thread::Current()->ThrowNewExceptionF("Ljava/lang/NegativeArraySizeException;",
+ "Dimension %d: %d", i, dimension);
return NULL;
}
}
@@ -124,7 +123,7 @@
DCHECK(javaElementClass != NULL);
Class* element_class = Decode<Class*>(env, javaElementClass);
if (length < 0) {
- UNIMPLEMENTED(FATAL) << "ThrowNegativeArraySizeException(length)";
+ Thread::Current()->ThrowNewExceptionF("Ljava/lang/NegativeArraySizeException;", "%d", length);
return NULL;
}
std::string descriptor;
diff --git a/src/runtime.cc b/src/runtime.cc
index e3aed70..e0c9d47 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -616,11 +616,6 @@
for (int i = 0; i < Runtime::kLastCalleeSaveType; i++) {
visitor(callee_save_method_[i], arg);
}
-
- //(*visitor)(&gDvm.outOfMemoryObj, 0, ROOT_VM_INTERNAL, arg);
- //(*visitor)(&gDvm.internalErrorObj, 0, ROOT_VM_INTERNAL, arg);
- //(*visitor)(&gDvm.noClassDefFoundErrorObj, 0, ROOT_VM_INTERNAL, arg);
- UNIMPLEMENTED(WARNING) << "some roots not marked";
}
bool Runtime::HasJniStubArray() const {