src/share/vm/code/relocInfo.hpp

changeset 2750
6c97c830fb6f
parent 2708
1d1603768966
parent 2737
479b4b4b6950
child 4037
da91efe96a93
     1.1 --- a/src/share/vm/code/relocInfo.hpp	Fri Apr 08 16:18:48 2011 -0700
     1.2 +++ b/src/share/vm/code/relocInfo.hpp	Sat Apr 09 21:16:12 2011 -0700
     1.3 @@ -703,6 +703,10 @@
     1.4      assert(datalen()==0 || type()==relocInfo::none, "no data here");
     1.5    }
     1.6  
     1.7 +  static bool is_reloc_index(intptr_t index) {
     1.8 +    return 0 < index && index < os::vm_page_size();
     1.9 +  }
    1.10 +
    1.11   protected:
    1.12    // Helper functions for pack_data_to() and unpack_data().
    1.13  
    1.14 @@ -1127,6 +1131,12 @@
    1.15      return rh;
    1.16    }
    1.17  
    1.18 +  // Some address looking values aren't safe to treat as relocations
    1.19 +  // and should just be treated as constants.
    1.20 +  static bool can_be_relocated(address target) {
    1.21 +    return target != NULL && !is_reloc_index((intptr_t)target);
    1.22 +  }
    1.23 +
    1.24   private:
    1.25    address _target;                  // address in runtime
    1.26  

mercurial