codeBlob.cpp revision 1299
/*
* Copyright 1998-2010 Sun Microsystems, Inc. All Rights Reserved.
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
# include "incls/_precompiled.incl"
# include "incls/_codeBlob.cpp.incl"
unsigned int align_code_offset(int offset) {
// align the size to CodeEntryAlignment
return
- (int)CodeHeap::header_size();
}
// This must be consistent with the CodeBlob constructor's layout actions.
unsigned int size = header_size;
// align the size to CodeEntryAlignment
return size;
}
// Creates a simple CodeBlob. Sets up the size of the different regions.
CodeBlob::CodeBlob(const char* name, int header_size, int size, int frame_complete, int locs_size) {
// Note: If UseRelocIndex is enabled, there needs to be (at least) one
// extra word for the relocation information, containing the reloc
// index table length. Unfortunately, the reloc index table imple-
// mentation is not easily understandable and thus it is not clear
// what exactly the format is supposed to be. For now, we just turn
// off the use of this table (gri 7/6/2000).
_data_offset = size;
_oops_offset = size;
_oops_length = 0;
_frame_size = 0;
}
// Creates a CodeBlob from a CodeBuffer. Sets up the size of the different regions,
// and copy code and relocation info.
const char* name,
CodeBuffer* cb,
int header_size,
int size,
int frame_complete,
int frame_size,
) {
_oops_length = 0; // temporary, until the copy_oops handshake
cb->copy_code_and_locs_to(this);
#ifdef COMPILER1
// probably wrong for tiered
#endif // COMPILER1
}
// Danger Will Robinson! This method allocates a big
// chunk of memory, its your job to free it.
if (p != NULL) {
// We need to allocate a chunk big enough to hold the OopMapSet and all of its OopMaps
} else {
}
}
if (_oop_maps) {
FREE_C_HEAP_ARRAY(unsigned char, _oop_maps);
}
}
// Promote one word from an assembly-time handle to a live embedded oop.
// As a special case, IC oops are initialized to 1 or -1.
} else {
}
}
}
// Now we can fix up all the oops in the code.
// We need to do this in the code because
// the assembler uses jobjects as placeholders.
// The code and relocations have already been
// initialized by the CodeBlob constructor,
// so it is valid even at this early point to
// iterate over relocations and patch the code.
}
}
// No relocation info found for pc
}
return true;
}
return false;
}
return true;
}
return false;
}
bool initialize_immediates) {
// re-patch all oop-bearing instructions, just in case some oops moved
}
// Refresh the oop-related bits of this instruction.
}
// There must not be any interfering patches or breakpoints.
"no active breakpoint");
}
}
bool unloading_occurred) {
}
}
//----------------------------------------------------------------------------------------------------
// Implementation of BufferBlob
{}
unsigned int size = sizeof(BufferBlob);
// align the size to CodeEntryAlignment
{
}
// Track memory usage statistic after releasing CodeCache_lock
return blob;
}
{}
{
}
// Track memory usage statistic after releasing CodeCache_lock
return blob;
}
return p;
}
{
}
// Track memory usage statistic after releasing CodeCache_lock
}
//----------------------------------------------------------------------------------------------------
// Implementation of AdapterBlob
{
}
// Track memory usage statistic after releasing CodeCache_lock
return blob;
}
//----------------------------------------------------------------------------------------------------
// Implementation of MethodHandlesAdapterBlob
unsigned int size = sizeof(MethodHandlesAdapterBlob);
// align the size to CodeEntryAlignment
{
}
// Track memory usage statistic after releasing CodeCache_lock
return blob;
}
//----------------------------------------------------------------------------------------------------
// Implementation of RuntimeStub
const char* name,
CodeBuffer* cb,
int size,
int frame_complete,
int frame_size,
)
{
}
CodeBuffer* cb,
int frame_complete,
int frame_size,
bool caller_must_gc_arguments)
{
{
stub = new (size) RuntimeStub(stub_name, cb, size, frame_complete, frame_size, oop_maps, caller_must_gc_arguments);
}
// Do not hold the CodeCache lock during name formatting.
char stub_id[256];
if (PrintStubCode) {
}
JvmtiExport::post_dynamic_code_generated(stub_name, stub->instructions_begin(), stub->instructions_end());
}
}
// Track memory usage statistic after releasing CodeCache_lock
return stub;
}
if (!p) fatal("Initial size of CodeCache is too small");
return p;
}
//----------------------------------------------------------------------------------------------------
// Implementation of DeoptimizationBlob
CodeBuffer* cb,
int size,
int unpack_offset,
int frame_size
)
{
#ifdef COMPILER1
#endif
}
CodeBuffer* cb,
int unpack_offset,
int frame_size)
{
{
size,
}
// Do not hold the CodeCache lock during name formatting.
char blob_id[256];
jio_snprintf(blob_id, sizeof(blob_id), "DeoptimizationBlob@" PTR_FORMAT, blob->instructions_begin());
if (PrintStubCode) {
}
blob->instructions_end());
}
}
// Track memory usage statistic after releasing CodeCache_lock
return blob;
}
if (!p) fatal("Initial size of CodeCache is too small");
return p;
}
//----------------------------------------------------------------------------------------------------
// Implementation of UncommonTrapBlob
#ifdef COMPILER2
CodeBuffer* cb,
int size,
int frame_size
)
{}
CodeBuffer* cb,
int frame_size)
{
{
}
// Do not hold the CodeCache lock during name formatting.
char blob_id[256];
if (PrintStubCode) {
}
blob->instructions_end());
}
}
// Track memory usage statistic after releasing CodeCache_lock
return blob;
}
if (!p) fatal("Initial size of CodeCache is too small");
return p;
}
#endif // COMPILER2
//----------------------------------------------------------------------------------------------------
// Implementation of ExceptionBlob
#ifdef COMPILER2
CodeBuffer* cb,
int size,
int frame_size
)
{}
CodeBuffer* cb,
int frame_size)
{
{
}
// We do not need to hold the CodeCache lock during name formatting
char blob_id[256];
if (PrintStubCode) {
}
blob->instructions_end());
}
}
// Track memory usage statistic after releasing CodeCache_lock
return blob;
}
if (!p) fatal("Initial size of CodeCache is too small");
return p;
}
#endif // COMPILER2
//----------------------------------------------------------------------------------------------------
// Implementation of SafepointBlob
CodeBuffer* cb,
int size,
int frame_size
)
{}
CodeBuffer* cb,
int frame_size)
{
{
}
// We do not need to hold the CodeCache lock during name formatting.
char blob_id[256];
if (PrintStubCode) {
}
blob->instructions_end());
}
}
// Track memory usage statistic after releasing CodeCache_lock
return blob;
}
if (!p) fatal("Initial size of CodeCache is too small");
return p;
}
//----------------------------------------------------------------------------------------------------
// Verification and printing
}
#ifndef PRODUCT
}
}
#endif
void BufferBlob::verify() {
// unimplemented
}
#ifndef PRODUCT
void BufferBlob::print() const {
}
}
#endif
void RuntimeStub::verify() {
// unimplemented
}
#ifndef PRODUCT
void RuntimeStub::print() const {
}
}
#endif
void SingletonBlob::verify() {
// unimplemented
}
#ifndef PRODUCT
void SingletonBlob::print() const {
}
}
}
#endif // PRODUCT