909 // Zap the old code buffer contents, to avoid mistakenly using them.
910 debug_only(Copy::fill_to_bytes(bxp->_total_start, bxp->_total_size,
911 badCodeHeapFreeVal));
912
913 _decode_begin = NULL; // sanity
914
915 // Make certain that the new sections are all snugly inside the new blob.
916 verify_section_allocation();
917
918 #ifndef PRODUCT
919 if (PrintNMethods && (WizardMode || Verbose)) {
920 tty->print("expanded CodeBuffer:");
921 this->print();
922 }
923 #endif //PRODUCT
924 }
925
926 void CodeBuffer::take_over_code_from(CodeBuffer* cb) {
927 // Must already have disposed of the old blob somehow.
928 assert(blob() == NULL, "must be empty");
929 #ifdef ASSERT
930
931 #endif
932 // Take the new blob away from cb.
933 set_blob(cb->blob());
934 // Take over all the section pointers.
935 for (int n = 0; n < (int)SECT_LIMIT; n++) {
936 CodeSection* cb_sect = cb->code_section(n);
937 CodeSection* this_sect = code_section(n);
938 this_sect->take_over_code_from(cb_sect);
939 }
940 _overflow_arena = cb->_overflow_arena;
941 // Make sure the old cb won't try to use it or free it.
942 DEBUG_ONLY(cb->_blob = (BufferBlob*)badAddress);
943 }
944
945 void CodeBuffer::verify_section_allocation() {
946 address tstart = _total_start;
947 if (tstart == badAddress) return; // smashed by set_blob(NULL)
948 address tend = tstart + _total_size;
949 if (_blob != NULL) {
950
951 guarantee(tstart >= _blob->content_begin(), "sanity");
|
909 // Zap the old code buffer contents, to avoid mistakenly using them.
910 debug_only(Copy::fill_to_bytes(bxp->_total_start, bxp->_total_size,
911 badCodeHeapFreeVal));
912
913 _decode_begin = NULL; // sanity
914
915 // Make certain that the new sections are all snugly inside the new blob.
916 verify_section_allocation();
917
918 #ifndef PRODUCT
919 if (PrintNMethods && (WizardMode || Verbose)) {
920 tty->print("expanded CodeBuffer:");
921 this->print();
922 }
923 #endif //PRODUCT
924 }
925
926 void CodeBuffer::take_over_code_from(CodeBuffer* cb) {
927 // Must already have disposed of the old blob somehow.
928 assert(blob() == NULL, "must be empty");
929 // Take the new blob away from cb.
930 set_blob(cb->blob());
931 // Take over all the section pointers.
932 for (int n = 0; n < (int)SECT_LIMIT; n++) {
933 CodeSection* cb_sect = cb->code_section(n);
934 CodeSection* this_sect = code_section(n);
935 this_sect->take_over_code_from(cb_sect);
936 }
937 _overflow_arena = cb->_overflow_arena;
938 // Make sure the old cb won't try to use it or free it.
939 DEBUG_ONLY(cb->_blob = (BufferBlob*)badAddress);
940 }
941
942 void CodeBuffer::verify_section_allocation() {
943 address tstart = _total_start;
944 if (tstart == badAddress) return; // smashed by set_blob(NULL)
945 address tend = tstart + _total_size;
946 if (_blob != NULL) {
947
948 guarantee(tstart >= _blob->content_begin(), "sanity");
|