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);
77 size += round_to(cb->total_metadata_size(), oopSize);
78 return size;
79 }
80
81
|
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 CodeBlob::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);
77 size += round_to(cb->total_metadata_size(), oopSize);
78 return size;
79 }
80
81
|