comparison src/share/vm/oops/instanceKlass.cpp @ 5935:a735aec54ea4

7123170: JCK vm/jvmti/ResourceExhausted/resexh001/resexh00101/ tests fails since 7u4 b02 Summary: The JVMTI ResourceExhausted events must be generated in all places where OOME is thrown Reviewed-by: acorn, coleenp, dcubed, dholmes, dsamersoff, jwilhelm, tonyp Contributed-by: serguei.spitsyn@oracle.com
author sspitsyn
date Wed, 14 Mar 2012 20:06:48 -0700
parents 52b5d32fbfaf
children 6522ad563f99
comparison
equal deleted inserted replaced
5934:61b82be3b1ff 5935:a735aec54ea4
1 /* 1 /*
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
667 667
668 objArrayOop instanceKlass::allocate_objArray(int n, int length, TRAPS) { 668 objArrayOop instanceKlass::allocate_objArray(int n, int length, TRAPS) {
669 if (length < 0) THROW_0(vmSymbols::java_lang_NegativeArraySizeException()); 669 if (length < 0) THROW_0(vmSymbols::java_lang_NegativeArraySizeException());
670 if (length > arrayOopDesc::max_array_length(T_OBJECT)) { 670 if (length > arrayOopDesc::max_array_length(T_OBJECT)) {
671 report_java_out_of_memory("Requested array size exceeds VM limit"); 671 report_java_out_of_memory("Requested array size exceeds VM limit");
672 JvmtiExport::post_array_size_exhausted();
672 THROW_OOP_0(Universe::out_of_memory_error_array_size()); 673 THROW_OOP_0(Universe::out_of_memory_error_array_size());
673 } 674 }
674 int size = objArrayOopDesc::object_size(length); 675 int size = objArrayOopDesc::object_size(length);
675 klassOop ak = array_klass(n, CHECK_NULL); 676 klassOop ak = array_klass(n, CHECK_NULL);
676 KlassHandle h_ak (THREAD, ak); 677 KlassHandle h_ak (THREAD, ak);