src/share/vm/code/codeBlob.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File
*** old/src/share/vm/code/codeBlob.cpp	Mon May 17 05:57:02 2010
--- new/src/share/vm/code/codeBlob.cpp	Mon May 17 05:57:01 2010

*** 64,75 **** --- 64,73 ---- _frame_complete_offset = frame_complete; _header_size = header_size; _relocation_size = locs_size; _instructions_offset = align_code_offset(header_size + locs_size); _data_offset = size; _oops_offset = size; _oops_length = 0; _frame_size = 0; set_oop_maps(NULL); }
*** 92,104 **** --- 90,99 ---- _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); _oops_offset = _size - round_to(cb->total_oop_size(), oopSize); _oops_length = 0; // temporary, until the copy_oops handshake assert(_oops_offset >= _data_offset, "codeBlob is too small"); assert(_data_offset <= size, "codeBlob is too small"); cb->copy_code_and_locs_to(this); set_oop_maps(oop_maps); _frame_size = frame_size;
*** 129,225 **** --- 124,133 ---- } _comments.free(); } // Promote one word from an assembly-time handle to a live embedded oop. inline void CodeBlob::initialize_immediate_oop(oop* dest, jobject handle) { if (handle == NULL || // As a special case, IC oops are initialized to 1 or -1. handle == (jobject) Universe::non_oop_word()) { (*dest) = (oop)handle; } else { (*dest) = JNIHandles::resolve_non_null(handle); } } void CodeBlob::copy_oops(GrowableArray<jobject>* array) { assert(_oops_length == 0, "do this handshake just once, please"); int length = array->length(); assert((address)(oops_begin() + length) <= data_end(), "oops big enough"); oop* dest = oops_begin(); for (int index = 0 ; index < length; index++) { initialize_immediate_oop(&dest[index], array->at(index)); } _oops_length = length; // Now we can fix up all the oops in the code. // We need to do this in the code because // the assembler uses jobjects as placeholders. // The code and relocations have already been // initialized by the CodeBlob constructor, // so it is valid even at this early point to // iterate over relocations and patch the code. fix_oop_relocations(NULL, NULL, /*initialize_immediates=*/ true); } relocInfo::relocType CodeBlob::reloc_type_for_address(address pc) { RelocIterator iter(this, pc, pc+1); while (iter.next()) { return (relocInfo::relocType) iter.type(); } // No relocation info found for pc ShouldNotReachHere(); return relocInfo::none; // dummy return value } bool CodeBlob::is_at_poll_return(address pc) { RelocIterator iter(this, pc, pc+1); while (iter.next()) { if (iter.type() == relocInfo::poll_return_type) return true; } return false; } bool CodeBlob::is_at_poll_or_poll_return(address pc) { RelocIterator iter(this, pc, pc+1); while (iter.next()) { relocInfo::relocType t = iter.type(); if (t == relocInfo::poll_return_type || t == relocInfo::poll_type) return true; } return false; } void CodeBlob::fix_oop_relocations(address begin, address end, bool initialize_immediates) { // re-patch all oop-bearing instructions, just in case some oops moved RelocIterator iter(this, begin, end); while (iter.next()) { if (iter.type() == relocInfo::oop_type) { oop_Relocation* reloc = iter.oop_reloc(); if (initialize_immediates && reloc->oop_is_immediate()) { oop* dest = reloc->oop_addr(); initialize_immediate_oop(dest, (jobject) *dest); } // Refresh the oop-related bits of this instruction. reloc->fix_oop_relocation(); } // There must not be any interfering patches or breakpoints. assert(!(iter.type() == relocInfo::breakpoint_type && iter.breakpoint_reloc()->active()), "no active breakpoint"); } } void CodeBlob::do_unloading(BoolObjectClosure* is_alive, OopClosure* keep_alive, bool unloading_occurred) { ShouldNotReachHere(); }

src/share/vm/code/codeBlob.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File