diff src/hotspot/share/oops/arrayKlass.cpp @ 52033:d6aa9ea2405d

8208686: [AOT] JVMTI ResourceExhausted event repeated for same allocation Reviewed-by: never, kvn, sspitsyn
author dnsimon
date Fri, 05 Oct 2018 20:03:14 +0200
parents 9c68699bebe5
children 08db5aa02f7b
line wrap: on
line diff
--- a/src/hotspot/share/oops/arrayKlass.cpp	Fri Oct 05 18:25:15 2018 +0100
+++ b/src/hotspot/share/oops/arrayKlass.cpp	Fri Oct 05 20:03:14 2018 +0200
@@ -130,14 +130,7 @@
 }
 
 objArrayOop ArrayKlass::allocate_arrayArray(int n, int length, TRAPS) {
-  if (length < 0) {
-    THROW_MSG_0(vmSymbols::java_lang_NegativeArraySizeException(), err_msg("%d", length));
-  }
-  if (length > arrayOopDesc::max_array_length(T_ARRAY)) {
-    report_java_out_of_memory("Requested array size exceeds VM limit");
-    JvmtiExport::post_array_size_exhausted();
-    THROW_OOP_0(Universe::out_of_memory_error_array_size());
-  }
+  check_array_allocation_length(length, arrayOopDesc::max_array_length(T_ARRAY), CHECK_0);
   int size = objArrayOopDesc::object_size(length);
   Klass* k = array_klass(n+dimension(), CHECK_0);
   ArrayKlass* ak = ArrayKlass::cast(k);