equal
deleted
inserted
replaced
1 // |
1 // |
2 // Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. |
2 // Copyright (c) 2003, 2017, 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. |
651 void emit_d32_reloc(CodeBuffer& cbuf, int d32, RelocationHolder const& rspec, int format) { |
651 void emit_d32_reloc(CodeBuffer& cbuf, int d32, RelocationHolder const& rspec, int format) { |
652 #ifdef ASSERT |
652 #ifdef ASSERT |
653 if (rspec.reloc()->type() == relocInfo::oop_type && |
653 if (rspec.reloc()->type() == relocInfo::oop_type && |
654 d32 != 0 && d32 != (intptr_t) Universe::non_oop_word()) { |
654 d32 != 0 && d32 != (intptr_t) Universe::non_oop_word()) { |
655 assert(Universe::heap()->is_in_reserved((address)(intptr_t)d32), "should be real oop"); |
655 assert(Universe::heap()->is_in_reserved((address)(intptr_t)d32), "should be real oop"); |
656 assert(cast_to_oop((intptr_t)d32)->is_oop() && (ScavengeRootsInCode || !cast_to_oop((intptr_t)d32)->is_scavengable()), "cannot embed scavengable oops in code"); |
656 assert(oopDesc::is_oop(cast_to_oop((intptr_t)d32)) && (ScavengeRootsInCode || !cast_to_oop((intptr_t)d32)->is_scavengable()), "cannot embed scavengable oops in code"); |
657 } |
657 } |
658 #endif |
658 #endif |
659 cbuf.relocate(cbuf.insts_mark(), rspec, format); |
659 cbuf.relocate(cbuf.insts_mark(), rspec, format); |
660 cbuf.insts()->emit_int32(d32); |
660 cbuf.insts()->emit_int32(d32); |
661 } |
661 } |
678 void emit_d64_reloc(CodeBuffer& cbuf, int64_t d64, RelocationHolder const& rspec, int format) { |
678 void emit_d64_reloc(CodeBuffer& cbuf, int64_t d64, RelocationHolder const& rspec, int format) { |
679 #ifdef ASSERT |
679 #ifdef ASSERT |
680 if (rspec.reloc()->type() == relocInfo::oop_type && |
680 if (rspec.reloc()->type() == relocInfo::oop_type && |
681 d64 != 0 && d64 != (int64_t) Universe::non_oop_word()) { |
681 d64 != 0 && d64 != (int64_t) Universe::non_oop_word()) { |
682 assert(Universe::heap()->is_in_reserved((address)d64), "should be real oop"); |
682 assert(Universe::heap()->is_in_reserved((address)d64), "should be real oop"); |
683 assert(cast_to_oop(d64)->is_oop() && (ScavengeRootsInCode || !cast_to_oop(d64)->is_scavengable()), |
683 assert(oopDesc::is_oop(cast_to_oop(d64)) && (ScavengeRootsInCode || !cast_to_oop(d64)->is_scavengable()), |
684 "cannot embed scavengable oops in code"); |
684 "cannot embed scavengable oops in code"); |
685 } |
685 } |
686 #endif |
686 #endif |
687 cbuf.relocate(cbuf.insts_mark(), rspec, format); |
687 cbuf.relocate(cbuf.insts_mark(), rspec, format); |
688 cbuf.insts()->emit_int64(d64); |
688 cbuf.insts()->emit_int64(d64); |