< prev index next >

src/hotspot/share/opto/buildOopMap.cpp

Print this page

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

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

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

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