src/cpu/x86/vm/relocInfo_x86.cpp

Print this page
rev 6802 : [mq]: encodeKlassFixes


   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  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/macroAssembler.hpp"
  27 #include "code/relocInfo.hpp"
  28 #include "nativeInst_x86.hpp"

  29 #include "oops/oop.inline.hpp"
  30 #include "runtime/safepoint.hpp"
  31 
  32 
  33 void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) {
  34 #ifdef AMD64
  35   x += o;
  36   typedef Assembler::WhichOperand WhichOperand;
  37   WhichOperand which = (WhichOperand) format(); // that is, disp32 or imm, call32, narrow oop
  38   assert(which == Assembler::disp32_operand ||
  39          which == Assembler::narrow_oop_operand ||
  40          which == Assembler::imm_operand, "format unpacks ok");
  41   if (which == Assembler::imm_operand) {
  42     if (verify_only) {
  43       assert(*pd_address_in_code() == x, "instructions must match");
  44     } else {
  45       *pd_address_in_code() = x;
  46     }
  47   } else if (which == Assembler::narrow_oop_operand) {
  48     address disp = Assembler::locate_operand(addr(), which);




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  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/macroAssembler.hpp"
  27 #include "code/relocInfo.hpp"
  28 #include "nativeInst_x86.hpp"
  29 #include "oops/klass.inline.hpp"
  30 #include "oops/oop.inline.hpp"
  31 #include "runtime/safepoint.hpp"
  32 
  33 
  34 void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) {
  35 #ifdef AMD64
  36   x += o;
  37   typedef Assembler::WhichOperand WhichOperand;
  38   WhichOperand which = (WhichOperand) format(); // that is, disp32 or imm, call32, narrow oop
  39   assert(which == Assembler::disp32_operand ||
  40          which == Assembler::narrow_oop_operand ||
  41          which == Assembler::imm_operand, "format unpacks ok");
  42   if (which == Assembler::imm_operand) {
  43     if (verify_only) {
  44       assert(*pd_address_in_code() == x, "instructions must match");
  45     } else {
  46       *pd_address_in_code() = x;
  47     }
  48   } else if (which == Assembler::narrow_oop_operand) {
  49     address disp = Assembler::locate_operand(addr(), which);