185 CodeBuffer code(buffer_blob);
186
187 OopMapSet* oop_maps;
188 int frame_size;
189 bool must_gc_arguments;
190
191 Compilation::setup_code_buffer(&code, 0);
192
193 // create assembler for code generation
194 StubAssembler* sasm = new StubAssembler(&code, name_for(id), id);
195 // generate code for runtime stub
196 oop_maps = generate_code_for(id, sasm);
197 assert(oop_maps == NULL || sasm->frame_size() != no_frame_size,
198 "if stub has an oop map it must have a valid frame size");
199
200 #ifdef ASSERT
201 // Make sure that stubs that need oopmaps have them
202 switch (id) {
203 // These stubs don't need to have an oopmap
204 case dtrace_object_alloc_id:
205 case g1_pre_barrier_slow_id:
206 case g1_post_barrier_slow_id:
207 case slow_subtype_check_id:
208 case fpu2long_stub_id:
209 case unwind_exception_id:
210 case counter_overflow_id:
211 #if defined(SPARC) || defined(PPC32)
212 case handle_exception_nofpu_id: // Unused on sparc
213 #endif
214 break;
215
216 // All other stubs should have oopmaps
217 default:
218 assert(oop_maps != NULL, "must have an oopmap");
219 }
220 #endif
221
222 // align so printing shows nop's instead of random code at the end (SimpleStubs are aligned)
223 sasm->align(BytesPerWord);
224 // make sure all code is in code buffer
|
185 CodeBuffer code(buffer_blob);
186
187 OopMapSet* oop_maps;
188 int frame_size;
189 bool must_gc_arguments;
190
191 Compilation::setup_code_buffer(&code, 0);
192
193 // create assembler for code generation
194 StubAssembler* sasm = new StubAssembler(&code, name_for(id), id);
195 // generate code for runtime stub
196 oop_maps = generate_code_for(id, sasm);
197 assert(oop_maps == NULL || sasm->frame_size() != no_frame_size,
198 "if stub has an oop map it must have a valid frame size");
199
200 #ifdef ASSERT
201 // Make sure that stubs that need oopmaps have them
202 switch (id) {
203 // These stubs don't need to have an oopmap
204 case dtrace_object_alloc_id:
205 case heap_object_sample_id:
206 case g1_pre_barrier_slow_id:
207 case g1_post_barrier_slow_id:
208 case slow_subtype_check_id:
209 case fpu2long_stub_id:
210 case unwind_exception_id:
211 case counter_overflow_id:
212 #if defined(SPARC) || defined(PPC32)
213 case handle_exception_nofpu_id: // Unused on sparc
214 #endif
215 break;
216
217 // All other stubs should have oopmaps
218 default:
219 assert(oop_maps != NULL, "must have an oopmap");
220 }
221 #endif
222
223 // align so printing shows nop's instead of random code at the end (SimpleStubs are aligned)
224 sasm->align(BytesPerWord);
225 // make sure all code is in code buffer
|