69 size += align_up(cb->total_metadata_size(), oopSize); |
69 size += align_up(cb->total_metadata_size(), oopSize); |
70 return size; |
70 return size; |
71 } |
71 } |
72 |
72 |
73 CodeBlob::CodeBlob(const char* name, CompilerType type, const CodeBlobLayout& layout, int frame_complete_offset, int frame_size, ImmutableOopMapSet* oop_maps, bool caller_must_gc_arguments) : |
73 CodeBlob::CodeBlob(const char* name, CompilerType type, const CodeBlobLayout& layout, int frame_complete_offset, int frame_size, ImmutableOopMapSet* oop_maps, bool caller_must_gc_arguments) : |
74 _name(name), |
74 _type(type), |
75 _size(layout.size()), |
75 _size(layout.size()), |
76 _header_size(layout.header_size()), |
76 _header_size(layout.header_size()), |
77 _frame_complete_offset(frame_complete_offset), |
77 _frame_complete_offset(frame_complete_offset), |
78 _data_offset(layout.data_offset()), |
78 _data_offset(layout.data_offset()), |
79 _frame_size(frame_size), |
79 _frame_size(frame_size), |
80 _strings(CodeStrings()), |
|
81 _oop_maps(oop_maps), |
|
82 _caller_must_gc_arguments(caller_must_gc_arguments), |
|
83 _code_begin(layout.code_begin()), |
80 _code_begin(layout.code_begin()), |
84 _code_end(layout.code_end()), |
81 _code_end(layout.code_end()), |
|
82 _content_begin(layout.content_begin()), |
85 _data_end(layout.data_end()), |
83 _data_end(layout.data_end()), |
86 _relocation_begin(layout.relocation_begin()), |
84 _relocation_begin(layout.relocation_begin()), |
87 _relocation_end(layout.relocation_end()), |
85 _relocation_end(layout.relocation_end()), |
88 _content_begin(layout.content_begin()), |
86 _oop_maps(oop_maps), |
89 _type(type) |
87 _caller_must_gc_arguments(caller_must_gc_arguments), |
|
88 _strings(CodeStrings()), |
|
89 _name(name) |
90 { |
90 { |
91 assert(is_aligned(layout.size(), oopSize), "unaligned size"); |
91 assert(is_aligned(layout.size(), oopSize), "unaligned size"); |
92 assert(is_aligned(layout.header_size(), oopSize), "unaligned size"); |
92 assert(is_aligned(layout.header_size(), oopSize), "unaligned size"); |
93 assert(is_aligned(layout.relocation_size(), oopSize), "unaligned size"); |
93 assert(is_aligned(layout.relocation_size(), oopSize), "unaligned size"); |
94 assert(layout.code_end() == layout.content_end(), "must be the same - see code_end()"); |
94 assert(layout.code_end() == layout.content_end(), "must be the same - see code_end()"); |
97 assert(_frame_size >= -1, "must use frame size or -1 for runtime stubs"); |
97 assert(_frame_size >= -1, "must use frame size or -1 for runtime stubs"); |
98 #endif // COMPILER1 |
98 #endif // COMPILER1 |
99 } |
99 } |
100 |
100 |
101 CodeBlob::CodeBlob(const char* name, CompilerType type, const CodeBlobLayout& layout, CodeBuffer* cb, int frame_complete_offset, int frame_size, OopMapSet* oop_maps, bool caller_must_gc_arguments) : |
101 CodeBlob::CodeBlob(const char* name, CompilerType type, const CodeBlobLayout& layout, CodeBuffer* cb, int frame_complete_offset, int frame_size, OopMapSet* oop_maps, bool caller_must_gc_arguments) : |
102 _name(name), |
102 _type(type), |
103 _size(layout.size()), |
103 _size(layout.size()), |
104 _header_size(layout.header_size()), |
104 _header_size(layout.header_size()), |
105 _frame_complete_offset(frame_complete_offset), |
105 _frame_complete_offset(frame_complete_offset), |
106 _data_offset(layout.data_offset()), |
106 _data_offset(layout.data_offset()), |
107 _frame_size(frame_size), |
107 _frame_size(frame_size), |
108 _strings(CodeStrings()), |
|
109 _caller_must_gc_arguments(caller_must_gc_arguments), |
|
110 _code_begin(layout.code_begin()), |
108 _code_begin(layout.code_begin()), |
111 _code_end(layout.code_end()), |
109 _code_end(layout.code_end()), |
|
110 _content_begin(layout.content_begin()), |
112 _data_end(layout.data_end()), |
111 _data_end(layout.data_end()), |
113 _relocation_begin(layout.relocation_begin()), |
112 _relocation_begin(layout.relocation_begin()), |
114 _relocation_end(layout.relocation_end()), |
113 _relocation_end(layout.relocation_end()), |
115 _content_begin(layout.content_begin()), |
114 _caller_must_gc_arguments(caller_must_gc_arguments), |
116 _type(type) |
115 _strings(CodeStrings()), |
|
116 _name(name) |
117 { |
117 { |
118 assert(is_aligned(_size, oopSize), "unaligned size"); |
118 assert(is_aligned(_size, oopSize), "unaligned size"); |
119 assert(is_aligned(_header_size, oopSize), "unaligned size"); |
119 assert(is_aligned(_header_size, oopSize), "unaligned size"); |
120 assert(_data_offset <= _size, "codeBlob is too small"); |
120 assert(_data_offset <= _size, "codeBlob is too small"); |
121 assert(layout.code_end() == layout.content_end(), "must be the same - see code_end()"); |
121 assert(layout.code_end() == layout.content_end(), "must be the same - see code_end()"); |