< prev index next >

src/share/vm/interpreter/bytecode.hpp

Print this page




  26 #define SHARE_VM_INTERPRETER_BYTECODE_HPP
  27 
  28 #include "interpreter/bytecodes.hpp"
  29 #include "memory/allocation.hpp"
  30 #include "oops/method.hpp"
  31 #ifdef TARGET_ARCH_x86
  32 # include "bytes_x86.hpp"
  33 #endif
  34 #ifdef TARGET_ARCH_sparc
  35 # include "bytes_sparc.hpp"
  36 #endif
  37 #ifdef TARGET_ARCH_zero
  38 # include "bytes_zero.hpp"
  39 #endif
  40 #ifdef TARGET_ARCH_arm
  41 # include "bytes_arm.hpp"
  42 #endif
  43 #ifdef TARGET_ARCH_ppc
  44 # include "bytes_ppc.hpp"
  45 #endif



  46 
  47 class ciBytecodeStream;
  48 
  49 // The base class for different kinds of bytecode abstractions.
  50 // Provides the primitive operations to manipulate code relative
  51 // to the bcp.
  52 
  53 class Bytecode: public StackObj {
  54  protected:
  55   const address   _bcp;
  56   const Bytecodes::Code _code;
  57 
  58   // Address computation
  59   address addr_at            (int offset)        const     { return (address)_bcp + offset; }
  60   u_char byte_at(int offset) const               { return *addr_at(offset); }
  61   address aligned_addr_at    (int offset)        const     { return (address)round_to((intptr_t)addr_at(offset), jintSize); }
  62   int     aligned_offset     (int offset)        const     { return aligned_addr_at(offset) - addr_at(0); }
  63 
  64   // Word access:
  65   int     get_Java_u2_at     (int offset)        const     { return Bytes::get_Java_u2(addr_at(offset)); }




  26 #define SHARE_VM_INTERPRETER_BYTECODE_HPP
  27 
  28 #include "interpreter/bytecodes.hpp"
  29 #include "memory/allocation.hpp"
  30 #include "oops/method.hpp"
  31 #ifdef TARGET_ARCH_x86
  32 # include "bytes_x86.hpp"
  33 #endif
  34 #ifdef TARGET_ARCH_sparc
  35 # include "bytes_sparc.hpp"
  36 #endif
  37 #ifdef TARGET_ARCH_zero
  38 # include "bytes_zero.hpp"
  39 #endif
  40 #ifdef TARGET_ARCH_arm
  41 # include "bytes_arm.hpp"
  42 #endif
  43 #ifdef TARGET_ARCH_ppc
  44 # include "bytes_ppc.hpp"
  45 #endif
  46 #ifdef TARGET_ARCH_aarch32
  47 # include "bytes_aarch32.hpp"
  48 #endif
  49 
  50 class ciBytecodeStream;
  51 
  52 // The base class for different kinds of bytecode abstractions.
  53 // Provides the primitive operations to manipulate code relative
  54 // to the bcp.
  55 
  56 class Bytecode: public StackObj {
  57  protected:
  58   const address   _bcp;
  59   const Bytecodes::Code _code;
  60 
  61   // Address computation
  62   address addr_at            (int offset)        const     { return (address)_bcp + offset; }
  63   u_char byte_at(int offset) const               { return *addr_at(offset); }
  64   address aligned_addr_at    (int offset)        const     { return (address)round_to((intptr_t)addr_at(offset), jintSize); }
  65   int     aligned_offset     (int offset)        const     { return aligned_addr_at(offset) - addr_at(0); }
  66 
  67   // Word access:
  68   int     get_Java_u2_at     (int offset)        const     { return Bytes::get_Java_u2(addr_at(offset)); }


< prev index next >