hotspot/src/share/vm/asm/codeBuffer.cpp
changeset 46469 f0f38f5ac34f
parent 42064 a530dbabe64f
child 46619 a3919f5e8d2b
equal deleted inserted replaced
46464:6432a858a220 46469:f0f38f5ac34f
   621   ShouldNotReachHere();
   621   ShouldNotReachHere();
   622   return -1;
   622   return -1;
   623 }
   623 }
   624 
   624 
   625 csize_t CodeBuffer::total_relocation_size() const {
   625 csize_t CodeBuffer::total_relocation_size() const {
   626   csize_t lsize = copy_relocations_to(NULL);  // dry run only
   626   csize_t total = copy_relocations_to(NULL);  // dry run only
   627   csize_t csize = total_content_size();
       
   628   csize_t total = RelocIterator::locs_and_index_size(csize, lsize);
       
   629   return (csize_t) align_size_up(total, HeapWordSize);
   627   return (csize_t) align_size_up(total, HeapWordSize);
   630 }
   628 }
   631 
   629 
   632 csize_t CodeBuffer::copy_relocations_to(address buf, csize_t buf_limit, bool only_inst) const {
   630 csize_t CodeBuffer::copy_relocations_to(address buf, csize_t buf_limit, bool only_inst) const {
   633   csize_t buf_offset = 0;
   631   csize_t buf_offset = 0;
   724   }
   722   }
   725   // if dest == NULL, this is just the sizing pass
   723   // if dest == NULL, this is just the sizing pass
   726   //
   724   //
   727   buf_offset = copy_relocations_to(buf, buf_limit, false);
   725   buf_offset = copy_relocations_to(buf, buf_limit, false);
   728 
   726 
   729   // Account for index:
       
   730   if (buf != NULL) {
       
   731     RelocIterator::create_index(dest->relocation_begin(),
       
   732                                 buf_offset / sizeof(relocInfo),
       
   733                                 dest->relocation_end());
       
   734   }
       
   735 
       
   736   return buf_offset;
   727   return buf_offset;
   737 }
   728 }
   738 
   729 
   739 void CodeBuffer::copy_code_to(CodeBlob* dest_blob) {
   730 void CodeBuffer::copy_code_to(CodeBlob* dest_blob) {
   740 #ifndef PRODUCT
   731 #ifndef PRODUCT