< prev index next >

src/hotspot/share/code/relocInfo.cpp

Print this page
*** 567,10 ***
--- 567,33 ---
  
    _section = sindex;
    _target  = address_from_scaled_offset(offset, base);
  }
  
+ void patchable_barrier_Relocation::pack_data_to(CodeSection* dest) {
+   short* p = (short*) dest->locs_end();
+   *p++ = relocInfo::data0_from_int(_metadata);
+   *p++ = relocInfo::data1_from_int(_metadata);
+   *p++ = relocInfo::data0_from_int(_target_offset);
+   *p++ = relocInfo::data1_from_int(_target_offset);
+   dest->set_locs_end((relocInfo*)p);
+ }
+ 
+ void patchable_barrier_Relocation::unpack_data() {
+   assert(datalen() == 4, "Should be two int fields");
+   short* d = data();
+   _metadata = relocInfo::jint_from_data(&d[0]);
+   _target_offset = relocInfo::jint_from_data(&d[2]);
+ }
+ 
+ void patchable_barrier_Relocation::set_target_offset(jint target_offset) {
+   assert(datalen() == 4, "Should be two int fields");
+   short* d = data();
+   d[2] = relocInfo::data0_from_int(target_offset);
+   d[3] = relocInfo::data1_from_int(target_offset);
+ }
+ 
  //// miscellaneous methods
  oop* oop_Relocation::oop_addr() {
    int n = _oop_index;
    if (n == 0) {
      // oop is stored in the code stream
< prev index next >