1499N/A * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A// Recording and retrieval of oop relocations in compiled code. 0N/A // A two-way mapping from positive indexes to oop handles. 0N/A // The zero index is reserved for a constant (sharable) null. 0N/A // Indexes may not be negative. 0N/A // Use the given arena to manage storage, if not NULL. 0N/A // By default, uses the current ResourceArea. 0N/A // Generate a new index on which CodeBlob::oop_addr_at will work. 0N/A // allocate_index and find_index never return the same index, 0N/A // and allocate_index never returns the same index twice. 0N/A // In fact, two successive calls to allocate_index return successive ints. 0N/A // For a given jobject, this will return the same index repeatedly. 0N/A // The index can later be given to oop_at to retrieve the oop. 0N/A // However, the oop must not be changed via CodeBlob::oop_addr_at. 0N/A if (
index < 0) {
// previously unallocated 0N/A // variant of find_index which does not allocate if not found (yields -1) 0N/A // returns the size of the generated oop table, for sizing the CodeBlob. 0N/A // must be called after all oops are allocated! 0N/A // Retrieve the oop handle at a given index. 0N/A // there is always a NULL virtually present as first object 1483N/A // copy the generated oop table to nmethod 0N/A // leaky hash table of handle => index, to help detect duplicate insertion 0N/A // This class is only used by the OopRecorder class. 0N/A // Index entries are ints. The LSBit is a collision indicator. 0N/A // Helper function; returns false for NULL or Universe::non_oop_word(). 1879N/A#
endif // SHARE_VM_CODE_OOPRECORDER_HPP