97 set_class_loader_data(ClassLoaderData::the_null_class_loader_data()); |
97 set_class_loader_data(ClassLoaderData::the_null_class_loader_data()); |
98 } |
98 } |
99 |
99 |
100 typeArrayOop TypeArrayKlass::allocate_common(int length, bool do_zero, TRAPS) { |
100 typeArrayOop TypeArrayKlass::allocate_common(int length, bool do_zero, TRAPS) { |
101 assert(log2_element_size() >= 0, "bad scale"); |
101 assert(log2_element_size() >= 0, "bad scale"); |
102 if (length >= 0) { |
102 check_array_allocation_length(length, max_length(), CHECK_NULL); |
103 if (length <= max_length()) { |
103 size_t size = typeArrayOopDesc::object_size(layout_helper(), length); |
104 size_t size = typeArrayOopDesc::object_size(layout_helper(), length); |
104 return (typeArrayOop)Universe::heap()->array_allocate(this, (int)size, length, |
105 return (typeArrayOop)Universe::heap()->array_allocate(this, (int)size, length, |
105 do_zero, CHECK_NULL); |
106 do_zero, CHECK_NULL); |
|
107 } else { |
|
108 report_java_out_of_memory("Requested array size exceeds VM limit"); |
|
109 JvmtiExport::post_array_size_exhausted(); |
|
110 THROW_OOP_0(Universe::out_of_memory_error_array_size()); |
|
111 } |
|
112 } else { |
|
113 THROW_MSG_0(vmSymbols::java_lang_NegativeArraySizeException(), err_msg("%d", length)); |
|
114 } |
|
115 } |
106 } |
116 |
107 |
117 oop TypeArrayKlass::multi_allocate(int rank, jint* last_size, TRAPS) { |
108 oop TypeArrayKlass::multi_allocate(int rank, jint* last_size, TRAPS) { |
118 // For typeArrays this is only called for the last dimension |
109 // For typeArrays this is only called for the last dimension |
119 assert(rank == 1, "just checking"); |
110 assert(rank == 1, "just checking"); |