aboutsummaryrefslogtreecommitdiff
path: root/src/share
diff options
context:
space:
mode:
authortwisti <none@none>2010-08-25 05:27:54 -0700
committertwisti <none@none>2010-08-25 05:27:54 -0700
commitc6865e24e0444bd5fdb6fb1e3117108765b29efc (patch)
treeb36d0c2b2e59e67b7b9b2c52b66f14eddb9e4182 /src/share
parent6d5fe3805a03867db608a887106167fbb79099a4 (diff)
6978355: renaming for 6961697
Summary: This is the renaming part of 6961697 to keep the actual changes small for review. Reviewed-by: kvn, never
Diffstat (limited to 'src/share')
-rw-r--r--src/share/vm/adlc/output_c.cpp2
-rw-r--r--src/share/vm/asm/codeBuffer.cpp53
-rw-r--r--src/share/vm/asm/codeBuffer.hpp63
-rw-r--r--src/share/vm/c1/c1_Compilation.cpp3
-rw-r--r--src/share/vm/c1/c1_Runtime1.cpp3
-rw-r--r--src/share/vm/c1/c1_Runtime1.hpp4
-rw-r--r--src/share/vm/ci/ciMethod.cpp14
-rw-r--r--src/share/vm/code/codeBlob.cpp67
-rw-r--r--src/share/vm/code/codeBlob.hpp59
-rw-r--r--src/share/vm/code/codeCache.cpp16
-rw-r--r--src/share/vm/code/exceptionHandlerTable.cpp6
-rw-r--r--src/share/vm/code/nmethod.cpp84
-rw-r--r--src/share/vm/code/nmethod.hpp14
-rw-r--r--src/share/vm/code/pcDesc.cpp2
-rw-r--r--src/share/vm/code/relocInfo.cpp14
-rw-r--r--src/share/vm/code/scopeDesc.cpp4
-rw-r--r--src/share/vm/code/stubs.cpp8
-rw-r--r--src/share/vm/code/vtableStubs.cpp2
-rw-r--r--src/share/vm/compiler/compileBroker.cpp10
-rw-r--r--src/share/vm/compiler/disassembler.cpp10
-rw-r--r--src/share/vm/interpreter/interpreter.hpp4
-rw-r--r--src/share/vm/interpreter/interpreterRuntime.cpp18
-rw-r--r--src/share/vm/opto/compile.cpp8
-rw-r--r--src/share/vm/opto/graphKit.cpp2
-rw-r--r--src/share/vm/opto/lcm.cpp5
-rw-r--r--src/share/vm/opto/library_call.cpp3
-rw-r--r--src/share/vm/opto/output.cpp21
-rw-r--r--src/share/vm/opto/stringopts.cpp2
-rw-r--r--src/share/vm/prims/jvmtiCodeBlobEvents.cpp5
-rw-r--r--src/share/vm/prims/jvmtiExport.cpp4
-rw-r--r--src/share/vm/prims/methodHandles.cpp3
-rw-r--r--src/share/vm/runtime/compilationPolicy.cpp2
-rw-r--r--src/share/vm/runtime/frame.cpp4
-rw-r--r--src/share/vm/runtime/icache.cpp4
-rw-r--r--src/share/vm/runtime/rframe.cpp4
-rw-r--r--src/share/vm/runtime/sharedRuntime.cpp36
-rw-r--r--src/share/vm/runtime/sharedRuntime.hpp31
-rw-r--r--src/share/vm/runtime/stubRoutines.cpp10
-rw-r--r--src/share/vm/runtime/vmStructs.cpp3
39 files changed, 306 insertions, 301 deletions
diff --git a/src/share/vm/adlc/output_c.cpp b/src/share/vm/adlc/output_c.cpp
index 393fd238b..75cdcacb9 100644
--- a/src/share/vm/adlc/output_c.cpp
+++ b/src/share/vm/adlc/output_c.cpp
@@ -2482,7 +2482,7 @@ void ArchDesc::defineEmit(FILE *fp, InstructForm &inst) {
}
// Save current instruction's starting address (helps with relocation).
- fprintf( fp, " cbuf.set_inst_mark();\n");
+ fprintf(fp, " cbuf.set_insts_mark();\n");
// // // idx0 is only needed for syntactic purposes and only by "storeSSI"
// fprintf( fp, " unsigned idx0 = 0;\n");
diff --git a/src/share/vm/asm/codeBuffer.cpp b/src/share/vm/asm/codeBuffer.cpp
index 77e7cdb87..cae51ddb8 100644
--- a/src/share/vm/asm/codeBuffer.cpp
+++ b/src/share/vm/asm/codeBuffer.cpp
@@ -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
@@ -74,12 +74,11 @@
typedef CodeBuffer::csize_t csize_t; // file-local definition
-// external buffer, in a predefined CodeBlob or other buffer area
+// External buffer, in a predefined CodeBlob.
// Important: The code_start must be taken exactly, and not realigned.
-CodeBuffer::CodeBuffer(address code_start, csize_t code_size) {
- assert(code_start != NULL, "sanity");
+CodeBuffer::CodeBuffer(CodeBlob* blob) {
initialize_misc("static buffer");
- initialize(code_start, code_size);
+ initialize(blob->content_begin(), blob->content_size());
assert(verify_section_allocation(), "initial use of buffer OK");
}
@@ -99,7 +98,7 @@ void CodeBuffer::initialize(csize_t code_size, csize_t locs_size) {
// Set up various pointers into the blob.
initialize(_total_start, _total_size);
- assert((uintptr_t)code_begin() % CodeEntryAlignment == 0, "instruction start not code entry aligned");
+ assert((uintptr_t)insts_begin() % CodeEntryAlignment == 0, "instruction start not code entry aligned");
pd_initialize();
@@ -192,8 +191,8 @@ void CodeBuffer::freeze_section(CodeSection* cs) {
void CodeBuffer::set_blob(BufferBlob* blob) {
_blob = blob;
if (blob != NULL) {
- address start = blob->instructions_begin();
- address end = blob->instructions_end();
+ address start = blob->content_begin();
+ address end = blob->content_end();
// Round up the starting address.
int align = _insts.alignment();
start += (-(intptr_t)start) & (align-1);
@@ -422,21 +421,21 @@ void CodeSection::expand_locs(int new_capacity) {
/// The pattern is the same for all functions.
/// We iterate over all the sections, padding each to alignment.
-csize_t CodeBuffer::total_code_size() const {
- csize_t code_size_so_far = 0;
+csize_t CodeBuffer::total_content_size() const {
+ csize_t size_so_far = 0;
for (int n = 0; n < (int)SECT_LIMIT; n++) {
const CodeSection* cs = code_section(n);
if (cs->is_empty()) continue; // skip trivial section
- code_size_so_far = cs->align_at_start(code_size_so_far);
- code_size_so_far += cs->size();
+ size_so_far = cs->align_at_start(size_so_far);
+ size_so_far += cs->size();
}
- return code_size_so_far;
+ return size_so_far;
}
void CodeBuffer::compute_final_layout(CodeBuffer* dest) const {
address buf = dest->_total_start;
csize_t buf_offset = 0;
- assert(dest->_total_size >= total_code_size(), "must be big enough");
+ assert(dest->_total_size >= total_content_size(), "must be big enough");
{
// not sure why this is here, but why not...
@@ -489,7 +488,7 @@ void CodeBuffer::compute_final_layout(CodeBuffer* dest) const {
}
// Done calculating sections; did it come out to the right end?
- assert(buf_offset == total_code_size(), "sanity");
+ assert(buf_offset == total_content_size(), "sanity");
assert(dest->verify_section_allocation(), "final configuration works");
}
@@ -515,7 +514,7 @@ csize_t CodeBuffer::total_offset_of(address addr) const {
csize_t CodeBuffer::total_relocation_size() const {
csize_t lsize = copy_relocations_to(NULL); // dry run only
- csize_t csize = total_code_size();
+ csize_t csize = total_content_size();
csize_t total = RelocIterator::locs_and_index_size(csize, lsize);
return (csize_t) align_size_up(total, HeapWordSize);
}
@@ -601,7 +600,7 @@ csize_t CodeBuffer::copy_relocations_to(CodeBlob* dest) const {
buf_offset += sizeof(relocInfo);
}
- assert(code_end_so_far == total_code_size(), "sanity");
+ assert(code_end_so_far == total_content_size(), "sanity");
// Account for index:
if (buf != NULL) {
@@ -621,9 +620,8 @@ void CodeBuffer::copy_code_to(CodeBlob* dest_blob) {
}
#endif //PRODUCT
- CodeBuffer dest(dest_blob->instructions_begin(),
- dest_blob->instructions_size());
- assert(dest_blob->instructions_size() >= total_code_size(), "good sizing");
+ CodeBuffer dest(dest_blob);
+ assert(dest_blob->content_size() >= total_content_size(), "good sizing");
this->compute_final_layout(&dest);
relocate_code_to(&dest);
@@ -631,11 +629,10 @@ void CodeBuffer::copy_code_to(CodeBlob* dest_blob) {
dest_blob->set_comments(_comments);
// Done moving code bytes; were they the right size?
- assert(round_to(dest.total_code_size(), oopSize) == dest_blob->instructions_size(), "sanity");
+ assert(round_to(dest.total_content_size(), oopSize) == dest_blob->content_size(), "sanity");
// Flush generated code
- ICache::invalidate_range(dest_blob->instructions_begin(),
- dest_blob->instructions_size());
+ ICache::invalidate_range(dest_blob->code_begin(), dest_blob->code_size());
}
// Move all my code into another code buffer.
@@ -844,8 +841,8 @@ bool CodeBuffer::verify_section_allocation() {
if (tstart == badAddress) return true; // smashed by set_blob(NULL)
address tend = tstart + _total_size;
if (_blob != NULL) {
- assert(tstart >= _blob->instructions_begin(), "sanity");
- assert(tend <= _blob->instructions_end(), "sanity");
+ assert(tstart >= _blob->content_begin(), "sanity");
+ assert(tend <= _blob->content_end(), "sanity");
}
address tcheck = tstart; // advancing pointer to verify disjointness
for (int n = 0; n < (int)SECT_LIMIT; n++) {
@@ -981,13 +978,13 @@ void CodeComments::free() {
void CodeBuffer::decode() {
- Disassembler::decode(decode_begin(), code_end());
- _decode_begin = code_end();
+ Disassembler::decode(decode_begin(), insts_end());
+ _decode_begin = insts_end();
}
void CodeBuffer::skip_decode() {
- _decode_begin = code_end();
+ _decode_begin = insts_end();
}
diff --git a/src/share/vm/asm/codeBuffer.hpp b/src/share/vm/asm/codeBuffer.hpp
index 8e4a4ea32..6e6897b06 100644
--- a/src/share/vm/asm/codeBuffer.hpp
+++ b/src/share/vm/asm/codeBuffer.hpp
@@ -186,6 +186,12 @@ class CodeSection VALUE_OBJ_CLASS_SPEC {
_locs_point = pc;
}
+ // Code emission
+ void emit_int8 (int8_t x) { *((int8_t*) end()) = x; set_end(end() + 1); }
+ void emit_int16(int16_t x) { *((int16_t*) end()) = x; set_end(end() + 2); }
+ void emit_int32(int32_t x) { *((int32_t*) end()) = x; set_end(end() + 4); }
+ void emit_int64(int64_t x) { *((int64_t*) end()) = x; set_end(end() + 8); }
+
// Share a scratch buffer for relocinfo. (Hacky; saves a resource allocation.)
void initialize_shared_locs(relocInfo* buf, int length);
@@ -374,9 +380,17 @@ class CodeBuffer: public StackObj {
public:
// (1) code buffer referring to pre-allocated instruction memory
- CodeBuffer(address code_start, csize_t code_size);
+ CodeBuffer(address code_start, csize_t code_size) {
+ assert(code_start != NULL, "sanity");
+ initialize_misc("static buffer");
+ initialize(code_start, code_size);
+ assert(verify_section_allocation(), "initial use of buffer OK");
+ }
+
+ // (2) CodeBuffer referring to pre-allocated CodeBlob.
+ CodeBuffer(CodeBlob* blob);
- // (2) code buffer allocating codeBlob memory for code & relocation
+ // (3) code buffer allocating codeBlob memory for code & relocation
// info but with lazy initialization. The name must be something
// informative.
CodeBuffer(const char* name) {
@@ -384,7 +398,7 @@ class CodeBuffer: public StackObj {
}
- // (3) code buffer allocating codeBlob memory for code & relocation
+ // (4) code buffer allocating codeBlob memory for code & relocation
// info. The name must be something informative and code_size must
// include both code and stubs sizes.
CodeBuffer(const char* name, csize_t code_size, csize_t locs_size) {
@@ -394,8 +408,8 @@ class CodeBuffer: public StackObj {
~CodeBuffer();
- // Initialize a CodeBuffer constructed using constructor 2. Using
- // constructor 3 is equivalent to calling constructor 2 and then
+ // Initialize a CodeBuffer constructed using constructor 3. Using
+ // constructor 4 is equivalent to calling constructor 3 and then
// calling this method. It's been factored out for convenience of
// construction.
void initialize(csize_t code_size, csize_t locs_size);
@@ -438,36 +452,37 @@ class CodeBuffer: public StackObj {
void free_blob(); // Free the blob, if we own one.
// Properties relative to the insts section:
- address code_begin() const { return _insts.start(); }
- address code_end() const { return _insts.end(); }
- void set_code_end(address end) { _insts.set_end(end); }
- address code_limit() const { return _insts.limit(); }
- address inst_mark() const { return _insts.mark(); }
- void set_inst_mark() { _insts.set_mark(); }
- void clear_inst_mark() { _insts.clear_mark(); }
+ address insts_begin() const { return _insts.start(); }
+ address insts_end() const { return _insts.end(); }
+ void set_insts_end(address end) { _insts.set_end(end); }
+ address insts_limit() const { return _insts.limit(); }
+ address insts_mark() const { return _insts.mark(); }
+ void set_insts_mark() { _insts.set_mark(); }
+ void clear_insts_mark() { _insts.clear_mark(); }
// is there anything in the buffer other than the current section?
- bool is_pure() const { return code_size() == total_code_size(); }
+ bool is_pure() const { return insts_size() == total_content_size(); }
// size in bytes of output so far in the insts sections
- csize_t code_size() const { return _insts.size(); }
+ csize_t insts_size() const { return _insts.size(); }
- // same as code_size(), except that it asserts there is no non-code here
- csize_t pure_code_size() const { assert(is_pure(), "no non-code");
- return code_size(); }
+ // same as insts_size(), except that it asserts there is no non-code here
+ csize_t pure_insts_size() const { assert(is_pure(), "no non-code");
+ return insts_size(); }
// capacity in bytes of the insts sections
- csize_t code_capacity() const { return _insts.capacity(); }
+ csize_t insts_capacity() const { return _insts.capacity(); }
// number of bytes remaining in the insts section
- csize_t code_remaining() const { return _insts.remaining(); }
+ csize_t insts_remaining() const { return _insts.remaining(); }
// is a given address in the insts section? (2nd version is end-inclusive)
- bool code_contains(address pc) const { return _insts.contains(pc); }
- bool code_contains2(address pc) const { return _insts.contains2(pc); }
+ bool insts_contains(address pc) const { return _insts.contains(pc); }
+ bool insts_contains2(address pc) const { return _insts.contains2(pc); }
- // allocated size of code in all sections, when aligned and concatenated
- // (this is the eventual state of the code in its final CodeBlob)
- csize_t total_code_size() const;
+ // Allocated size in all sections, when aligned and concatenated
+ // (this is the eventual state of the content in its final
+ // CodeBlob).
+ csize_t total_content_size() const;
// combined offset (relative to start of insts) of given address,
// as eventually found in the final CodeBlob
diff --git a/src/share/vm/c1/c1_Compilation.cpp b/src/share/vm/c1/c1_Compilation.cpp
index d9156c1b3..38235a3b3 100644
--- a/src/share/vm/c1/c1_Compilation.cpp
+++ b/src/share/vm/c1/c1_Compilation.cpp
@@ -454,8 +454,7 @@ Compilation::Compilation(AbstractCompiler* compiler, ciEnv* env, ciMethod* metho
, _allocator(NULL)
, _next_id(0)
, _next_block_id(0)
-, _code(buffer_blob->instructions_begin(),
- buffer_blob->instructions_size())
+, _code(buffer_blob)
, _current_instruction(NULL)
#ifndef PRODUCT
, _last_instruction_printed(NULL)
diff --git a/src/share/vm/c1/c1_Runtime1.cpp b/src/share/vm/c1/c1_Runtime1.cpp
index 96d4e7135..5100c5ebb 100644
--- a/src/share/vm/c1/c1_Runtime1.cpp
+++ b/src/share/vm/c1/c1_Runtime1.cpp
@@ -118,8 +118,7 @@ void Runtime1::generate_blob_for(BufferBlob* buffer_blob, StubID id) {
assert(0 <= id && id < number_of_ids, "illegal stub id");
ResourceMark rm;
// create code buffer for code storage
- CodeBuffer code(buffer_blob->instructions_begin(),
- buffer_blob->instructions_size());
+ CodeBuffer code(buffer_blob);
Compilation::setup_code_buffer(&code, 0);
diff --git a/src/share/vm/c1/c1_Runtime1.hpp b/src/share/vm/c1/c1_Runtime1.hpp
index 1f31ebfbf..60bb8550a 100644
--- a/src/share/vm/c1/c1_Runtime1.hpp
+++ b/src/share/vm/c1/c1_Runtime1.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -155,7 +155,7 @@ class Runtime1: public AllStatic {
// stubs
static CodeBlob* blob_for (StubID id);
- static address entry_for(StubID id) { return blob_for(id)->instructions_begin(); }
+ static address entry_for(StubID id) { return blob_for(id)->code_begin(); }
static const char* name_for (StubID id);
static const char* name_for_address(address entry);
diff --git a/src/share/vm/ci/ciMethod.cpp b/src/share/vm/ci/ciMethod.cpp
index 463c3b89d..9135ac6d6 100644
--- a/src/share/vm/ci/ciMethod.cpp
+++ b/src/share/vm/ci/ciMethod.cpp
@@ -922,12 +922,12 @@ bool ciMethod::has_compiled_code() {
// ------------------------------------------------------------------
// ciMethod::instructions_size
-// This is a rough metric for "fat" methods, compared
-// before inlining with InlineSmallCode.
-// The CodeBlob::instructions_size accessor includes
-// junk like exception handler, stubs, and constant table,
-// which are not highly relevant to an inlined method.
-// So we use the more specific accessor nmethod::code_size.
+//
+// This is a rough metric for "fat" methods, compared before inlining
+// with InlineSmallCode. The CodeBlob::code_size accessor includes
+// junk like exception handler, stubs, and constant table, which are
+// not highly relevant to an inlined method. So we use the more
+// specific accessor nmethod::insts_size.
int ciMethod::instructions_size() {
GUARDED_VM_ENTRY(
nmethod* code = get_methodOop()->code();
@@ -939,7 +939,7 @@ int ciMethod::instructions_size() {
(TieredCompilation && code->compiler() != NULL && code->compiler()->is_c1())) {
return 0;
}
- return code->code_end() - code->verified_entry_point();
+ return code->insts_end() - code->verified_entry_point();
)
}
diff --git a/src/share/vm/code/codeBlob.cpp b/src/share/vm/code/codeBlob.cpp
index d5e4525fc..fa98026c9 100644
--- a/src/share/vm/code/codeBlob.cpp
+++ b/src/share/vm/code/codeBlob.cpp
@@ -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());
}
}
diff --git a/src/share/vm/code/codeBlob.hpp b/src/share/vm/code/codeBlob.hpp
index 28cd68aa6..9b08c3dc8 100644
--- a/src/share/vm/code/codeBlob.hpp
+++ b/src/share/vm/code/codeBlob.hpp
@@ -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; }
};
diff --git a/src/share/vm/code/codeCache.cpp b/src/share/vm/code/codeCache.cpp
index 485aff812..b02f142cc 100644
--- a/src/share/vm/code/codeCache.cpp
+++ b/src/share/vm/code/codeCache.cpp
@@ -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();
}
}
}
diff --git a/src/share/vm/code/exceptionHandlerTable.cpp b/src/share/vm/code/exceptionHandlerTable.cpp
index 8ad6592b4..12cc9cdf7 100644
--- a/src/share/vm/code/exceptionHandlerTable.cpp
+++ b/src/share/vm/code/exceptionHandlerTable.cpp
@@ -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));
}
}
diff --git a/src/share/vm/code/nmethod.cpp b/src/share/vm/code/nmethod.cpp
index 1b6472a3c..0526f4355 100644
--- a/src/share/vm/code/nmethod.cpp
+++ b/src/share/vm/code/nmethod.cpp
@@ -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() {
diff --git a/src/share/vm/code/nmethod.hpp b/src/share/vm/code/nmethod.hpp
index 88fe784cf..ff37f96b8 100644
--- a/src/share/vm/code/nmethod.hpp
+++ b/src/share/vm/code/nmethod.hpp
@@ -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);
diff --git a/src/share/vm/code/pcDesc.cpp b/src/share/vm/code/pcDesc.cpp
index 9e063fb16..b8a9eb475 100644
--- a/src/share/vm/code/pcDesc.cpp
+++ b/src/share/vm/code/pcDesc.cpp
@@ -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) {
diff --git a/src/share/vm/code/relocInfo.cpp b/src/share/vm/code/relocInfo.cpp
index 6afb3c54d..7df9e47e0 100644
--- a/src/share/vm/code/relocInfo.cpp
+++ b/src/share/vm/code/relocInfo.cpp
@@ -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
diff --git a/src/share/vm/code/scopeDesc.cpp b/src/share/vm/code/scopeDesc.cpp
index 2e1e19e69..9eb1e888e 100644
--- a/src/share/vm/code/scopeDesc.cpp
+++ b/src/share/vm/code/scopeDesc.cpp
@@ -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");
diff --git a/src/share/vm/code/stubs.cpp b/src/share/vm/code/stubs.cpp
index e8b492731..7272f4673 100644
--- a/src/share/vm/code/stubs.cpp
+++ b/src/share/vm/code/stubs.cpp
@@ -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;
diff --git a/src/share/vm/code/vtableStubs.cpp b/src/share/vm/code/vtableStubs.cpp
index 028cfe838..e85a8732f 100644
--- a/src/share/vm/code/vtableStubs.cpp
+++ b/src/share/vm/code/vtableStubs.cpp
@@ -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
diff --git a/src/share/vm/compiler/compileBroker.cpp b/src/share/vm/compiler/compileBroker.cpp
index 478d3f47b..911ab0675 100644
--- a/src/share/vm/compiler/compileBroker.cpp
+++ b/src/share/vm/compiler/compileBroker.cpp
@@ -399,7 +399,7 @@ void CompileTask::log_task_done(CompileLog* log) {
// <task_done ... stamp='1.234'> </task>
nmethod* nm = code();
log->begin_elem("task_done success='%d' nmsize='%d' count='%d'",
- _is_success, nm == NULL ? 0 : nm->instructions_size(),
+ _is_success, nm == NULL ? 0 : nm->content_size(),
method->invocation_count());
int bec = method->backedge_count();
if (bec != 0) log->print(" backedge_count='%d'", bec);
@@ -1847,13 +1847,13 @@ void CompileBroker::collect_statistics(CompilerThread* thread, elapsedTimer time
}
// Collect counts of successful compilations
- _sum_nmethod_size += code->total_size();
- _sum_nmethod_code_size += code->code_size();
+ _sum_nmethod_size += code->total_size();
+ _sum_nmethod_code_size += code->insts_size();
_total_compile_count++;
if (UsePerfData) {
- _perf_sum_nmethod_size->inc(code->total_size());
- _perf_sum_nmethod_code_size->inc(code->code_size());
+ _perf_sum_nmethod_size->inc( code->total_size());
+ _perf_sum_nmethod_code_size->inc(code->insts_size());
_perf_total_compile_count->inc();
}
diff --git a/src/share/vm/compiler/disassembler.cpp b/src/share/vm/compiler/disassembler.cpp
index 8176a8164..175d874da 100644
--- a/src/share/vm/compiler/disassembler.cpp
+++ b/src/share/vm/compiler/disassembler.cpp
@@ -407,7 +407,7 @@ void Disassembler::decode(CodeBlob* cb, outputStream* st) {
if (!load_library()) return;
decode_env env(cb, st);
env.output()->print_cr("Decoding CodeBlob " INTPTR_FORMAT, cb);
- env.decode_instructions(cb->instructions_begin(), cb->instructions_end());
+ env.decode_instructions(cb->code_begin(), cb->code_end());
}
@@ -424,12 +424,12 @@ void Disassembler::decode(nmethod* nm, outputStream* st) {
env.output()->print_cr("Code:");
#ifdef SHARK
- SharkEntry* entry = (SharkEntry *) nm->instructions_begin();
- unsigned char* p = entry->code_start();
+ SharkEntry* entry = (SharkEntry *) nm->code_begin();
+ unsigned char* p = entry->code_start();
unsigned char* end = entry->code_limit();
#else
- unsigned char* p = nm->instructions_begin();
- unsigned char* end = nm->instructions_end();
+ unsigned char* p = nm->code_begin();
+ unsigned char* end = nm->code_end();
#endif // SHARK
// If there has been profiling, print the buckets.
diff --git a/src/share/vm/interpreter/interpreter.hpp b/src/share/vm/interpreter/interpreter.hpp
index e8da2ce31..606bbdfca 100644
--- a/src/share/vm/interpreter/interpreter.hpp
+++ b/src/share/vm/interpreter/interpreter.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, 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
@@ -117,7 +117,7 @@ class CodeletMark: ResourceMark {
// commit Codelet
- AbstractInterpreter::code()->commit((*_masm)->code()->pure_code_size());
+ AbstractInterpreter::code()->commit((*_masm)->code()->pure_insts_size());
// make sure nobody can use _masm outside a CodeletMark lifespan
*_masm = NULL;
}
diff --git a/src/share/vm/interpreter/interpreterRuntime.cpp b/src/share/vm/interpreter/interpreterRuntime.cpp
index c156bbb37..f0944896a 100644
--- a/src/share/vm/interpreter/interpreterRuntime.cpp
+++ b/src/share/vm/interpreter/interpreterRuntime.cpp
@@ -1124,7 +1124,7 @@ address SignatureHandlerLibrary::set_handler_blob() {
if (handler_blob == NULL) {
return NULL;
}
- address handler = handler_blob->instructions_begin();
+ address handler = handler_blob->code_begin();
_handler_blob = handler_blob;
_handler = handler;
return handler;
@@ -1140,7 +1140,7 @@ void SignatureHandlerLibrary::initialize() {
BufferBlob* bb = BufferBlob::create("Signature Handler Temp Buffer",
SignatureHandlerLibrary::buffer_size);
- _buffer = bb->instructions_begin();
+ _buffer = bb->code_begin();
_fingerprints = new(ResourceObj::C_HEAP)GrowableArray<uint64_t>(32, true);
_handlers = new(ResourceObj::C_HEAP)GrowableArray<address>(32, true);
@@ -1148,16 +1148,16 @@ void SignatureHandlerLibrary::initialize() {
address SignatureHandlerLibrary::set_handler(CodeBuffer* buffer) {
address handler = _handler;
- int code_size = buffer->pure_code_size();
- if (handler + code_size > _handler_blob->instructions_end()) {
+ int insts_size = buffer->pure_insts_size();
+ if (handler + insts_size > _handler_blob->code_end()) {
// get a new handler blob
handler = set_handler_blob();
}
if (handler != NULL) {
- memcpy(handler, buffer->code_begin(), code_size);
+ memcpy(handler, buffer->insts_begin(), insts_size);
pd_set_handler(handler);
- ICache::invalidate_range(handler, code_size);
- _handler = handler + code_size;
+ ICache::invalidate_range(handler, insts_size);
+ _handler = handler + insts_size;
}
return handler;
}
@@ -1196,8 +1196,8 @@ void SignatureHandlerLibrary::add(methodHandle method) {
(method->is_static() ? "static" : "receiver"),
method->name_and_sig_as_C_string(),
fingerprint,
- buffer.code_size());
- Disassembler::decode(handler, handler + buffer.code_size());
+ buffer.insts_size());
+ Disassembler::decode(handler, handler + buffer.insts_size());
#ifndef PRODUCT
tty->print_cr(" --- associated result handler ---");
address rh_begin = Interpreter::result_handler(method()->result_type());
diff --git a/src/share/vm/opto/compile.cpp b/src/share/vm/opto/compile.cpp
index e5d3c4fdd..b1f6bf56a 100644
--- a/src/share/vm/opto/compile.cpp
+++ b/src/share/vm/opto/compile.cpp
@@ -400,7 +400,7 @@ void Compile::init_scratch_buffer_blob() {
}
// Initialize the relocation buffers
- relocInfo* locs_buf = (relocInfo*) blob->instructions_end() - MAX_locs_size;
+ relocInfo* locs_buf = (relocInfo*) blob->content_end() - MAX_locs_size;
set_scratch_locs_memory(locs_buf);
}
@@ -422,9 +422,9 @@ uint Compile::scratch_emit_size(const Node* n) {
assert(blob != NULL, "Initialize BufferBlob at start");
assert(blob->size() > MAX_inst_size, "sanity");
relocInfo* locs_buf = scratch_locs_memory();
- address blob_begin = blob->instructions_begin();
+ address blob_begin = blob->content_begin();
address blob_end = (address)locs_buf;
- assert(blob->instructions_contains(blob_end), "sanity");
+ assert(blob->content_contains(blob_end), "sanity");
CodeBuffer buf(blob_begin, blob_end - blob_begin);
buf.initialize_consts_size(MAX_const_size);
buf.initialize_stubs_size(MAX_stubs_size);
@@ -433,7 +433,7 @@ uint Compile::scratch_emit_size(const Node* n) {
buf.insts()->initialize_shared_locs(&locs_buf[0], lsize);
buf.stubs()->initialize_shared_locs(&locs_buf[lsize], lsize);
n->emit(buf, this->regalloc());
- return buf.code_size();
+ return buf.insts_size();
}
diff --git a/src/share/vm/opto/graphKit.cpp b/src/share/vm/opto/graphKit.cpp
index 938a6a15b..d34f82997 100644
--- a/src/share/vm/opto/graphKit.cpp
+++ b/src/share/vm/opto/graphKit.cpp
@@ -1891,7 +1891,7 @@ void GraphKit::uncommon_trap(int trap_request,
kill_dead_locals();
// Now insert the uncommon trap subroutine call
- address call_addr = SharedRuntime::uncommon_trap_blob()->instructions_begin();
+ address call_addr = SharedRuntime::uncommon_trap_blob()->entry_point();
const TypePtr* no_memory_effects = NULL;
// Pass the index of the class to be loaded
Node* call = make_runtime_call(RC_NO_LEAF | RC_UNCOMMON |
diff --git a/src/share/vm/opto/lcm.cpp b/src/share/vm/opto/lcm.cpp
index 2e43346c7..c93b53eb9 100644
--- a/src/share/vm/opto/lcm.cpp
+++ b/src/share/vm/opto/lcm.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2009, 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
@@ -72,8 +72,7 @@ void Block::implicit_null_check(PhaseCFG *cfg, Node *proj, Node *val, int allowe
for (uint i1 = 0; i1 < null_block->_nodes.size(); i1++) {
Node* nn = null_block->_nodes[i1];
if (nn->is_MachCall() &&
- nn->as_MachCall()->entry_point() ==
- SharedRuntime::uncommon_trap_blob()->instructions_begin()) {
+ nn->as_MachCall()->entry_point() == SharedRuntime::uncommon_trap_blob()->entry_point()) {
const Type* trtype = nn->in(TypeFunc::Parms)->bottom_type();
if (trtype->isa_int() && trtype->is_int()->is_con()) {
jint tr_con = trtype->is_int()->get_con();
diff --git a/src/share/vm/opto/library_call.cpp b/src/share/vm/opto/library_call.cpp
index f09a1c48f..f48ed6f31 100644
--- a/src/share/vm/opto/library_call.cpp
+++ b/src/share/vm/opto/library_call.cpp
@@ -4962,8 +4962,7 @@ LibraryCallKit::tightly_coupled_allocation(Node* ptr,
for (DUIterator_Fast jmax, j = not_ctl->fast_outs(jmax); j < jmax; j++) {
Node* obs = not_ctl->fast_out(j);
if (obs->in(0) == not_ctl && obs->is_Call() &&
- (obs->as_Call()->entry_point() ==
- SharedRuntime::uncommon_trap_blob()->instructions_begin())) {
+ (obs->as_Call()->entry_point() == SharedRuntime::uncommon_trap_blob()->entry_point())) {
found_trap = true; break;
}
}
diff --git a/src/share/vm/opto/output.cpp b/src/share/vm/opto/output.cpp
index 010743959..959f4c8c8 100644
--- a/src/share/vm/opto/output.cpp
+++ b/src/share/vm/opto/output.cpp
@@ -1184,7 +1184,7 @@ void Compile::Fill_buffer() {
MacroAssembler(cb).bind( blk_labels[b->_pre_order] );
else
- assert( blk_labels[b->_pre_order].loc_pos() == cb->code_size(),
+ assert( blk_labels[b->_pre_order].loc_pos() == cb->insts_size(),
"label position does not match code offset" );
uint last_inst = b->_nodes.size();
@@ -1225,7 +1225,7 @@ void Compile::Fill_buffer() {
// If this requires all previous instructions be flushed, then do so
if( is_sfn || is_mcall || mach->alignment_required() != 1) {
cb->flush_bundle(true);
- current_offset = cb->code_size();
+ current_offset = cb->insts_size();
}
// align the instruction if necessary
@@ -1246,7 +1246,7 @@ void Compile::Fill_buffer() {
_cfg->_bbs.map( nop->_idx, b );
nop->emit(*cb, _regalloc);
cb->flush_bundle(true);
- current_offset = cb->code_size();
+ current_offset = cb->insts_size();
}
// Remember the start of the last call in a basic block
@@ -1348,12 +1348,12 @@ void Compile::Fill_buffer() {
// Save the offset for the listing
#ifndef PRODUCT
if( node_offsets && n->_idx < node_offset_limit )
- node_offsets[n->_idx] = cb->code_size();
+ node_offsets[n->_idx] = cb->insts_size();
#endif
// "Normal" instruction case
n->emit(*cb, _regalloc);
- current_offset = cb->code_size();
+ current_offset = cb->insts_size();
non_safepoints.observe_instruction(n, current_offset);
// mcall is last "call" that can be a safepoint
@@ -1372,13 +1372,12 @@ void Compile::Fill_buffer() {
assert(delay_slot != NULL, "expecting delay slot node");
// Back up 1 instruction
- cb->set_code_end(
- cb->code_end()-Pipeline::instr_unit_size());
+ cb->set_insts_end(cb->insts_end() - Pipeline::instr_unit_size());
// Save the offset for the listing
#ifndef PRODUCT
if( node_offsets && delay_slot->_idx < node_offset_limit )
- node_offsets[delay_slot->_idx] = cb->code_size();
+ node_offsets[delay_slot->_idx] = cb->insts_size();
#endif
// Support a SafePoint in the delay slot
@@ -1420,7 +1419,7 @@ void Compile::Fill_buffer() {
b->_nodes.insert( b->_nodes.size(), nop );
_cfg->_bbs.map( nop->_idx, b );
nop->emit(*cb, _regalloc);
- current_offset = cb->code_size();
+ current_offset = cb->insts_size();
}
}
@@ -1437,13 +1436,13 @@ void Compile::Fill_buffer() {
// Compute the size of the first block
_first_block_size = blk_labels[1].loc_pos() - blk_labels[0].loc_pos();
- assert(cb->code_size() < 500000, "method is unreasonably large");
+ assert(cb->insts_size() < 500000, "method is unreasonably large");
// ------------------
#ifndef PRODUCT
// Information on the size of the method, without the extraneous code
- Scheduling::increment_method_size(cb->code_size());
+ Scheduling::increment_method_size(cb->insts_size());
#endif
// ------------------
diff --git a/src/share/vm/opto/stringopts.cpp b/src/share/vm/opto/stringopts.cpp
index 0f80acec8..2584652a0 100644
--- a/src/share/vm/opto/stringopts.cpp
+++ b/src/share/vm/opto/stringopts.cpp
@@ -157,7 +157,7 @@ class StringConcat : public ResourceObj {
Node* uct = _uncommon_traps.at(u);
// Build a new call using the jvms state of the allocate
- address call_addr = SharedRuntime::uncommon_trap_blob()->instructions_begin();
+ address call_addr = SharedRuntime::uncommon_trap_blob()->entry_point();
const TypeFunc* call_type = OptoRuntime::uncommon_trap_Type();
int size = call_type->domain()->cnt();
const TypePtr* no_memory_effects = NULL;
diff --git a/src/share/vm/prims/jvmtiCodeBlobEvents.cpp b/src/share/vm/prims/jvmtiCodeBlobEvents.cpp
index 0547de267..f742a99e9 100644
--- a/src/share/vm/prims/jvmtiCodeBlobEvents.cpp
+++ b/src/share/vm/prims/jvmtiCodeBlobEvents.cpp
@@ -114,7 +114,7 @@ void CodeBlobCollector::do_blob(CodeBlob* cb) {
// check if this starting address has been seen already - the
// assumption is that stubs are inserted into the list before the
// enclosing BufferBlobs.
- address addr = cb->instructions_begin();
+ address addr = cb->code_begin();
for (int i=0; i<_global_code_blobs->length(); i++) {
JvmtiCodeBlobDesc* scb = _global_code_blobs->at(i);
if (addr == scb->code_begin()) {
@@ -123,8 +123,7 @@ void CodeBlobCollector::do_blob(CodeBlob* cb) {
}
// record the CodeBlob details as a JvmtiCodeBlobDesc
- JvmtiCodeBlobDesc* scb = new JvmtiCodeBlobDesc(cb->name(), cb->instructions_begin(),
- cb->instructions_end());
+ JvmtiCodeBlobDesc* scb = new JvmtiCodeBlobDesc(cb->name(), cb->code_begin(), cb->code_end());
_global_code_blobs->append(scb);
}
diff --git a/src/share/vm/prims/jvmtiExport.cpp b/src/share/vm/prims/jvmtiExport.cpp
index a4c2828da..d07f5902b 100644
--- a/src/share/vm/prims/jvmtiExport.cpp
+++ b/src/share/vm/prims/jvmtiExport.cpp
@@ -687,8 +687,8 @@ class JvmtiCompiledMethodLoadEventMark : public JvmtiMethodEventMark {
public:
JvmtiCompiledMethodLoadEventMark(JavaThread *thread, nmethod *nm, void* compile_info_ptr = NULL)
: JvmtiMethodEventMark(thread,methodHandle(thread, nm->method())) {
- _code_data = nm->code_begin();
- _code_size = nm->code_size();
+ _code_data = nm->insts_begin();
+ _code_size = nm->insts_size();
_compile_info = compile_info_ptr; // Set void pointer of compiledMethodLoad Event. Default value is NULL.
JvmtiCodeBlobEvents::build_jvmti_addr_location_map(nm, &_map, &_map_length);
}
diff --git a/src/share/vm/prims/methodHandles.cpp b/src/share/vm/prims/methodHandles.cpp
index 7b3acfda1..650b3d309 100644
--- a/src/share/vm/prims/methodHandles.cpp
+++ b/src/share/vm/prims/methodHandles.cpp
@@ -113,8 +113,7 @@ void MethodHandles::generate_adapters() {
_adapter_code = MethodHandlesAdapterBlob::create(_adapter_code_size);
if (_adapter_code == NULL)
vm_exit_out_of_memory(_adapter_code_size, "CodeCache: no room for MethodHandles adapters");
- CodeBuffer code(_adapter_code->instructions_begin(), _adapter_code->instructions_size());
-
+ CodeBuffer code(_adapter_code);
MethodHandlesAdapterGenerator g(&code);
g.generate();
}
diff --git a/src/share/vm/runtime/compilationPolicy.cpp b/src/share/vm/runtime/compilationPolicy.cpp
index 96b02db43..eba75a067 100644
--- a/src/share/vm/runtime/compilationPolicy.cpp
+++ b/src/share/vm/runtime/compilationPolicy.cpp
@@ -439,7 +439,7 @@ const char* StackWalkCompPolicy::shouldNotInline(methodHandle m) {
if (!instanceKlass::cast(m->method_holder())->is_initialized()) return (_msg = "method holder not initialized");
if (m->is_native()) return (_msg = "native method");
nmethod* m_code = m->code();
- if( m_code != NULL && m_code->instructions_size() > InlineSmallCode )
+ if (m_code != NULL && m_code->code_size() > InlineSmallCode)
return (_msg = "already compiled into a big method");
// use frequency-based objections only for non-trivial methods
diff --git a/src/share/vm/runtime/frame.cpp b/src/share/vm/runtime/frame.cpp
index 69d287984..bf24d6eb8 100644
--- a/src/share/vm/runtime/frame.cpp
+++ b/src/share/vm/runtime/frame.cpp
@@ -537,8 +537,8 @@ void frame::print_value_on(outputStream* st, JavaThread *thread) const {
st->cr();
#ifndef PRODUCT
if (end == NULL) {
- begin = _cb->instructions_begin();
- end = _cb->instructions_end();
+ begin = _cb->code_begin();
+ end = _cb->code_end();
}
#endif
}
diff --git a/src/share/vm/runtime/icache.cpp b/src/share/vm/runtime/icache.cpp
index 5774f0d28..78a3bcd78 100644
--- a/src/share/vm/runtime/icache.cpp
+++ b/src/share/vm/runtime/icache.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, 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
@@ -33,7 +33,7 @@ void AbstractICache::initialize() {
ResourceMark rm;
BufferBlob* b = BufferBlob::create("flush_icache_stub", ICache::stub_size);
- CodeBuffer c(b->instructions_begin(), b->instructions_size());
+ CodeBuffer c(b);
ICacheStubGenerator g(&c);
g.generate_icache_flush(&_flush_icache_stub);
diff --git a/src/share/vm/runtime/rframe.cpp b/src/share/vm/runtime/rframe.cpp
index e9125796d..ca7501ab4 100644
--- a/src/share/vm/runtime/rframe.cpp
+++ b/src/share/vm/runtime/rframe.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2007, 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
@@ -120,7 +120,7 @@ int InterpretedRFrame::cost() const {
int CompiledRFrame::cost() const {
nmethod* nm = top_method()->code();
if (nm != NULL) {
- return nm->code_size();
+ return nm->insts_size();
} else {
return top_method()->code_size();
}
diff --git a/src/share/vm/runtime/sharedRuntime.cpp b/src/share/vm/runtime/sharedRuntime.cpp
index 5e9325399..426b359cd 100644
--- a/src/share/vm/runtime/sharedRuntime.cpp
+++ b/src/share/vm/runtime/sharedRuntime.cpp
@@ -455,11 +455,11 @@ address SharedRuntime::get_poll_stub(address pc) {
if (at_poll_return) {
assert(SharedRuntime::polling_page_return_handler_blob() != NULL,
"polling page return stub not created yet");
- stub = SharedRuntime::polling_page_return_handler_blob()->instructions_begin();
+ stub = SharedRuntime::polling_page_return_handler_blob()->entry_point();
} else {
assert(SharedRuntime::polling_page_safepoint_handler_blob() != NULL,
"polling page safepoint stub not created yet");
- stub = SharedRuntime::polling_page_safepoint_handler_blob()->instructions_begin();
+ stub = SharedRuntime::polling_page_safepoint_handler_blob()->entry_point();
}
#ifndef PRODUCT
if( TraceSafepoint ) {
@@ -574,7 +574,7 @@ address SharedRuntime::compute_compiled_exc_handler(nmethod* nm, address ret_pc,
}
// found handling method => lookup exception handler
- int catch_pco = ret_pc - nm->instructions_begin();
+ int catch_pco = ret_pc - nm->code_begin();
ExceptionHandlerTable table(nm);
HandlerTableEntry *t = table.entry_for(catch_pco, handler_bci, scope_depth);
@@ -607,7 +607,7 @@ address SharedRuntime::compute_compiled_exc_handler(nmethod* nm, address ret_pc,
return NULL;
}
- return nm->instructions_begin() + t->pco();
+ return nm->code_begin() + t->pco();
}
JRT_ENTRY(void, SharedRuntime::throw_AbstractMethodError(JavaThread* thread))
@@ -2252,7 +2252,7 @@ AdapterHandlerEntry* AdapterHandlerLibrary::get_adapter(methodHandle method) {
ResourceMark rm;
- NOT_PRODUCT(int code_size);
+ NOT_PRODUCT(int insts_size);
AdapterBlob* B = NULL;
AdapterHandlerEntry* entry = NULL;
AdapterFingerPrint* fingerprint = NULL;
@@ -2305,7 +2305,7 @@ AdapterHandlerEntry* AdapterHandlerLibrary::get_adapter(methodHandle method) {
BufferBlob* buf = buffer_blob(); // the temporary code buffer in CodeCache
if (buf != NULL) {
- CodeBuffer buffer(buf->instructions_begin(), buf->instructions_size());
+ CodeBuffer buffer(buf);
short buffer_locs[20];
buffer.insts()->initialize_shared_locs((relocInfo*)buffer_locs,
sizeof(buffer_locs)/sizeof(relocInfo));
@@ -2321,19 +2321,19 @@ AdapterHandlerEntry* AdapterHandlerLibrary::get_adapter(methodHandle method) {
#ifdef ASSERT
if (VerifyAdapterSharing) {
if (shared_entry != NULL) {
- assert(shared_entry->compare_code(buf->instructions_begin(), buffer.code_size(), total_args_passed, sig_bt),
+ assert(shared_entry->compare_code(buf->code_begin(), buffer.insts_size(), total_args_passed, sig_bt),
"code must match");
// Release the one just created and return the original
_adapters->free_entry(entry);
return shared_entry;
} else {
- entry->save_code(buf->instructions_begin(), buffer.code_size(), total_args_passed, sig_bt);
+ entry->save_code(buf->code_begin(), buffer.insts_size(), total_args_passed, sig_bt);
}
}
#endif
B = AdapterBlob::create(&buffer);
- NOT_PRODUCT(code_size = buffer.code_size());
+ NOT_PRODUCT(insts_size = buffer.insts_size());
}
if (B == NULL) {
// CodeCache is full, disable compilation
@@ -2343,16 +2343,16 @@ AdapterHandlerEntry* AdapterHandlerLibrary::get_adapter(methodHandle method) {
CompileBroker::handle_full_code_cache();
return NULL; // Out of CodeCache space
}
- entry->relocate(B->instructions_begin());
+ entry->relocate(B->content_begin());
#ifndef PRODUCT
// debugging suppport
if (PrintAdapterHandlers) {
tty->cr();
tty->print_cr("i2c argument handler #%d for: %s %s (fingerprint = %s, %d bytes generated)",
_adapters->number_of_entries(), (method->is_static() ? "static" : "receiver"),
- method->signature()->as_C_string(), fingerprint->as_string(), code_size );
+ method->signature()->as_C_string(), fingerprint->as_string(), insts_size );
tty->print_cr("c2i argument handler starts at %p",entry->get_c2i_entry());
- Disassembler::decode(entry->get_i2c_entry(), entry->get_i2c_entry() + code_size);
+ Disassembler::decode(entry->get_i2c_entry(), entry->get_i2c_entry() + insts_size);
}
#endif
@@ -2366,13 +2366,11 @@ AdapterHandlerEntry* AdapterHandlerLibrary::get_adapter(methodHandle method) {
"%s(%s)@" PTR_FORMAT,
B->name(),
fingerprint->as_string(),
- B->instructions_begin());
- Forte::register_stub(blob_id, B->instructions_begin(), B->instructions_end());
+ B->content_begin());
+ Forte::register_stub(blob_id, B->content_begin(), B->content_end());
if (JvmtiExport::should_post_dynamic_code_generated()) {
- JvmtiExport::post_dynamic_code_generated(blob_id,
- B->instructions_begin(),
- B->instructions_end());
+ JvmtiExport::post_dynamic_code_generated(blob_id, B->content_begin(), B->content_end());
}
}
return entry;
@@ -2456,7 +2454,7 @@ nmethod *AdapterHandlerLibrary::create_native_wrapper(methodHandle method) {
BufferBlob* buf = buffer_blob(); // the temporary code buffer in CodeCache
if (buf != NULL) {
- CodeBuffer buffer(buf->instructions_begin(), buf->instructions_size());
+ CodeBuffer buffer(buf);
double locs_buf[20];
buffer.insts()->initialize_shared_locs((relocInfo*)locs_buf, sizeof(locs_buf) / sizeof(relocInfo));
MacroAssembler _masm(&buffer);
@@ -2540,7 +2538,7 @@ nmethod *AdapterHandlerLibrary::create_dtrace_nmethod(methodHandle method) {
BufferBlob* buf = buffer_blob(); // the temporary code buffer in CodeCache
if (buf != NULL) {
- CodeBuffer buffer(buf->instructions_begin(), buf->instructions_size());
+ CodeBuffer buffer(buf);
// Need a few relocation entries
double locs_buf[20];
buffer.insts()->initialize_shared_locs(
diff --git a/src/share/vm/runtime/sharedRuntime.hpp b/src/share/vm/runtime/sharedRuntime.hpp
index bd5031e49..4f6d103f8 100644
--- a/src/share/vm/runtime/sharedRuntime.hpp
+++ b/src/share/vm/runtime/sharedRuntime.hpp
@@ -173,12 +173,12 @@ class SharedRuntime: AllStatic {
static address get_ic_miss_stub() {
assert(_ic_miss_blob!= NULL, "oops");
- return _ic_miss_blob->instructions_begin();
+ return _ic_miss_blob->entry_point();
}
static address get_handle_wrong_method_stub() {
assert(_wrong_method_blob!= NULL, "oops");
- return _wrong_method_blob->instructions_begin();
+ return _wrong_method_blob->entry_point();
}
#ifdef COMPILER2
@@ -188,15 +188,15 @@ class SharedRuntime: AllStatic {
static address get_resolve_opt_virtual_call_stub(){
assert(_resolve_opt_virtual_call_blob != NULL, "oops");
- return _resolve_opt_virtual_call_blob->instructions_begin();
+ return _resolve_opt_virtual_call_blob->entry_point();
}
static address get_resolve_virtual_call_stub() {
assert(_resolve_virtual_call_blob != NULL, "oops");
- return _resolve_virtual_call_blob->instructions_begin();
+ return _resolve_virtual_call_blob->entry_point();
}
static address get_resolve_static_call_stub() {
assert(_resolve_static_call_blob != NULL, "oops");
- return _resolve_static_call_blob->instructions_begin();
+ return _resolve_static_call_blob->entry_point();
}
static SafepointBlob* polling_page_return_handler_blob() { return _polling_page_return_handler_blob; }
@@ -548,16 +548,17 @@ class SharedRuntime: AllStatic {
// This library manages argument marshaling adapters and native wrappers.
// There are 2 flavors of adapters: I2C and C2I.
//
-// The I2C flavor takes a stock interpreted call setup, marshals the arguments
-// for a Java-compiled call, and jumps to Rmethod-> code()->
-// instructions_begin(). It is broken to call it without an nmethod assigned.
-// The usual behavior is to lift any register arguments up out of the stack
-// and possibly re-pack the extra arguments to be contigious. I2C adapters
-// will save what the interpreter's stack pointer will be after arguments are
-// popped, then adjust the interpreter's frame size to force alignment and
-// possibly to repack the arguments. After re-packing, it jumps to the
-// compiled code start. There are no safepoints in this adapter code and a GC
-// cannot happen while marshaling is in progress.
+// The I2C flavor takes a stock interpreted call setup, marshals the
+// arguments for a Java-compiled call, and jumps to Rmethod-> code()->
+// code_begin(). It is broken to call it without an nmethod assigned.
+// The usual behavior is to lift any register arguments up out of the
+// stack and possibly re-pack the extra arguments to be contigious.
+// I2C adapters will save what the interpreter's stack pointer will be
+// after arguments are popped, then adjust the interpreter's frame
+// size to force alignment and possibly to repack the arguments.
+// After re-packing, it jumps to the compiled code start. There are
+// no safepoints in this adapter code and a GC cannot happen while
+// marshaling is in progress.
//
// The C2I flavor takes a stock compiled call setup plus the target method in
// Rmethod, marshals the arguments for an interpreted call and jumps to
diff --git a/src/share/vm/runtime/stubRoutines.cpp b/src/share/vm/runtime/stubRoutines.cpp
index 0b39eb700..66bd61125 100644
--- a/src/share/vm/runtime/stubRoutines.cpp
+++ b/src/share/vm/runtime/stubRoutines.cpp
@@ -119,10 +119,9 @@ void StubRoutines::initialize1() {
TraceTime timer("StubRoutines generation 1", TraceStartupTime);
_code1 = BufferBlob::create("StubRoutines (1)", code_size1);
if (_code1 == NULL) {
- vm_exit_out_of_memory(code_size1,
- "CodeCache: no room for StubRoutines (1)");
+ vm_exit_out_of_memory(code_size1, "CodeCache: no room for StubRoutines (1)");
}
- CodeBuffer buffer(_code1->instructions_begin(), _code1->instructions_size());
+ CodeBuffer buffer(_code1);
StubGenerator_generate(&buffer, false);
}
}
@@ -172,10 +171,9 @@ void StubRoutines::initialize2() {
TraceTime timer("StubRoutines generation 2", TraceStartupTime);
_code2 = BufferBlob::create("StubRoutines (2)", code_size2);
if (_code2 == NULL) {
- vm_exit_out_of_memory(code_size2,
- "CodeCache: no room for StubRoutines (2)");
+ vm_exit_out_of_memory(code_size2, "CodeCache: no room for StubRoutines (2)");
}
- CodeBuffer buffer(_code2->instructions_begin(), _code2->instructions_size());
+ CodeBuffer buffer(_code2);
StubGenerator_generate(&buffer, true);
}
diff --git a/src/share/vm/runtime/vmStructs.cpp b/src/share/vm/runtime/vmStructs.cpp
index 78f676e9c..4857811ae 100644
--- a/src/share/vm/runtime/vmStructs.cpp
+++ b/src/share/vm/runtime/vmStructs.cpp
@@ -604,7 +604,8 @@ static inline uint64_t cast_uint64_t(size_t x)
nonstatic_field(CodeBlob, _size, int) \
nonstatic_field(CodeBlob, _header_size, int) \
nonstatic_field(CodeBlob, _relocation_size, int) \
- nonstatic_field(CodeBlob, _instructions_offset, int) \
+ nonstatic_field(CodeBlob, _content_offset, int) \
+ nonstatic_field(CodeBlob, _code_offset, int) \
nonstatic_field(CodeBlob, _frame_complete_offset, int) \
nonstatic_field(CodeBlob, _data_offset, int) \
nonstatic_field(CodeBlob, _frame_size, int) \