< prev index next >

src/hotspot/share/code/codeBlob.cpp

Print this page

138   assert(is_aligned(locs_size, oopSize), "unaligned size");
139 }
140 
141 
142 // Creates a RuntimeBlob from a CodeBuffer
143 // and copy code and relocation info.
144 RuntimeBlob::RuntimeBlob(
145   const char* name,
146   CodeBuffer* cb,
147   int         header_size,
148   int         size,
149   int         frame_complete,
150   int         frame_size,
151   OopMapSet*  oop_maps,
152   bool        caller_must_gc_arguments
153 ) : CodeBlob(name, compiler_none, CodeBlobLayout((address) this, size, header_size, cb), cb, frame_complete, frame_size, oop_maps, caller_must_gc_arguments) {
154   cb->copy_code_and_locs_to(this);
155 }
156 
157 void CodeBlob::flush() {
158   if (_oop_maps) {
159     FREE_C_HEAP_ARRAY(unsigned char, _oop_maps);
160     _oop_maps = NULL;
161   }
162   _strings.free();
163 }
164 
165 void CodeBlob::set_oop_maps(OopMapSet* p) {
166   // Danger Will Robinson! This method allocates a big
167   // chunk of memory, its your job to free it.
168   if (p != NULL) {
169     _oop_maps = ImmutableOopMapSet::build_from(p);
170   } else {
171     _oop_maps = NULL;
172   }
173 }
174 
175 
176 void RuntimeBlob::trace_new_stub(RuntimeBlob* stub, const char* name1, const char* name2) {
177   // Do not hold the CodeCache lock during name formatting.
178   assert(!CodeCache_lock->owned_by_self(), "release CodeCache before registering the stub");
179 
180   if (stub != NULL) {
181     char stub_id[256];

138   assert(is_aligned(locs_size, oopSize), "unaligned size");
139 }
140 
141 
142 // Creates a RuntimeBlob from a CodeBuffer
143 // and copy code and relocation info.
144 RuntimeBlob::RuntimeBlob(
145   const char* name,
146   CodeBuffer* cb,
147   int         header_size,
148   int         size,
149   int         frame_complete,
150   int         frame_size,
151   OopMapSet*  oop_maps,
152   bool        caller_must_gc_arguments
153 ) : CodeBlob(name, compiler_none, CodeBlobLayout((address) this, size, header_size, cb), cb, frame_complete, frame_size, oop_maps, caller_must_gc_arguments) {
154   cb->copy_code_and_locs_to(this);
155 }
156 
157 void CodeBlob::flush() {
158   FREE_C_HEAP_ARRAY(unsigned char, _oop_maps);
159   _oop_maps = NULL;


160   _strings.free();
161 }
162 
163 void CodeBlob::set_oop_maps(OopMapSet* p) {
164   // Danger Will Robinson! This method allocates a big
165   // chunk of memory, its your job to free it.
166   if (p != NULL) {
167     _oop_maps = ImmutableOopMapSet::build_from(p);
168   } else {
169     _oop_maps = NULL;
170   }
171 }
172 
173 
174 void RuntimeBlob::trace_new_stub(RuntimeBlob* stub, const char* name1, const char* name2) {
175   // Do not hold the CodeCache lock during name formatting.
176   assert(!CodeCache_lock->owned_by_self(), "release CodeCache before registering the stub");
177 
178   if (stub != NULL) {
179     char stub_id[256];
< prev index next >