src/share/vm/code/relocInfo.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/_relocInfo.cpp.incl"

















  27 
  28 
  29 const RelocationHolder RelocationHolder::none; // its type is relocInfo::none
  30 
  31 
  32 // Implementation of relocInfo
  33 
  34 #ifdef ASSERT
  35 relocInfo::relocInfo(relocType t, int off, int f) {
  36   assert(t != data_prefix_tag, "cannot build a prefix this way");
  37   assert((t & type_mask) == t, "wrong type");
  38   assert((f & format_mask) == f, "wrong format");
  39   assert(off >= 0 && off < offset_limit(), "offset out off bounds");
  40   assert((off & (offset_unit-1)) == 0, "misaligned offset");
  41   (*this) = relocInfo(t, RAW_BITS, off, f);
  42 }
  43 #endif
  44 
  45 void relocInfo::initialize(CodeSection* dest, Relocation* reloc) {
  46   relocInfo* data = this+1;  // here's where the data might go




   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 "code/compiledIC.hpp"
  27 #include "code/nmethod.hpp"
  28 #include "code/relocInfo.hpp"
  29 #include "memory/resourceArea.hpp"
  30 #include "runtime/stubCodeGenerator.hpp"
  31 #include "utilities/copy.hpp"
  32 #ifdef TARGET_ARCH_x86
  33 # include "assembler_x86.inline.hpp"
  34 # include "nativeInst_x86.hpp"
  35 #endif
  36 #ifdef TARGET_ARCH_sparc
  37 # include "assembler_sparc.inline.hpp"
  38 # include "nativeInst_sparc.hpp"
  39 #endif
  40 #ifdef TARGET_ARCH_zero
  41 # include "assembler_zero.inline.hpp"
  42 # include "nativeInst_zero.hpp"
  43 #endif
  44 
  45 
  46 const RelocationHolder RelocationHolder::none; // its type is relocInfo::none
  47 
  48 
  49 // Implementation of relocInfo
  50 
  51 #ifdef ASSERT
  52 relocInfo::relocInfo(relocType t, int off, int f) {
  53   assert(t != data_prefix_tag, "cannot build a prefix this way");
  54   assert((t & type_mask) == t, "wrong type");
  55   assert((f & format_mask) == f, "wrong format");
  56   assert(off >= 0 && off < offset_limit(), "offset out off bounds");
  57   assert((off & (offset_unit-1)) == 0, "misaligned offset");
  58   (*this) = relocInfo(t, RAW_BITS, off, f);
  59 }
  60 #endif
  61 
  62 void relocInfo::initialize(CodeSection* dest, Relocation* reloc) {
  63   relocInfo* data = this+1;  // here's where the data might go