src/share/vm/code/nmethod.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
8015774 Cdiff src/share/vm/code/nmethod.cpp
src/share/vm/code/nmethod.cpp
Print this page
*** 484,494 ****
MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
int native_nmethod_size = allocation_size(code_buffer, sizeof(nmethod));
CodeOffsets offsets;
offsets.set_value(CodeOffsets::Verified_Entry, vep_offset);
offsets.set_value(CodeOffsets::Frame_Complete, frame_complete);
! nm = new (native_nmethod_size) nmethod(method(), native_nmethod_size,
compile_id, &offsets,
code_buffer, frame_size,
basic_lock_owner_sp_offset,
basic_lock_sp_offset, oop_maps);
NOT_PRODUCT(if (nm != NULL) nmethod_stats.note_native_nmethod(nm));
--- 484,494 ----
MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
int native_nmethod_size = allocation_size(code_buffer, sizeof(nmethod));
CodeOffsets offsets;
offsets.set_value(CodeOffsets::Verified_Entry, vep_offset);
offsets.set_value(CodeOffsets::Frame_Complete, frame_complete);
! nm = new (native_nmethod_size, CompLevel_none) nmethod(method(), native_nmethod_size,
compile_id, &offsets,
code_buffer, frame_size,
basic_lock_owner_sp_offset,
basic_lock_sp_offset, oop_maps);
NOT_PRODUCT(if (nm != NULL) nmethod_stats.note_native_nmethod(nm));
*** 522,532 ****
CodeOffsets offsets;
offsets.set_value(CodeOffsets::Verified_Entry, vep_offset);
offsets.set_value(CodeOffsets::Dtrace_trap, trap_offset);
offsets.set_value(CodeOffsets::Frame_Complete, frame_complete);
! nm = new (nmethod_size) nmethod(method(), nmethod_size,
&offsets, code_buffer, frame_size);
NOT_PRODUCT(if (nm != NULL) nmethod_stats.note_nmethod(nm));
if (PrintAssembly && nm != NULL) {
Disassembler::decode(nm);
--- 522,532 ----
CodeOffsets offsets;
offsets.set_value(CodeOffsets::Verified_Entry, vep_offset);
offsets.set_value(CodeOffsets::Dtrace_trap, trap_offset);
offsets.set_value(CodeOffsets::Frame_Complete, frame_complete);
! nm = new (nmethod_size, CompLevel_none) nmethod(method(), nmethod_size,
&offsets, code_buffer, frame_size);
NOT_PRODUCT(if (nm != NULL) nmethod_stats.note_nmethod(nm));
if (PrintAssembly && nm != NULL) {
Disassembler::decode(nm);
*** 570,580 ****
+ round_to(dependencies->size_in_bytes() , oopSize)
+ round_to(handler_table->size_in_bytes(), oopSize)
+ round_to(nul_chk_table->size_in_bytes(), oopSize)
+ round_to(debug_info->data_size() , oopSize);
! nm = new (nmethod_size)
nmethod(method(), nmethod_size, compile_id, entry_bci, offsets,
orig_pc_offset, debug_info, dependencies, code_buffer, frame_size,
oop_maps,
handler_table,
nul_chk_table,
--- 570,580 ----
+ round_to(dependencies->size_in_bytes() , oopSize)
+ round_to(handler_table->size_in_bytes(), oopSize)
+ round_to(nul_chk_table->size_in_bytes(), oopSize)
+ round_to(debug_info->data_size() , oopSize);
! nm = new (nmethod_size, comp_level)
nmethod(method(), nmethod_size, compile_id, entry_bci, offsets,
orig_pc_offset, debug_info, dependencies, code_buffer, frame_size,
oop_maps,
handler_table,
nul_chk_table,
*** 779,791 ****
}
}
}
#endif // def HAVE_DTRACE_H
! void* nmethod::operator new(size_t size, int nmethod_size) throw() {
! // Not critical, may return null if there is too little continuous memory
! return CodeCache::allocate(nmethod_size);
}
nmethod::nmethod(
Method* method,
int nmethod_size,
--- 779,792 ----
}
}
}
#endif // def HAVE_DTRACE_H
! void* nmethod::operator new(size_t size, int nmethod_size, int comp_level) throw () {
! // Nmethods are allocated on separate heaps and therefore do not share memory with critical CodeBlobs.
! // We nevertheless define the allocation as critical to make sure all heap memory is used.
! return CodeCache::allocate(nmethod_size, CodeCache::get_code_blob_type(comp_level), true);
}
nmethod::nmethod(
Method* method,
int nmethod_size,
*** 1414,1424 ****
// completely deallocate this method
Events::log(JavaThread::current(), "flushing nmethod " INTPTR_FORMAT, this);
if (PrintMethodFlushing) {
tty->print_cr("*flushing nmethod %3d/" INTPTR_FORMAT ". Live blobs:" UINT32_FORMAT "/Free CodeCache:" SIZE_FORMAT "Kb",
! _compile_id, this, CodeCache::nof_blobs(), CodeCache::unallocated_capacity()/1024);
}
// We need to deallocate any ExceptionCache data.
// Note that we do not need to grab the nmethod lock for this, it
// better be thread safe if we're disposing of it!
--- 1415,1425 ----
// completely deallocate this method
Events::log(JavaThread::current(), "flushing nmethod " INTPTR_FORMAT, this);
if (PrintMethodFlushing) {
tty->print_cr("*flushing nmethod %3d/" INTPTR_FORMAT ". Live blobs:" UINT32_FORMAT "/Free CodeCache:" SIZE_FORMAT "Kb",
! _compile_id, this, CodeCache::nof_blobs(), CodeCache::unallocated_capacity(CodeCache::get_code_blob_type(_comp_level))/1024);
}
// We need to deallocate any ExceptionCache data.
// Note that we do not need to grab the nmethod lock for this, it
// better be thread safe if we're disposing of it!
*** 1438,1451 ****
((SharkCompiler *) compiler())->free_compiled_method(insts_begin());
#endif // SHARK
((CodeBlob*)(this))->flush();
! CodeCache::free(this);
}
-
//
// Notify all classes this nmethod is dependent on that it is no
// longer dependent. This should only be called in two situations.
// First, when a nmethod transitions to a zombie all dependents need
// to be clear. Since zombification happens at a safepoint there's no
--- 1439,1451 ----
((SharkCompiler *) compiler())->free_compiled_method(insts_begin());
#endif // SHARK
((CodeBlob*)(this))->flush();
! CodeCache::free(this, CodeCache::get_code_blob_type(_comp_level));
}
//
// Notify all classes this nmethod is dependent on that it is no
// longer dependent. This should only be called in two situations.
// First, when a nmethod transitions to a zombie all dependents need
// to be clear. Since zombification happens at a safepoint there's no
*** 2143,2153 ****
DepTable* table = new DepTable();
// Iterate over live nmethods and check dependencies of all nmethods that are not
// marked for deoptimization. A particular dependency is only checked once.
! for(nmethod* nm = CodeCache::alive_nmethod(CodeCache::first()); nm != NULL; nm = CodeCache::alive_nmethod(CodeCache::next(nm))) {
if (!nm->is_marked_for_deoptimization()) {
for (Dependencies::DepStream deps(nm); deps.next(); ) {
// Construct abstraction of a dependency.
DependencySignature* current_sig = new DependencySignature(deps);
--- 2143,2156 ----
DepTable* table = new DepTable();
// Iterate over live nmethods and check dependencies of all nmethods that are not
// marked for deoptimization. A particular dependency is only checked once.
! for (int code_blob_type = CodeBlobType::MethodNonProfiled; code_blob_type <= CodeBlobType::MethodProfiled; ++code_blob_type) {
! // Only notify for live nmethods
! nmethod* nm = (nmethod*) CodeCache::first_alive_blob(code_blob_type);
! while (nm != NULL) {
if (!nm->is_marked_for_deoptimization()) {
for (Dependencies::DepStream deps(nm); deps.next(); ) {
// Construct abstraction of a dependency.
DependencySignature* current_sig = new DependencySignature(deps);
*** 2164,2173 ****
--- 2167,2178 ----
assert(false, "Should have been marked for deoptimization");
}
}
}
}
+ nm = (nmethod*) CodeCache::next_alive_blob(nm, code_blob_type);
+ }
}
}
bool nmethod::check_dependency_on(DepChange& changes) {
// What has happened:
*** 2357,2367 ****
// assert(method()->is_oop(), "must be valid");
ResourceMark rm;
! if (!CodeCache::contains(this)) {
fatal(err_msg("nmethod at " INTPTR_FORMAT " not in zone", this));
}
if(is_native_method() )
return;
--- 2362,2372 ----
// assert(method()->is_oop(), "must be valid");
ResourceMark rm;
! if (!CodeCache::contains_nmethod(this)) {
fatal(err_msg("nmethod at " INTPTR_FORMAT " not in zone", this));
}
if(is_native_method() )
return;
src/share/vm/code/nmethod.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File