6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
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 #include "precompiled.hpp"
25 #include "jvmci/metadataHandleBlock.hpp"
26
27 MetadataHandleBlock* MetadataHandleBlock::_last = NULL;
28 intptr_t MetadataHandleBlock::_free_list = 0;
29 int MetadataHandleBlock::_allocate_before_rebuild = 0;
30
31 jmetadata MetadataHandleBlock::allocate_metadata_handle(Metadata* obj) {
32 assert(obj->is_valid() && obj->is_metadata(), "must be");
33
34 if (_last == NULL) {
35 // This is the first allocation.
36 _last = this;
37 }
38
39 HandleRecord* handle = get_handle();
40
41 if (handle != NULL) {
42 handle->set_value(obj);
43 #ifdef METADATA_TRACK_NAMES
44 handle->set_name(obj->print_value_string());
45 #endif
|
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
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 #include "precompiled.hpp"
25 #include "jvmci/metadataHandleBlock.hpp"
26 #include "runtime/atomic.hpp"
27
28 MetadataHandleBlock* MetadataHandleBlock::_last = NULL;
29 intptr_t MetadataHandleBlock::_free_list = 0;
30 int MetadataHandleBlock::_allocate_before_rebuild = 0;
31
32 jmetadata MetadataHandleBlock::allocate_metadata_handle(Metadata* obj) {
33 assert(obj->is_valid() && obj->is_metadata(), "must be");
34
35 if (_last == NULL) {
36 // This is the first allocation.
37 _last = this;
38 }
39
40 HandleRecord* handle = get_handle();
41
42 if (handle != NULL) {
43 handle->set_value(obj);
44 #ifdef METADATA_TRACK_NAMES
45 handle->set_name(obj->print_value_string());
46 #endif
|