hotspot/src/share/vm/runtime/handles.cpp
changeset 46271 979ebd346ecf
parent 40655 9f644073d3a0
child 46329 53ccc37bda19
equal deleted inserted replaced
46270:2e7898927798 46271:979ebd346ecf
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2017, 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.
    34 oop* HandleArea::allocate_handle(oop obj) {
    34 oop* HandleArea::allocate_handle(oop obj) {
    35   assert(_handle_mark_nesting > 1, "memory leak: allocating handle outside HandleMark");
    35   assert(_handle_mark_nesting > 1, "memory leak: allocating handle outside HandleMark");
    36   assert(_no_handle_mark_nesting == 0, "allocating handle inside NoHandleMark");
    36   assert(_no_handle_mark_nesting == 0, "allocating handle inside NoHandleMark");
    37   assert(obj->is_oop(), "not an oop: " INTPTR_FORMAT, p2i(obj));
    37   assert(obj->is_oop(), "not an oop: " INTPTR_FORMAT, p2i(obj));
    38   return real_allocate_handle(obj);
    38   return real_allocate_handle(obj);
    39 }
       
    40 
       
    41 Handle::Handle(Thread* thread, oop obj) {
       
    42   assert(thread == Thread::current(), "sanity check");
       
    43   if (obj == NULL) {
       
    44     _handle = NULL;
       
    45   } else {
       
    46     _handle = thread->handle_area()->allocate_handle(obj);
       
    47   }
       
    48 }
    39 }
    49 #endif
    40 #endif
    50 
    41 
    51 // Copy constructors and destructors for metadata handles
    42 // Copy constructors and destructors for metadata handles
    52 // These do too much to inline.
    43 // These do too much to inline.