248 assert( !OptoReg::is_valid(_callees[reg]), "oop can't be callee save" );
249 #ifdef _LP64
250 // 64-bit pointers record oop-ishness on 2 aligned adjacent registers.
251 // Make sure both are record from the same reaching def, but do not
252 // put both into the oopmap.
253 if( (reg&1) == 1 ) { // High half of oop-pair?
254 assert( _defs[reg-1] == _defs[reg], "both halves from same reaching def" );
255 continue; // Do not record high parts in oopmap
256 }
257 #endif
258
259 // Check for a legal reg name in the oopMap and bailout if it is not.
260 if (!omap->legal_vm_reg_name(r)) {
261 stringStream ss;
262 ss.print("illegal oopMap register name: ");
263 r->print_on(&ss);
264 assert(false, "%s", ss.as_string());
265 regalloc->C->record_method_not_compilable(ss.as_string());
266 continue;
267 }
268 if( t->is_ptr()->_offset == 0 ) { // Not derived?
269 if( mcall ) {
270 // Outgoing argument GC mask responsibility belongs to the callee,
271 // not the caller. Inspect the inputs to the call, to see if
272 // this live-range is one of them.
273 uint cnt = mcall->tf()->domain()->cnt();
274 uint j;
275 for( j = TypeFunc::Parms; j < cnt; j++)
276 if( mcall->in(j) == def )
277 break; // reaching def is an argument oop
278 if( j < cnt ) // arg oops dont go in GC map
279 continue; // Continue on to the next register
280 }
281 omap->set_oop(r);
282 } else { // Else it's derived.
283 // Find the base of the derived value.
284 uint i;
285 // Fast, common case, scan
286 for( i = jvms->oopoff(); i < n->req(); i+=2 )
287 if( n->in(i) == def ) break; // Common case
288 if( i == n->req() ) { // Missed, try a more generous scan
289 // Scan again, but this time peek through copies
290 for( i = jvms->oopoff(); i < n->req(); i+=2 ) {
291 Node *m = n->in(i); // Get initial derived value
292 while( 1 ) {
293 Node *d = def; // Get initial reaching def
323 }
324 }
325 omap->set_derived_oop(r, b);
326 }
327
328 } else if( t->isa_narrowoop() ) {
329 assert( !OptoReg::is_valid(_callees[reg]), "oop can't be callee save" );
330 // Check for a legal reg name in the oopMap and bailout if it is not.
331 if (!omap->legal_vm_reg_name(r)) {
332 stringStream ss;
333 ss.print("illegal oopMap register name: ");
334 r->print_on(&ss);
335 assert(false, "%s", ss.as_string());
336 regalloc->C->record_method_not_compilable(ss.as_string());
337 continue;
338 }
339 if( mcall ) {
340 // Outgoing argument GC mask responsibility belongs to the callee,
341 // not the caller. Inspect the inputs to the call, to see if
342 // this live-range is one of them.
343 uint cnt = mcall->tf()->domain()->cnt();
344 uint j;
345 for( j = TypeFunc::Parms; j < cnt; j++)
346 if( mcall->in(j) == def )
347 break; // reaching def is an argument oop
348 if( j < cnt ) // arg oops dont go in GC map
349 continue; // Continue on to the next register
350 }
351 omap->set_narrowoop(r);
352 } else if( OptoReg::is_valid(_callees[reg])) { // callee-save?
353 // It's a callee-save value
354 assert( dup_check[_callees[reg]]==0, "trying to callee save same reg twice" );
355 debug_only( dup_check[_callees[reg]]=1; )
356 VMReg callee = OptoReg::as_VMReg(OptoReg::Name(_callees[reg]));
357 omap->set_callee_saved(r, callee);
358
359 } else {
360 // Other - some reaching non-oop value
361 #ifdef ASSERT
362 if (t->isa_rawptr()) {
363 ResourceMark rm;
|
248 assert( !OptoReg::is_valid(_callees[reg]), "oop can't be callee save" );
249 #ifdef _LP64
250 // 64-bit pointers record oop-ishness on 2 aligned adjacent registers.
251 // Make sure both are record from the same reaching def, but do not
252 // put both into the oopmap.
253 if( (reg&1) == 1 ) { // High half of oop-pair?
254 assert( _defs[reg-1] == _defs[reg], "both halves from same reaching def" );
255 continue; // Do not record high parts in oopmap
256 }
257 #endif
258
259 // Check for a legal reg name in the oopMap and bailout if it is not.
260 if (!omap->legal_vm_reg_name(r)) {
261 stringStream ss;
262 ss.print("illegal oopMap register name: ");
263 r->print_on(&ss);
264 assert(false, "%s", ss.as_string());
265 regalloc->C->record_method_not_compilable(ss.as_string());
266 continue;
267 }
268 if (t->is_ptr()->offset() == 0) { // Not derived?
269 if( mcall ) {
270 // Outgoing argument GC mask responsibility belongs to the callee,
271 // not the caller. Inspect the inputs to the call, to see if
272 // this live-range is one of them.
273 uint cnt = mcall->tf()->domain_cc()->cnt();
274 uint j;
275 for( j = TypeFunc::Parms; j < cnt; j++)
276 if( mcall->in(j) == def )
277 break; // reaching def is an argument oop
278 if( j < cnt ) // arg oops dont go in GC map
279 continue; // Continue on to the next register
280 }
281 omap->set_oop(r);
282 } else { // Else it's derived.
283 // Find the base of the derived value.
284 uint i;
285 // Fast, common case, scan
286 for( i = jvms->oopoff(); i < n->req(); i+=2 )
287 if( n->in(i) == def ) break; // Common case
288 if( i == n->req() ) { // Missed, try a more generous scan
289 // Scan again, but this time peek through copies
290 for( i = jvms->oopoff(); i < n->req(); i+=2 ) {
291 Node *m = n->in(i); // Get initial derived value
292 while( 1 ) {
293 Node *d = def; // Get initial reaching def
323 }
324 }
325 omap->set_derived_oop(r, b);
326 }
327
328 } else if( t->isa_narrowoop() ) {
329 assert( !OptoReg::is_valid(_callees[reg]), "oop can't be callee save" );
330 // Check for a legal reg name in the oopMap and bailout if it is not.
331 if (!omap->legal_vm_reg_name(r)) {
332 stringStream ss;
333 ss.print("illegal oopMap register name: ");
334 r->print_on(&ss);
335 assert(false, "%s", ss.as_string());
336 regalloc->C->record_method_not_compilable(ss.as_string());
337 continue;
338 }
339 if( mcall ) {
340 // Outgoing argument GC mask responsibility belongs to the callee,
341 // not the caller. Inspect the inputs to the call, to see if
342 // this live-range is one of them.
343 uint cnt = mcall->tf()->domain_cc()->cnt();
344 uint j;
345 for( j = TypeFunc::Parms; j < cnt; j++)
346 if( mcall->in(j) == def )
347 break; // reaching def is an argument oop
348 if( j < cnt ) // arg oops dont go in GC map
349 continue; // Continue on to the next register
350 }
351 omap->set_narrowoop(r);
352 } else if( OptoReg::is_valid(_callees[reg])) { // callee-save?
353 // It's a callee-save value
354 assert( dup_check[_callees[reg]]==0, "trying to callee save same reg twice" );
355 debug_only( dup_check[_callees[reg]]=1; )
356 VMReg callee = OptoReg::as_VMReg(OptoReg::Name(_callees[reg]));
357 omap->set_callee_saved(r, callee);
358
359 } else {
360 // Other - some reaching non-oop value
361 #ifdef ASSERT
362 if (t->isa_rawptr()) {
363 ResourceMark rm;
|