< prev index next >

src/hotspot/share/opto/buildOopMap.cpp

Print this page

237 
238     // Classify the reaching def as oop, derived, callee-save, dead, or other
239     const Type *t = def->bottom_type();
240     if( t->isa_oop_ptr() ) {    // Oop or derived?
241       assert( !OptoReg::is_valid(_callees[reg]), "oop can't be callee save" );
242 #ifdef _LP64
243       // 64-bit pointers record oop-ishness on 2 aligned adjacent registers.
244       // Make sure both are record from the same reaching def, but do not
245       // put both into the oopmap.
246       if( (reg&1) == 1 ) {      // High half of oop-pair?
247         assert( _defs[reg-1] == _defs[reg], "both halves from same reaching def" );
248         continue;               // Do not record high parts in oopmap
249       }
250 #endif
251 
252       // Check for a legal reg name in the oopMap and bailout if it is not.
253       if (!omap->legal_vm_reg_name(r)) {
254         regalloc->C->record_method_not_compilable("illegal oopMap register name");
255         continue;
256       }
257       if( t->is_ptr()->_offset == 0 ) { // Not derived?
258         if( mcall ) {
259           // Outgoing argument GC mask responsibility belongs to the callee,
260           // not the caller.  Inspect the inputs to the call, to see if
261           // this live-range is one of them.
262           uint cnt = mcall->tf()->domain()->cnt();
263           uint j;
264           for( j = TypeFunc::Parms; j < cnt; j++)
265             if( mcall->in(j) == def )
266               break;            // reaching def is an argument oop
267           if( j < cnt )         // arg oops dont go in GC map
268             continue;           // Continue on to the next register
269         }
270         omap->set_oop(r);
271       } else {                  // Else it's derived.
272         // Find the base of the derived value.
273         uint i;
274         // Fast, common case, scan
275         for( i = jvms->oopoff(); i < n->req(); i+=2 )
276           if( n->in(i) == def ) break; // Common case
277         if( i == n->req() ) {   // Missed, try a more generous scan
278           // Scan again, but this time peek through copies
279           for( i = jvms->oopoff(); i < n->req(); i+=2 ) {
280             Node *m = n->in(i); // Get initial derived value
281             while( 1 ) {
282               Node *d = def;    // Get initial reaching def

308           set_live_bit(live,breg);
309           // Already missed our turn?
310           if( breg < reg ) {
311             omap->set_oop(b);
312           }
313         }
314         omap->set_derived_oop(r, b);
315       }
316 
317     } else if( t->isa_narrowoop() ) {
318       assert( !OptoReg::is_valid(_callees[reg]), "oop can't be callee save" );
319       // Check for a legal reg name in the oopMap and bailout if it is not.
320       if (!omap->legal_vm_reg_name(r)) {
321         regalloc->C->record_method_not_compilable("illegal oopMap register name");
322         continue;
323       }
324       if( mcall ) {
325           // Outgoing argument GC mask responsibility belongs to the callee,
326           // not the caller.  Inspect the inputs to the call, to see if
327           // this live-range is one of them.
328         uint cnt = mcall->tf()->domain()->cnt();
329         uint j;
330         for( j = TypeFunc::Parms; j < cnt; j++)
331           if( mcall->in(j) == def )
332             break;            // reaching def is an argument oop
333         if( j < cnt )         // arg oops dont go in GC map
334           continue;           // Continue on to the next register
335       }
336       omap->set_narrowoop(r);
337     } else if( OptoReg::is_valid(_callees[reg])) { // callee-save?
338       // It's a callee-save value
339       assert( dup_check[_callees[reg]]==0, "trying to callee save same reg twice" );
340       debug_only( dup_check[_callees[reg]]=1; )
341       VMReg callee = OptoReg::as_VMReg(OptoReg::Name(_callees[reg]));
342       omap->set_callee_saved(r, callee);
343 
344     } else {
345       // Other - some reaching non-oop value
346 #ifdef ASSERT
347       if( t->isa_rawptr() && C->cfg()->_raw_oops.member(def) ) {
348         def->dump();

237 
238     // Classify the reaching def as oop, derived, callee-save, dead, or other
239     const Type *t = def->bottom_type();
240     if( t->isa_oop_ptr() ) {    // Oop or derived?
241       assert( !OptoReg::is_valid(_callees[reg]), "oop can't be callee save" );
242 #ifdef _LP64
243       // 64-bit pointers record oop-ishness on 2 aligned adjacent registers.
244       // Make sure both are record from the same reaching def, but do not
245       // put both into the oopmap.
246       if( (reg&1) == 1 ) {      // High half of oop-pair?
247         assert( _defs[reg-1] == _defs[reg], "both halves from same reaching def" );
248         continue;               // Do not record high parts in oopmap
249       }
250 #endif
251 
252       // Check for a legal reg name in the oopMap and bailout if it is not.
253       if (!omap->legal_vm_reg_name(r)) {
254         regalloc->C->record_method_not_compilable("illegal oopMap register name");
255         continue;
256       }
257       if (t->is_ptr()->offset() == 0) { // Not derived?
258         if( mcall ) {
259           // Outgoing argument GC mask responsibility belongs to the callee,
260           // not the caller.  Inspect the inputs to the call, to see if
261           // this live-range is one of them.
262           uint cnt = mcall->tf()->domain_cc()->cnt();
263           uint j;
264           for( j = TypeFunc::Parms; j < cnt; j++)
265             if( mcall->in(j) == def )
266               break;            // reaching def is an argument oop
267           if( j < cnt )         // arg oops dont go in GC map
268             continue;           // Continue on to the next register
269         }
270         omap->set_oop(r);
271       } else {                  // Else it's derived.
272         // Find the base of the derived value.
273         uint i;
274         // Fast, common case, scan
275         for( i = jvms->oopoff(); i < n->req(); i+=2 )
276           if( n->in(i) == def ) break; // Common case
277         if( i == n->req() ) {   // Missed, try a more generous scan
278           // Scan again, but this time peek through copies
279           for( i = jvms->oopoff(); i < n->req(); i+=2 ) {
280             Node *m = n->in(i); // Get initial derived value
281             while( 1 ) {
282               Node *d = def;    // Get initial reaching def

308           set_live_bit(live,breg);
309           // Already missed our turn?
310           if( breg < reg ) {
311             omap->set_oop(b);
312           }
313         }
314         omap->set_derived_oop(r, b);
315       }
316 
317     } else if( t->isa_narrowoop() ) {
318       assert( !OptoReg::is_valid(_callees[reg]), "oop can't be callee save" );
319       // Check for a legal reg name in the oopMap and bailout if it is not.
320       if (!omap->legal_vm_reg_name(r)) {
321         regalloc->C->record_method_not_compilable("illegal oopMap register name");
322         continue;
323       }
324       if( mcall ) {
325           // Outgoing argument GC mask responsibility belongs to the callee,
326           // not the caller.  Inspect the inputs to the call, to see if
327           // this live-range is one of them.
328         uint cnt = mcall->tf()->domain_cc()->cnt();
329         uint j;
330         for( j = TypeFunc::Parms; j < cnt; j++)
331           if( mcall->in(j) == def )
332             break;            // reaching def is an argument oop
333         if( j < cnt )         // arg oops dont go in GC map
334           continue;           // Continue on to the next register
335       }
336       omap->set_narrowoop(r);
337     } else if( OptoReg::is_valid(_callees[reg])) { // callee-save?
338       // It's a callee-save value
339       assert( dup_check[_callees[reg]]==0, "trying to callee save same reg twice" );
340       debug_only( dup_check[_callees[reg]]=1; )
341       VMReg callee = OptoReg::as_VMReg(OptoReg::Name(_callees[reg]));
342       omap->set_callee_saved(r, callee);
343 
344     } else {
345       // Other - some reaching non-oop value
346 #ifdef ASSERT
347       if( t->isa_rawptr() && C->cfg()->_raw_oops.member(def) ) {
348         def->dump();
< prev index next >