src/share/vm/c1/c1_LIRAssembler.cpp

Print this page




   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
   7  * published by the Free Software Foundation.
   8  *
   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 "incls/_precompiled.incl"
  26 # include "incls/_c1_LIRAssembler.cpp.incl"


















  27 
  28 
  29 void LIR_Assembler::patching_epilog(PatchingStub* patch, LIR_PatchCode patch_code, Register obj, CodeEmitInfo* info) {
  30   // we must have enough patching space so that call can be inserted
  31   while ((intx) _masm->pc() - (intx) patch->pc_start() < NativeCall::instruction_size) {
  32     _masm->nop();
  33   }
  34   patch->install(_masm, patch_code, obj, info);
  35   append_patching_stub(patch);
  36 
  37 #ifdef ASSERT
  38   Bytecodes::Code code = info->scope()->method()->java_code_at_bci(info->stack()->bci());
  39   if (patch->id() == PatchingStub::access_field_id) {
  40     switch (code) {
  41       case Bytecodes::_putstatic:
  42       case Bytecodes::_getstatic:
  43       case Bytecodes::_putfield:
  44       case Bytecodes::_getfield:
  45         break;
  46       default:




   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
   7  * published by the Free Software Foundation.
   8  *
   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 "c1/c1_Compilation.hpp"
  27 #include "c1/c1_Instruction.hpp"
  28 #include "c1/c1_InstructionPrinter.hpp"
  29 #include "c1/c1_LIRAssembler.hpp"
  30 #include "c1/c1_MacroAssembler.hpp"
  31 #include "c1/c1_ValueStack.hpp"
  32 #include "ci/ciInstance.hpp"
  33 #ifdef TARGET_ARCH_x86
  34 # include "nativeInst_x86.hpp"
  35 # include "vmreg_x86.inline.hpp"
  36 #endif
  37 #ifdef TARGET_ARCH_sparc
  38 # include "nativeInst_sparc.hpp"
  39 # include "vmreg_sparc.inline.hpp"
  40 #endif
  41 #ifdef TARGET_ARCH_zero
  42 # include "nativeInst_zero.hpp"
  43 # include "vmreg_zero.inline.hpp"
  44 #endif
  45 
  46 
  47 void LIR_Assembler::patching_epilog(PatchingStub* patch, LIR_PatchCode patch_code, Register obj, CodeEmitInfo* info) {
  48   // we must have enough patching space so that call can be inserted
  49   while ((intx) _masm->pc() - (intx) patch->pc_start() < NativeCall::instruction_size) {
  50     _masm->nop();
  51   }
  52   patch->install(_masm, patch_code, obj, info);
  53   append_patching_stub(patch);
  54 
  55 #ifdef ASSERT
  56   Bytecodes::Code code = info->scope()->method()->java_code_at_bci(info->stack()->bci());
  57   if (patch->id() == PatchingStub::access_field_id) {
  58     switch (code) {
  59       case Bytecodes::_putstatic:
  60       case Bytecodes::_getstatic:
  61       case Bytecodes::_putfield:
  62       case Bytecodes::_getfield:
  63         break;
  64       default: