10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #include "precompiled.hpp" 26 #include "asm/assembler.inline.hpp" 27 #include "assembler_arm.inline.hpp" 28 #include "code/relocInfo.hpp" 29 #include "nativeInst_arm.hpp" 30 #include "oops/oop.inline.hpp" 31 #include "runtime/safepoint.hpp" 32 33 void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) { 34 35 NativeMovConstReg* ni = nativeMovConstReg_at(addr()); 36 #if defined(AARCH64) && defined(COMPILER2) 37 if (ni->is_movz()) { 38 assert(type() == relocInfo::oop_type, "!"); 39 if (verify_only) { 40 uintptr_t d = ni->data(); 41 guarantee((d >> 32) == 0, "not narrow oop"); 42 narrowOop no = d; 43 oop o = oopDesc::decode_heap_oop(no); 44 guarantee(cast_from_oop<intptr_t>(o) == (intptr_t)x, "instructions must match"); 45 } else { 46 ni->set_data((intptr_t)x); 47 } 48 return; 49 } 50 #endif 51 if (verify_only) { 52 guarantee(ni->data() == (intptr_t)(x + o), "instructions must match"); 53 } else { 54 ni->set_data((intptr_t)(x + o)); 55 } 56 } 57 58 address Relocation::pd_call_destination(address orig_addr) { 59 address pc = addr(); 60 61 int adj = 0; 62 if (orig_addr != NULL) { 63 // We just moved this call instruction from orig_addr to addr(). | 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #include "precompiled.hpp" 26 #include "asm/assembler.inline.hpp" 27 #include "assembler_arm.inline.hpp" 28 #include "code/relocInfo.hpp" 29 #include "nativeInst_arm.hpp" 30 #include "compressedOops.inline.hpp" 31 #include "oops/oop.hpp" 32 #include "runtime/safepoint.hpp" 33 34 void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) { 35 36 NativeMovConstReg* ni = nativeMovConstReg_at(addr()); 37 #if defined(AARCH64) && defined(COMPILER2) 38 if (ni->is_movz()) { 39 assert(type() == relocInfo::oop_type, "!"); 40 if (verify_only) { 41 uintptr_t d = ni->data(); 42 guarantee((d >> 32) == 0, "not narrow oop"); 43 narrowOop no = d; 44 oop o = CompressedOops::decode(no); 45 guarantee(cast_from_oop<intptr_t>(o) == (intptr_t)x, "instructions must match"); 46 } else { 47 ni->set_data((intptr_t)x); 48 } 49 return; 50 } 51 #endif 52 if (verify_only) { 53 guarantee(ni->data() == (intptr_t)(x + o), "instructions must match"); 54 } else { 55 ni->set_data((intptr_t)(x + o)); 56 } 57 } 58 59 address Relocation::pd_call_destination(address orig_addr) { 60 address pc = addr(); 61 62 int adj = 0; 63 if (orig_addr != NULL) { 64 // We just moved this call instruction from orig_addr to addr(). |