comparison 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
comparison
equal deleted inserted replaced
11:ab4635fbcbc0 12:56b25ab4d646
128 || k == SystemDictionary::Cloneable_klass() 128 || k == SystemDictionary::Cloneable_klass()
129 || k == SystemDictionary::Serializable_klass(); 129 || k == SystemDictionary::Serializable_klass();
130 } 130 }
131 131
132 objArrayOop ArrayKlass::allocate_arrayArray(int n, int length, TRAPS) { 132 objArrayOop ArrayKlass::allocate_arrayArray(int n, int length, TRAPS) {
133 if (length < 0) { 133 check_array_allocation_length(length, arrayOopDesc::max_array_length(T_ARRAY), CHECK_0);
134 THROW_MSG_0(vmSymbols::java_lang_NegativeArraySizeException(), err_msg("%d", length));
135 }
136 if (length > arrayOopDesc::max_array_length(T_ARRAY)) {
137 report_java_out_of_memory("Requested array size exceeds VM limit");
138 JvmtiExport::post_array_size_exhausted();
139 THROW_OOP_0(Universe::out_of_memory_error_array_size());
140 }
141 int size = objArrayOopDesc::object_size(length); 134 int size = objArrayOopDesc::object_size(length);
142 Klass* k = array_klass(n+dimension(), CHECK_0); 135 Klass* k = array_klass(n+dimension(), CHECK_0);
143 ArrayKlass* ak = ArrayKlass::cast(k); 136 ArrayKlass* ak = ArrayKlass::cast(k);
144 objArrayOop o = (objArrayOop)Universe::heap()->array_allocate(ak, size, length, 137 objArrayOop o = (objArrayOop)Universe::heap()->array_allocate(ak, size, length,
145 /* do_zero */ true, CHECK_0); 138 /* do_zero */ true, CHECK_0);