10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "memory/allocation.inline.hpp"
27 #include "oops/constantPool.hpp"
28 #include "oops/method.hpp"
29 #include "oops/oop.inline.hpp"
30 #include "runtime/handles.inline.hpp"
31 #include "runtime/javaThread.hpp"
32
33 #ifdef ASSERT
34 #define assert_handle_mark_nesting() \
35 assert(_handle_mark_nesting > 1, "memory leak: allocating handle outside HandleMark"); \
36 assert(_no_handle_mark_nesting == 0, "allocating handle inside NoHandleMark"); \
37
38
39 oop* HandleArea::allocate_handle(oop obj) {
40 assert_handle_mark_nesting();
41 assert(oopDesc::is_oop(obj), "not an oop: " INTPTR_FORMAT, p2i(obj));
42 return real_allocate_handle(obj);
43 }
44
45 oop* HandleArea::allocate_null_handle() {
46 assert_handle_mark_nesting();
47 return real_allocate_handle(nullptr);
48 }
49 #endif
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "memory/allocation.inline.hpp"
27 #include "oops/constantPool.hpp"
28 #include "oops/method.hpp"
29 #include "oops/oop.inline.hpp"
30 #include "oops/inlineKlass.hpp"
31 #include "runtime/atomic.hpp"
32 #include "runtime/handles.inline.hpp"
33 #include "runtime/javaThread.hpp"
34
35 #ifdef ASSERT
36 #define assert_handle_mark_nesting() \
37 assert(_handle_mark_nesting > 1, "memory leak: allocating handle outside HandleMark"); \
38 assert(_no_handle_mark_nesting == 0, "allocating handle inside NoHandleMark"); \
39
40
41 oop* HandleArea::allocate_handle(oop obj) {
42 assert_handle_mark_nesting();
43 assert(oopDesc::is_oop(obj), "not an oop: " INTPTR_FORMAT, p2i(obj));
44 return real_allocate_handle(obj);
45 }
46
47 oop* HandleArea::allocate_null_handle() {
48 assert_handle_mark_nesting();
49 return real_allocate_handle(nullptr);
50 }
51 #endif
|