6978355: renaming for 6961697

This is the renaming part of 6961697 to keep the actual changes small for review.

Reviewed-by: kvn, never
This commit is contained in:
Christian Thalinger 2010-08-25 05:27:54 -07:00
parent 3756a7daa9
commit a4b2fe3b1c
66 changed files with 613 additions and 658 deletions

View file

@ -39,7 +39,7 @@ unsigned int CodeBlob::allocation_size(CodeBuffer* cb, int header_size) {
size += round_to(cb->total_relocation_size(), oopSize);
// align the size to CodeEntryAlignment
size = align_code_offset(size);
size += round_to(cb->total_code_size(), oopSize);
size += round_to(cb->total_content_size(), oopSize);
size += round_to(cb->total_oop_size(), oopSize);
return size;
}
@ -47,8 +47,8 @@ unsigned int CodeBlob::allocation_size(CodeBuffer* cb, int header_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) {
assert(size == round_to(size, oopSize), "unaligned size");
assert(locs_size == round_to(locs_size, oopSize), "unaligned size");
assert(size == round_to(size, oopSize), "unaligned size");
assert(locs_size == round_to(locs_size, oopSize), "unaligned size");
assert(header_size == round_to(header_size, oopSize), "unaligned size");
assert(!UseRelocIndex, "no space allocated for reloc index yet");
@ -64,7 +64,8 @@ CodeBlob::CodeBlob(const char* name, int header_size, int size, int frame_comple
_frame_complete_offset = frame_complete;
_header_size = header_size;
_relocation_size = locs_size;
_instructions_offset = align_code_offset(header_size + locs_size);
_content_offset = align_code_offset(header_size + _relocation_size);
_code_offset = _content_offset;
_data_offset = size;
_frame_size = 0;
set_oop_maps(NULL);
@ -82,7 +83,7 @@ CodeBlob::CodeBlob(
int frame_size,
OopMapSet* oop_maps
) {
assert(size == round_to(size, oopSize), "unaligned size");
assert(size == round_to(size, oopSize), "unaligned size");
assert(header_size == round_to(header_size, oopSize), "unaligned size");
_name = name;
@ -90,8 +91,9 @@ CodeBlob::CodeBlob(
_frame_complete_offset = frame_complete;
_header_size = header_size;
_relocation_size = round_to(cb->total_relocation_size(), oopSize);
_instructions_offset = align_code_offset(header_size + _relocation_size);
_data_offset = _instructions_offset + round_to(cb->total_code_size(), oopSize);
_content_offset = align_code_offset(header_size + _relocation_size);
_code_offset = _content_offset + cb->total_offset_of(cb->insts()->start());
_data_offset = _content_offset + round_to(cb->total_content_size(), oopSize);
assert(_data_offset <= size, "codeBlob is too small");
cb->copy_code_and_locs_to(this);
@ -127,9 +129,8 @@ void CodeBlob::flush() {
OopMap* CodeBlob::oop_map_for_return_address(address return_address) {
address pc = return_address ;
assert (oop_maps() != NULL, "nope");
return oop_maps()->find_map_at_offset ((intptr_t) pc - (intptr_t) instructions_begin());
assert(oop_maps() != NULL, "nope");
return oop_maps()->find_map_at_offset((intptr_t) return_address - (intptr_t) code_begin());
}
@ -284,12 +285,12 @@ RuntimeStub* RuntimeStub::new_runtime_stub(const char* stub_name,
jio_snprintf(stub_id, sizeof(stub_id), "RuntimeStub - %s", stub_name);
if (PrintStubCode) {
tty->print_cr("Decoding %s " INTPTR_FORMAT, stub_id, stub);
Disassembler::decode(stub->instructions_begin(), stub->instructions_end());
Disassembler::decode(stub->code_begin(), stub->code_end());
}
Forte::register_stub(stub_id, stub->instructions_begin(), stub->instructions_end());
Forte::register_stub(stub_id, stub->code_begin(), stub->code_end());
if (JvmtiExport::should_post_dynamic_code_generated()) {
JvmtiExport::post_dynamic_code_generated(stub_name, stub->instructions_begin(), stub->instructions_end());
JvmtiExport::post_dynamic_code_generated(stub_name, stub->code_begin(), stub->code_end());
}
}
@ -355,17 +356,15 @@ DeoptimizationBlob* DeoptimizationBlob::create(
// Do not hold the CodeCache lock during name formatting.
if (blob != NULL) {
char blob_id[256];
jio_snprintf(blob_id, sizeof(blob_id), "DeoptimizationBlob@" PTR_FORMAT, blob->instructions_begin());
jio_snprintf(blob_id, sizeof(blob_id), "DeoptimizationBlob@" PTR_FORMAT, blob->code_begin());
if (PrintStubCode) {
tty->print_cr("Decoding %s " INTPTR_FORMAT, blob_id, blob);
Disassembler::decode(blob->instructions_begin(), blob->instructions_end());
Disassembler::decode(blob->code_begin(), blob->code_end());
}
Forte::register_stub(blob_id, blob->instructions_begin(), blob->instructions_end());
Forte::register_stub(blob_id, blob->code_begin(), blob->code_end());
if (JvmtiExport::should_post_dynamic_code_generated()) {
JvmtiExport::post_dynamic_code_generated("DeoptimizationBlob",
blob->instructions_begin(),
blob->instructions_end());
JvmtiExport::post_dynamic_code_generated("DeoptimizationBlob", blob->code_begin(), blob->code_end());
}
}
@ -412,17 +411,15 @@ UncommonTrapBlob* UncommonTrapBlob::create(
// Do not hold the CodeCache lock during name formatting.
if (blob != NULL) {
char blob_id[256];
jio_snprintf(blob_id, sizeof(blob_id), "UncommonTrapBlob@" PTR_FORMAT, blob->instructions_begin());
jio_snprintf(blob_id, sizeof(blob_id), "UncommonTrapBlob@" PTR_FORMAT, blob->code_begin());
if (PrintStubCode) {
tty->print_cr("Decoding %s " INTPTR_FORMAT, blob_id, blob);
Disassembler::decode(blob->instructions_begin(), blob->instructions_end());
Disassembler::decode(blob->code_begin(), blob->code_end());
}
Forte::register_stub(blob_id, blob->instructions_begin(), blob->instructions_end());
Forte::register_stub(blob_id, blob->code_begin(), blob->code_end());
if (JvmtiExport::should_post_dynamic_code_generated()) {
JvmtiExport::post_dynamic_code_generated("UncommonTrapBlob",
blob->instructions_begin(),
blob->instructions_end());
JvmtiExport::post_dynamic_code_generated("UncommonTrapBlob", blob->code_begin(), blob->code_end());
}
}
@ -471,17 +468,15 @@ ExceptionBlob* ExceptionBlob::create(
// We do not need to hold the CodeCache lock during name formatting
if (blob != NULL) {
char blob_id[256];
jio_snprintf(blob_id, sizeof(blob_id), "ExceptionBlob@" PTR_FORMAT, blob->instructions_begin());
jio_snprintf(blob_id, sizeof(blob_id), "ExceptionBlob@" PTR_FORMAT, blob->code_begin());
if (PrintStubCode) {
tty->print_cr("Decoding %s " INTPTR_FORMAT, blob_id, blob);
Disassembler::decode(blob->instructions_begin(), blob->instructions_end());
Disassembler::decode(blob->code_begin(), blob->code_end());
}
Forte::register_stub(blob_id, blob->instructions_begin(), blob->instructions_end());
Forte::register_stub(blob_id, blob->code_begin(), blob->code_end());
if (JvmtiExport::should_post_dynamic_code_generated()) {
JvmtiExport::post_dynamic_code_generated("ExceptionBlob",
blob->instructions_begin(),
blob->instructions_end());
JvmtiExport::post_dynamic_code_generated("ExceptionBlob", blob->code_begin(), blob->code_end());
}
}
@ -529,17 +524,15 @@ SafepointBlob* SafepointBlob::create(
// We do not need to hold the CodeCache lock during name formatting.
if (blob != NULL) {
char blob_id[256];
jio_snprintf(blob_id, sizeof(blob_id), "SafepointBlob@" PTR_FORMAT, blob->instructions_begin());
jio_snprintf(blob_id, sizeof(blob_id), "SafepointBlob@" PTR_FORMAT, blob->code_begin());
if (PrintStubCode) {
tty->print_cr("Decoding %s " INTPTR_FORMAT, blob_id, blob);
Disassembler::decode(blob->instructions_begin(), blob->instructions_end());
Disassembler::decode(blob->code_begin(), blob->code_end());
}
Forte::register_stub(blob_id, blob->instructions_begin(), blob->instructions_end());
Forte::register_stub(blob_id, blob->code_begin(), blob->code_end());
if (JvmtiExport::should_post_dynamic_code_generated()) {
JvmtiExport::post_dynamic_code_generated("SafepointBlob",
blob->instructions_begin(),
blob->instructions_end());
JvmtiExport::post_dynamic_code_generated("SafepointBlob", blob->code_begin(), blob->code_end());
}
}

View file

@ -35,7 +35,8 @@
// Layout:
// - header
// - relocation
// - instruction space
// - content space
// - instruction space
// - data space
class DeoptimizationBlob;
@ -48,7 +49,8 @@ class CodeBlob VALUE_OBJ_CLASS_SPEC {
int _size; // total size of CodeBlob in bytes
int _header_size; // size of header (depends on subclass)
int _relocation_size; // size of relocation
int _instructions_offset; // offset to where instructions region begins
int _content_offset; // offset to where content region begins (this includes consts, insts, stubs)
int _code_offset; // offset to where instructions region begins (this includes insts, stubs)
int _frame_complete_offset; // instruction offsets in [0.._frame_complete_offset) have
// not finished setting up their frame. Beware of pc's in
// that range. There is a similar range(s) on returns
@ -106,31 +108,36 @@ class CodeBlob VALUE_OBJ_CLASS_SPEC {
address header_end() const { return ((address) this) + _header_size; };
relocInfo* relocation_begin() const { return (relocInfo*) header_end(); };
relocInfo* relocation_end() const { return (relocInfo*)(header_end() + _relocation_size); }
address instructions_begin() const { return (address) header_begin() + _instructions_offset; }
address instructions_end() const { return (address) header_begin() + _data_offset; }
address content_begin() const { return (address) header_begin() + _content_offset; }
address content_end() const { return (address) header_begin() + _data_offset; }
address code_begin() const { return (address) header_begin() + _code_offset; }
address code_end() const { return (address) header_begin() + _data_offset; }
address data_begin() const { return (address) header_begin() + _data_offset; }
address data_end() const { return (address) header_begin() + _size; }
// Offsets
int relocation_offset() const { return _header_size; }
int instructions_offset() const { return _instructions_offset; }
int content_offset() const { return _content_offset; }
int code_offset() const { return _code_offset; }
int data_offset() const { return _data_offset; }
// Sizes
int size() const { return _size; }
int header_size() const { return _header_size; }
int relocation_size() const { return (address) relocation_end() - (address) relocation_begin(); }
int instructions_size() const { return instructions_end() - instructions_begin(); }
int data_size() const { return data_end() - data_begin(); }
int content_size() const { return content_end() - content_begin(); }
int code_size() const { return code_end() - code_begin(); }
int data_size() const { return data_end() - data_begin(); }
// Containment
bool blob_contains(address addr) const { return header_begin() <= addr && addr < data_end(); }
bool blob_contains(address addr) const { return header_begin() <= addr && addr < data_end(); }
bool relocation_contains(relocInfo* addr) const{ return relocation_begin() <= addr && addr < relocation_end(); }
bool instructions_contains(address addr) const { return instructions_begin() <= addr && addr < instructions_end(); }
bool data_contains(address addr) const { return data_begin() <= addr && addr < data_end(); }
bool contains(address addr) const { return instructions_contains(addr); }
bool is_frame_complete_at(address addr) const { return instructions_contains(addr) &&
addr >= instructions_begin() + _frame_complete_offset; }
bool content_contains(address addr) const { return content_begin() <= addr && addr < content_end(); }
bool code_contains(address addr) const { return code_begin() <= addr && addr < code_end(); }
bool data_contains(address addr) const { return data_begin() <= addr && addr < data_end(); }
bool contains(address addr) const { return content_contains(addr); }
bool is_frame_complete_at(address addr) const { return code_contains(addr) &&
addr >= code_begin() + _frame_complete_offset; }
// CodeCache support: really only used by the nmethods, but in order to get
// asserts and certain bookkeeping to work in the CodeCache they are defined
@ -169,7 +176,7 @@ class CodeBlob VALUE_OBJ_CLASS_SPEC {
// Print the comment associated with offset on stream, if there is one
virtual void print_block_comment(outputStream* stream, address block_begin) {
intptr_t offset = (intptr_t)(block_begin - instructions_begin());
intptr_t offset = (intptr_t)(block_begin - code_begin());
_comments.print_block_comment(stream, offset);
}
@ -286,7 +293,7 @@ class RuntimeStub: public CodeBlob {
// GC support
bool caller_must_gc_arguments(JavaThread* thread) const { return _caller_must_gc_arguments; }
address entry_point() { return instructions_begin(); }
address entry_point() { return code_begin(); }
// GC/Verification support
void preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, OopClosure* f) { /* nothing to do */ }
@ -313,13 +320,15 @@ class SingletonBlob: public CodeBlob {
OopMapSet* oop_maps
)
: CodeBlob(name, cb, header_size, size, CodeOffsets::frame_never_safe, frame_size, oop_maps)
{};
{};
bool is_alive() const { return true; }
address entry_point() { return code_begin(); }
void verify(); // does nothing
void print_on(outputStream* st) const;
void print_value_on(outputStream* st) const;
bool is_alive() const { return true; }
void verify(); // does nothing
void print_on(outputStream* st) const;
void print_value_on(outputStream* st) const;
};
@ -376,9 +385,9 @@ class DeoptimizationBlob: public SingletonBlob {
// Printing
void print_value_on(outputStream* st) const;
address unpack() const { return instructions_begin() + _unpack_offset; }
address unpack_with_exception() const { return instructions_begin() + _unpack_with_exception; }
address unpack_with_reexecution() const { return instructions_begin() + _unpack_with_reexecution; }
address unpack() const { return code_begin() + _unpack_offset; }
address unpack_with_exception() const { return code_begin() + _unpack_with_exception; }
address unpack_with_reexecution() const { return code_begin() + _unpack_with_reexecution; }
// Alternate entry point for C1 where the exception and issuing pc
// are in JavaThread::_exception_oop and JavaThread::_exception_pc
@ -387,9 +396,9 @@ class DeoptimizationBlob: public SingletonBlob {
// there may be live values in those registers during deopt.
void set_unpack_with_exception_in_tls_offset(int offset) {
_unpack_with_exception_in_tls = offset;
assert(contains(instructions_begin() + _unpack_with_exception_in_tls), "must be PC inside codeblob");
assert(code_contains(code_begin() + _unpack_with_exception_in_tls), "must be PC inside codeblob");
}
address unpack_with_exception_in_tls() const { return instructions_begin() + _unpack_with_exception_in_tls; }
address unpack_with_exception_in_tls() const { return code_begin() + _unpack_with_exception_in_tls; }
};

View file

@ -76,14 +76,14 @@ class CodeBlob_sizes {
relocation_size += cb->relocation_size();
if (cb->is_nmethod()) {
nmethod* nm = cb->as_nmethod_or_null();
code_size += nm->code_size();
code_size += nm->insts_size();
stub_size += nm->stub_size();
scopes_oop_size += nm->oops_size();
scopes_data_size += nm->scopes_data_size();
scopes_pcs_size += nm->scopes_pcs_size();
} else {
code_size += cb->instructions_size();
code_size += cb->code_size();
}
}
};
@ -210,7 +210,7 @@ void CodeCache::commit(CodeBlob* cb) {
}
// flush the hardware I-cache
ICache::invalidate_range(cb->instructions_begin(), cb->instructions_size());
ICache::invalidate_range(cb->content_begin(), cb->content_size());
}
@ -804,8 +804,8 @@ void CodeCache::print_internals() {
if(nm->method() != NULL && nm->is_java_method()) {
nmethodJava++;
if(nm->code_size() > maxCodeSize) {
maxCodeSize = nm->code_size();
if (nm->insts_size() > maxCodeSize) {
maxCodeSize = nm->insts_size();
}
}
} else if (cb->is_runtime_stub()) {
@ -830,7 +830,7 @@ void CodeCache::print_internals() {
if (cb->is_nmethod()) {
nmethod* nm = (nmethod*)cb;
if(nm->is_java_method()) {
buckets[nm->code_size() / bucketSize]++;
buckets[nm->insts_size() / bucketSize]++;
}
}
}
@ -896,11 +896,11 @@ void CodeCache::print() {
FOR_ALL_BLOBS(p) {
if (p->is_alive()) {
number_of_blobs++;
code_size += p->instructions_size();
code_size += p->code_size();
OopMapSet* set = p->oop_maps();
if (set != NULL) {
number_of_oop_maps += set->size();
map_size += set->heap_size();
map_size += set->heap_size();
}
}
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -219,8 +219,8 @@ void ImplicitExceptionTable::copy_to( nmethod* nm ) {
void ImplicitExceptionTable::verify(nmethod *nm) const {
for (uint i = 0; i < len(); i++) {
if ((*adr(i) > (unsigned int)nm->code_size()) ||
(*(adr(i)+1) > (unsigned int)nm->code_size()))
if ((*adr(i) > (unsigned int)nm->insts_size()) ||
(*(adr(i)+1) > (unsigned int)nm->insts_size()))
fatal(err_msg("Invalid offset in ImplicitExceptionTable at " PTR_FORMAT, _data));
}
}

View file

@ -87,7 +87,7 @@ struct nmethod_stats_struct {
int nmethod_count;
int total_size;
int relocation_size;
int code_size;
int insts_size;
int stub_size;
int consts_size;
int scopes_data_size;
@ -101,7 +101,7 @@ struct nmethod_stats_struct {
nmethod_count += 1;
total_size += nm->size();
relocation_size += nm->relocation_size();
code_size += nm->code_size();
insts_size += nm->insts_size();
stub_size += nm->stub_size();
consts_size += nm->consts_size();
oops_size += nm->oops_size();
@ -116,7 +116,7 @@ struct nmethod_stats_struct {
tty->print_cr("Statistics for %d bytecoded nmethods:", nmethod_count);
if (total_size != 0) tty->print_cr(" total in heap = %d", total_size);
if (relocation_size != 0) tty->print_cr(" relocation = %d", relocation_size);
if (code_size != 0) tty->print_cr(" main code = %d", code_size);
if (insts_size != 0) tty->print_cr(" main code = %d", insts_size);
if (stub_size != 0) tty->print_cr(" stub code = %d", stub_size);
if (consts_size != 0) tty->print_cr(" constants = %d", consts_size);
if (oops_size != 0) tty->print_cr(" oops = %d", oops_size);
@ -130,13 +130,13 @@ struct nmethod_stats_struct {
int native_nmethod_count;
int native_total_size;
int native_relocation_size;
int native_code_size;
int native_insts_size;
int native_oops_size;
void note_native_nmethod(nmethod* nm) {
native_nmethod_count += 1;
native_total_size += nm->size();
native_relocation_size += nm->relocation_size();
native_code_size += nm->code_size();
native_insts_size += nm->insts_size();
native_oops_size += nm->oops_size();
}
void print_native_nmethod_stats() {
@ -144,7 +144,7 @@ struct nmethod_stats_struct {
tty->print_cr("Statistics for %d native nmethods:", native_nmethod_count);
if (native_total_size != 0) tty->print_cr(" N. total size = %d", native_total_size);
if (native_relocation_size != 0) tty->print_cr(" N. relocation = %d", native_relocation_size);
if (native_code_size != 0) tty->print_cr(" N. main code = %d", native_code_size);
if (native_insts_size != 0) tty->print_cr(" N. main code = %d", native_insts_size);
if (native_oops_size != 0) tty->print_cr(" N. oops = %d", native_oops_size);
}
@ -404,7 +404,7 @@ void nmethod::add_handler_for_exception_and_pc(Handle exception, address pc, add
int nmethod::total_size() const {
return
code_size() +
insts_size() +
stub_size() +
consts_size() +
scopes_data_size() +
@ -618,8 +618,8 @@ nmethod::nmethod(
_deoptimize_mh_offset = 0;
_orig_pc_offset = 0;
_stub_offset = data_offset();
_consts_offset = data_offset();
_stub_offset = data_offset();
_oops_offset = data_offset();
_scopes_data_offset = _oops_offset + round_to(code_buffer->total_oop_size(), oopSize);
_scopes_pcs_offset = _scopes_data_offset;
@ -629,8 +629,8 @@ nmethod::nmethod(
_nmethod_end_offset = _nul_chk_table_offset;
_compile_id = 0; // default
_comp_level = CompLevel_none;
_entry_point = instructions_begin();
_verified_entry_point = instructions_begin() + offsets->value(CodeOffsets::Verified_Entry);
_entry_point = code_begin() + offsets->value(CodeOffsets::Entry);
_verified_entry_point = code_begin() + offsets->value(CodeOffsets::Verified_Entry);
_osr_entry_point = NULL;
_exception_cache = NULL;
_pc_desc_cache.reset_to(NULL);
@ -696,8 +696,8 @@ nmethod::nmethod(
_unwind_handler_offset = -1;
_trap_offset = offsets->value(CodeOffsets::Dtrace_trap);
_orig_pc_offset = 0;
_stub_offset = data_offset();
_consts_offset = data_offset();
_stub_offset = data_offset();
_oops_offset = data_offset();
_scopes_data_offset = _oops_offset + round_to(code_buffer->total_oop_size(), oopSize);
_scopes_pcs_offset = _scopes_data_offset;
@ -707,8 +707,8 @@ nmethod::nmethod(
_nmethod_end_offset = _nul_chk_table_offset;
_compile_id = 0; // default
_comp_level = CompLevel_none;
_entry_point = instructions_begin();
_verified_entry_point = instructions_begin() + offsets->value(CodeOffsets::Verified_Entry);
_entry_point = code_begin() + offsets->value(CodeOffsets::Entry);
_verified_entry_point = code_begin() + offsets->value(CodeOffsets::Verified_Entry);
_osr_entry_point = NULL;
_exception_cache = NULL;
_pc_desc_cache.reset_to(NULL);
@ -787,18 +787,21 @@ nmethod::nmethod(
_comp_level = comp_level;
_compiler = compiler;
_orig_pc_offset = orig_pc_offset;
_stub_offset = instructions_offset() + code_buffer->total_offset_of(code_buffer->stubs()->start());
// Section offsets
_consts_offset = content_offset() + code_buffer->total_offset_of(code_buffer->consts()->start());
_stub_offset = content_offset() + code_buffer->total_offset_of(code_buffer->stubs()->start());
// Exception handler and deopt handler are in the stub section
_exception_offset = _stub_offset + offsets->value(CodeOffsets::Exceptions);
_deoptimize_offset = _stub_offset + offsets->value(CodeOffsets::Deopt);
_deoptimize_mh_offset = _stub_offset + offsets->value(CodeOffsets::DeoptMH);
_exception_offset = _stub_offset + offsets->value(CodeOffsets::Exceptions);
_deoptimize_offset = _stub_offset + offsets->value(CodeOffsets::Deopt);
_deoptimize_mh_offset = _stub_offset + offsets->value(CodeOffsets::DeoptMH);
if (offsets->value(CodeOffsets::UnwindHandler) != -1) {
_unwind_handler_offset = instructions_offset() + offsets->value(CodeOffsets::UnwindHandler);
_unwind_handler_offset = code_offset() + offsets->value(CodeOffsets::UnwindHandler);
} else {
_unwind_handler_offset = -1;
_unwind_handler_offset = -1;
}
_consts_offset = instructions_offset() + code_buffer->total_offset_of(code_buffer->consts()->start());
_oops_offset = data_offset();
_scopes_data_offset = _oops_offset + round_to(code_buffer->total_oop_size (), oopSize);
_scopes_pcs_offset = _scopes_data_offset + round_to(debug_info->data_size (), oopSize);
@ -807,9 +810,9 @@ nmethod::nmethod(
_nul_chk_table_offset = _handler_table_offset + round_to(handler_table->size_in_bytes(), oopSize);
_nmethod_end_offset = _nul_chk_table_offset + round_to(nul_chk_table->size_in_bytes(), oopSize);
_entry_point = instructions_begin();
_verified_entry_point = instructions_begin() + offsets->value(CodeOffsets::Verified_Entry);
_osr_entry_point = instructions_begin() + offsets->value(CodeOffsets::OSR_Entry);
_entry_point = code_begin() + offsets->value(CodeOffsets::Entry);
_verified_entry_point = code_begin() + offsets->value(CodeOffsets::Verified_Entry);
_osr_entry_point = code_begin() + offsets->value(CodeOffsets::OSR_Entry);
_exception_cache = NULL;
_pc_desc_cache.reset_to(scopes_pcs_begin());
@ -878,12 +881,11 @@ void nmethod::log_new_nmethod() const {
HandleMark hm;
xtty->begin_elem("nmethod");
log_identity(xtty);
xtty->print(" entry='" INTPTR_FORMAT "' size='%d'",
instructions_begin(), size());
xtty->print(" entry='" INTPTR_FORMAT "' size='%d'", code_begin(), size());
xtty->print(" address='" INTPTR_FORMAT "'", (intptr_t) this);
LOG_OFFSET(xtty, relocation);
LOG_OFFSET(xtty, code);
LOG_OFFSET(xtty, insts);
LOG_OFFSET(xtty, stub);
LOG_OFFSET(xtty, consts);
LOG_OFFSET(xtty, scopes_data);
@ -1460,7 +1462,7 @@ void nmethod::post_compiled_method_load_event() {
moop->name()->utf8_length(),
moop->signature()->bytes(),
moop->signature()->utf8_length(),
code_begin(), code_size());
insts_begin(), insts_size());
if (JvmtiExport::should_post_compiled_method_load() ||
JvmtiExport::should_post_compiled_method_unload()) {
@ -1502,7 +1504,7 @@ void nmethod::post_compiled_method_unload() {
if (_jmethod_id != NULL && JvmtiExport::should_post_compiled_method_unload()) {
assert(!unload_reported(), "already unloaded");
HandleMark hm;
JvmtiExport::post_compiled_method_unload(_jmethod_id, code_begin());
JvmtiExport::post_compiled_method_unload(_jmethod_id, insts_begin());
}
// The JVMTI CompiledMethodUnload event can be enabled or disabled at
@ -1854,7 +1856,7 @@ void nmethod::copy_scopes_pcs(PcDesc* pcs, int count) {
// Adjust the final sentinel downward.
PcDesc* last_pc = &scopes_pcs_begin()[count-1];
assert(last_pc->pc_offset() == PcDesc::upper_offset_limit, "sanity");
last_pc->set_pc_offset(instructions_size() + 1);
last_pc->set_pc_offset(content_size() + 1);
for (; last_pc + 1 < scopes_pcs_end(); last_pc += 1) {
// Fill any rounding gaps with copies of the last record.
last_pc[1] = last_pc[0];
@ -1894,7 +1896,7 @@ static PcDesc* linear_search(nmethod* nm, int pc_offset, bool approximate) {
// Finds a PcDesc with real-pc equal to "pc"
PcDesc* nmethod::find_pc_desc_internal(address pc, bool approximate) {
address base_address = instructions_begin();
address base_address = code_begin();
if ((pc < base_address) ||
(pc - base_address) >= (ptrdiff_t) PcDesc::upper_offset_limit) {
return NULL; // PC is wildly out of range
@ -2042,7 +2044,7 @@ bool nmethod::is_dependent_on_method(methodOop dependee) {
bool nmethod::is_patchable_at(address instr_addr) {
assert (code_contains(instr_addr), "wrong nmethod used");
assert(insts_contains(instr_addr), "wrong nmethod used");
if (is_zombie()) {
// a zombie may never be patched
return false;
@ -2054,7 +2056,7 @@ bool nmethod::is_patchable_at(address instr_addr) {
address nmethod::continuation_for_implicit_exception(address pc) {
// Exception happened outside inline-cache check code => we are inside
// an active nmethod => use cpc to determine a return address
int exception_offset = pc - instructions_begin();
int exception_offset = pc - code_begin();
int cont_offset = ImplicitExceptionTable(this).at( exception_offset );
#ifdef ASSERT
if (cont_offset == 0) {
@ -2075,7 +2077,7 @@ address nmethod::continuation_for_implicit_exception(address pc) {
// Let the normal error handling report the exception
return NULL;
}
return instructions_begin() + cont_offset;
return code_begin() + cont_offset;
}
@ -2334,10 +2336,10 @@ void nmethod::print() const {
relocation_begin(),
relocation_end(),
relocation_size());
if (code_size () > 0) tty->print_cr(" main code [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
code_begin(),
code_end(),
code_size());
if (insts_size () > 0) tty->print_cr(" main code [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
insts_begin(),
insts_end(),
insts_size());
if (stub_size () > 0) tty->print_cr(" stub code [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
stub_begin(),
stub_end(),
@ -2607,7 +2609,7 @@ void nmethod::print_code_comment_on(outputStream* st, int column, u_char* begin,
// First, find an oopmap in (begin, end].
// We use the odd half-closed interval so that oop maps and scope descs
// which are tied to the byte after a call are printed with the call itself.
address base = instructions_begin();
address base = code_begin();
OopMapSet* oms = oop_maps();
if (oms != NULL) {
for (int i = 0, imax = oms->size(); i < imax; i++) {
@ -2695,10 +2697,10 @@ void nmethod::print_code_comment_on(outputStream* st, int column, u_char* begin,
st->move_to(column);
st->print("; {%s}", str);
}
int cont_offset = ImplicitExceptionTable(this).at(begin - instructions_begin());
int cont_offset = ImplicitExceptionTable(this).at(begin - code_begin());
if (cont_offset != 0) {
st->move_to(column);
st->print("; implicit exception: dispatches to " INTPTR_FORMAT, instructions_begin() + cont_offset);
st->print("; implicit exception: dispatches to " INTPTR_FORMAT, code_begin() + cont_offset);
}
}
@ -2732,7 +2734,7 @@ void nmethod::print_handler_table() {
}
void nmethod::print_nul_chk_table() {
ImplicitExceptionTable(this).print(instructions_begin());
ImplicitExceptionTable(this).print(code_begin());
}
void nmethod::print_statistics() {

View file

@ -312,7 +312,7 @@ class nmethod : public CodeBlob {
int frame_size);
int trap_offset() const { return _trap_offset; }
address trap_address() const { return code_begin() + _trap_offset; }
address trap_address() const { return insts_begin() + _trap_offset; }
#endif // def HAVE_DTRACE_H
@ -336,8 +336,8 @@ class nmethod : public CodeBlob {
bool is_compiled_by_shark() const;
// boundaries for different parts
address code_begin () const { return _entry_point; }
address code_end () const { return header_begin() + _stub_offset ; }
address insts_begin () const { return code_begin(); }
address insts_end () const { return header_begin() + _stub_offset ; }
address exception_begin () const { return header_begin() + _exception_offset ; }
address deopt_handler_begin () const { return header_begin() + _deoptimize_offset ; }
address deopt_mh_handler_begin() const { return header_begin() + _deoptimize_mh_offset ; }
@ -361,7 +361,7 @@ class nmethod : public CodeBlob {
address nul_chk_table_end () const { return header_begin() + _nmethod_end_offset ; }
// Sizes
int code_size () const { return code_end () - code_begin (); }
int insts_size () const { return insts_end () - insts_begin (); }
int stub_size () const { return stub_end () - stub_begin (); }
int consts_size () const { return consts_end () - consts_begin (); }
int oops_size () const { return (address) oops_end () - (address) oops_begin (); }
@ -374,7 +374,7 @@ class nmethod : public CodeBlob {
int total_size () const;
// Containment
bool code_contains (address addr) const { return code_begin () <= addr && addr < code_end (); }
bool insts_contains (address addr) const { return insts_begin () <= addr && addr < insts_end (); }
bool stub_contains (address addr) const { return stub_begin () <= addr && addr < stub_end (); }
bool consts_contains (address addr) const { return consts_begin () <= addr && addr < consts_end (); }
bool oops_contains (oop* addr) const { return oops_begin () <= addr && addr < oops_end (); }
@ -506,7 +506,7 @@ public:
void clear_inline_caches();
void cleanup_inline_caches();
bool inlinecache_check_contains(address addr) const {
return (addr >= instructions_begin() && addr < verified_entry_point());
return (addr >= code_begin() && addr < verified_entry_point());
}
// unlink and deallocate this nmethod
@ -559,7 +559,7 @@ public:
PcDesc* find_pc_desc(address pc, bool approximate) {
PcDesc* desc = _pc_desc_cache.last_pc_desc();
if (desc != NULL && desc->pc_offset() == pc - instructions_begin()) {
if (desc != NULL && desc->pc_offset() == pc - code_begin()) {
return desc;
}
return find_pc_desc_internal(pc, approximate);

View file

@ -34,7 +34,7 @@ PcDesc::PcDesc(int pc_offset, int scope_decode_offset, int obj_decode_offset) {
}
address PcDesc::real_pc(const nmethod* code) const {
return code->instructions_begin() + pc_offset();
return code->code_begin() + pc_offset();
}
void PcDesc::print(nmethod* code) {

View file

@ -128,13 +128,11 @@ void RelocIterator::initialize(nmethod* nm, address begin, address limit) {
_code = nm;
_current = nm->relocation_begin() - 1;
_end = nm->relocation_end();
_addr = (address) nm->instructions_begin();
_addr = (address) nm->code_begin();
assert(!has_current(), "just checking");
address code_end = nm->instructions_end();
assert(begin == NULL || begin >= nm->instructions_begin(), "in bounds");
// FIX THIS assert(limit == NULL || limit <= code_end, "in bounds");
assert(begin == NULL || begin >= nm->code_begin(), "in bounds");
assert(limit == NULL || limit <= nm->code_end(), "in bounds");
set_limits(begin, limit);
}
@ -267,7 +265,7 @@ void RelocIterator::set_limits(address begin, address limit) {
// skip ahead
RelocIndexEntry* index = (RelocIndexEntry*)_end;
RelocIndexEntry* index_limit = (RelocIndexEntry*)((address)index + index_size);
assert(_addr == _code->instructions_begin(), "_addr must be unadjusted");
assert(_addr == _code->code_begin(), "_addr must be unadjusted");
int card = (begin - _addr) / indexCardSize;
if (card > 0) {
if (index+card-1 < index_limit) index += card-1;
@ -369,7 +367,7 @@ address RelocIterator::compute_section_start(int n) const {
CodeBlob* cb = code();
guarantee(cb != NULL, "must have a code blob");
if (n == CodeBuffer::SECT_INSTS)
return CACHE = cb->instructions_begin();
return CACHE = cb->code_begin();
assert(cb->is_nmethod(), "only nmethods have these sections");
nmethod* nm = (nmethod*) cb;
address res = NULL;
@ -383,7 +381,7 @@ address RelocIterator::compute_section_start(int n) const {
default:
ShouldNotReachHere();
}
assert(nm->contains(res) || res == nm->instructions_end(), "tame pointer");
assert(nm->contains(res) || res == nm->code_end(), "tame pointer");
CACHE = res;
return res;
#undef CACHE

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -174,7 +174,7 @@ void ScopeDesc::print_on(outputStream* st, PcDesc* pd) const {
print_value_on(st);
// decode offsets
if (WizardMode) {
st->print("ScopeDesc[%d]@" PTR_FORMAT " ", _decode_offset, _code->instructions_begin());
st->print("ScopeDesc[%d]@" PTR_FORMAT " ", _decode_offset, _code->content_begin());
st->print_cr(" offset: %d", _decode_offset);
st->print_cr(" bci: %d", bci());
st->print_cr(" reexecute: %s", should_reexecute() ? "true" : "false");

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -66,9 +66,9 @@ StubQueue::StubQueue(StubInterface* stub_interface, int buffer_size,
vm_exit_out_of_memory(size, err_msg("CodeCache: no room for %s", name));
}
_stub_interface = stub_interface;
_buffer_size = blob->instructions_size();
_buffer_limit = blob->instructions_size();
_stub_buffer = blob->instructions_begin();
_buffer_size = blob->content_size();
_buffer_limit = blob->content_size();
_stub_buffer = blob->content_begin();
_queue_begin = 0;
_queue_end = 0;
_number_of_stubs = 0;

View file

@ -48,7 +48,7 @@ void* VtableStub::operator new(size_t size, int code_size) {
if (blob == NULL) {
vm_exit_out_of_memory(bytes, "CodeCache: no room for vtable chunks");
}
_chunk = blob->instructions_begin();
_chunk = blob->content_begin();
_chunk_end = _chunk + bytes;
Forte::register_stub("vtable stub", _chunk, _chunk_end);
// Notify JVMTI about this stub. The event will be recorded by the enclosing