/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef SHARE_VM_COMPILER_OOPMAP_HPP
#define SHARE_VM_COMPILER_OOPMAP_HPP
#include "code/compressedStream.hpp"
#include "memory/allocation.hpp"
#include "utilities/growableArray.hpp"
// Interface for generating the frame map for compiled code. A frame map
// describes for a specific pc whether each register and frame stack slot is:
// Oop - A GC root for current frame
// Value - Live non-oop, non-float value: int, either half of double
// Dead - Dead; can be Zapped for debugging
// CalleeXX - Callee saved; also describes which caller register is saved
// DerivedXX - A derived oop; original oop is described.
//
// OopMapValue describes a single OopMap entry
class frame;
class RegisterMap;
class DerivedPointerEntry;
friend class VMStructs;
private:
short _value;
short _content_reg;
public:
// Constants
enum { type_shift = 0,
// Constructors
// Archiving
if(is_callee_saved() || is_derived_oop()) {
}
}
if(is_callee_saved() || is_derived_oop()) {
}
}
// Querying
VMReg reg() const { return VMRegImpl::as_VMReg(mask_bits(value(), register_mask_in_place) >> register_shift); }
}
}
// Physical location queries
// Returns offset from sp.
int stack_offset() {
}
};
friend class OopMapStream;
friend class VMStructs;
private:
int _pc_offset;
int _omv_count;
int _omv_data_size;
unsigned char* _omv_data;
// Accessors
private:
public:
// pc-offset handling
// Check to avoid double insertion
// Construction
// frame_size units are stack-slots (4 bytes) NOT intptr_t; we can name odd
// slots to hold 4-byte values like ints and floats in the LP64 build.
int heap_size() const;
}
// Printing
};
friend class VMStructs;
private:
int _om_count;
int _om_size;
void grow_om_data();
void set(int index,OopMap* value) { assert((index == 0) || ((index > 0) && (index < om_size())),"bad index"); _om_data[index] = value; }
public:
OopMapSet();
// returns the number of OopMaps in this OopMapSet
// returns the OopMap at a given index
OopMap* at(int index) const { assert((index >= 0) && (index <= om_count()),"bad index"); return _om_data[index]; }
// Collect OopMaps.
// Returns the only oop map. Used for reconstructing
// Adapter frames during deoptimization
// returns OopMap in that is anchored to the pc
int heap_size() const;
// Methods oops_do() and all_do() filter out NULL oops and
// oop == Universe::narrow_oop_base() before passing oops
// to closures.
// Iterates through frame for a compiled method
// Iterates through frame for a compiled method for dead ones and values, too
// Printing
};
private:
int _mask;
int _size;
int _position;
bool _valid_omv;
void find_next();
public:
};
// Derived pointer support. This table keeps track of all derived points on a
// oops, it is filled in with references to all locations that contains a
// derived oop (assumed to be very few). When the GC is complete, the derived
// pointers are updated based on their base pointers new value and an offset.
#ifdef COMPILER2
friend class VMStructs;
private:
public:
static void update_pointers(); // Called after scavenge/GC
};
// A utility class to temporarily "deactivate" the DerivedPointerTable.
// (Note: clients are responsible for any MT-safety issues)
private:
bool _active;
public:
if (_active) {
DerivedPointerTable::set_active(false);
}
}
"Inconsistency: not MT-safe");
if (_active) {
DerivedPointerTable::set_active(true);
}
}
};
#endif // COMPILER2
#endif // SHARE_VM_COMPILER_OOPMAP_HPP