comparison src/share/vm/code/relocInfo.hpp @ 3243:208b6c560ff4

Merge
author vladidan
date Thu, 14 Apr 2011 11:02:05 -0400
parents 6c97c830fb6f
children da91efe96a93
comparison
equal deleted inserted replaced
3242:c737922fd8bb 3243:208b6c560ff4
1 /* 1 /*
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
701 // here is the type-specific hook which reads (unpacks) relocation data: 701 // here is the type-specific hook which reads (unpacks) relocation data:
702 virtual void unpack_data() { 702 virtual void unpack_data() {
703 assert(datalen()==0 || type()==relocInfo::none, "no data here"); 703 assert(datalen()==0 || type()==relocInfo::none, "no data here");
704 } 704 }
705 705
706 static bool is_reloc_index(intptr_t index) {
707 return 0 < index && index < os::vm_page_size();
708 }
709
706 protected: 710 protected:
707 // Helper functions for pack_data_to() and unpack_data(). 711 // Helper functions for pack_data_to() and unpack_data().
708 712
709 // Most of the compression logic is confined here. 713 // Most of the compression logic is confined here.
710 // (The "immediate data" mechanism of relocInfo works independently 714 // (The "immediate data" mechanism of relocInfo works independently
1125 RelocationHolder rh = newHolder(); 1129 RelocationHolder rh = newHolder();
1126 new(rh) external_word_Relocation(NULL); 1130 new(rh) external_word_Relocation(NULL);
1127 return rh; 1131 return rh;
1128 } 1132 }
1129 1133
1134 // Some address looking values aren't safe to treat as relocations
1135 // and should just be treated as constants.
1136 static bool can_be_relocated(address target) {
1137 return target != NULL && !is_reloc_index((intptr_t)target);
1138 }
1139
1130 private: 1140 private:
1131 address _target; // address in runtime 1141 address _target; // address in runtime
1132 1142
1133 external_word_Relocation(address target) { 1143 external_word_Relocation(address target) {
1134 _target = target; 1144 _target = target;