< prev index next >

src/share/vm/code/codeBlob.cpp

Print this page




  37 #include "runtime/mutexLocker.hpp"
  38 #include "runtime/safepoint.hpp"
  39 #include "runtime/sharedRuntime.hpp"
  40 #include "runtime/vframe.hpp"
  41 #include "services/memoryService.hpp"
  42 #ifdef TARGET_ARCH_x86
  43 # include "nativeInst_x86.hpp"
  44 #endif
  45 #ifdef TARGET_ARCH_sparc
  46 # include "nativeInst_sparc.hpp"
  47 #endif
  48 #ifdef TARGET_ARCH_zero
  49 # include "nativeInst_zero.hpp"
  50 #endif
  51 #ifdef TARGET_ARCH_arm
  52 # include "nativeInst_arm.hpp"
  53 #endif
  54 #ifdef TARGET_ARCH_ppc
  55 # include "nativeInst_ppc.hpp"
  56 #endif



  57 #ifdef COMPILER1
  58 #include "c1/c1_Runtime1.hpp"
  59 #endif
  60 
  61 unsigned int align_code_offset(int offset) {
  62   // align the size to CodeEntryAlignment
  63   return
  64     ((offset + (int)CodeHeap::header_size() + (CodeEntryAlignment-1)) & ~(CodeEntryAlignment-1))
  65     - (int)CodeHeap::header_size();
  66 }
  67 
  68 
  69 // This must be consistent with the CodeBlob constructor's layout actions.
  70 unsigned int CodeBlob::allocation_size(CodeBuffer* cb, int header_size) {
  71   unsigned int size = header_size;
  72   size += round_to(cb->total_relocation_size(), oopSize);
  73   // align the size to CodeEntryAlignment
  74   size = align_code_offset(size);
  75   size += round_to(cb->total_content_size(), oopSize);
  76   size += round_to(cb->total_oop_size(), oopSize);




  37 #include "runtime/mutexLocker.hpp"
  38 #include "runtime/safepoint.hpp"
  39 #include "runtime/sharedRuntime.hpp"
  40 #include "runtime/vframe.hpp"
  41 #include "services/memoryService.hpp"
  42 #ifdef TARGET_ARCH_x86
  43 # include "nativeInst_x86.hpp"
  44 #endif
  45 #ifdef TARGET_ARCH_sparc
  46 # include "nativeInst_sparc.hpp"
  47 #endif
  48 #ifdef TARGET_ARCH_zero
  49 # include "nativeInst_zero.hpp"
  50 #endif
  51 #ifdef TARGET_ARCH_arm
  52 # include "nativeInst_arm.hpp"
  53 #endif
  54 #ifdef TARGET_ARCH_ppc
  55 # include "nativeInst_ppc.hpp"
  56 #endif
  57 #ifdef TARGET_ARCH_aarch32
  58 # include "nativeInst_aarch32.hpp"
  59 #endif
  60 #ifdef COMPILER1
  61 #include "c1/c1_Runtime1.hpp"
  62 #endif
  63 
  64 unsigned int align_code_offset(int offset) {
  65   // align the size to CodeEntryAlignment
  66   return
  67     ((offset + (int)CodeHeap::header_size() + (CodeEntryAlignment-1)) & ~(CodeEntryAlignment-1))
  68     - (int)CodeHeap::header_size();
  69 }
  70 
  71 
  72 // This must be consistent with the CodeBlob constructor's layout actions.
  73 unsigned int CodeBlob::allocation_size(CodeBuffer* cb, int header_size) {
  74   unsigned int size = header_size;
  75   size += round_to(cb->total_relocation_size(), oopSize);
  76   // align the size to CodeEntryAlignment
  77   size = align_code_offset(size);
  78   size += round_to(cb->total_content_size(), oopSize);
  79   size += round_to(cb->total_oop_size(), oopSize);


< prev index next >