< prev index next >

src/hotspot/share/opto/buildOopMap.cpp

Print this page

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         stringStream ss;
255         ss.print("illegal oopMap register name: ");
256         r->print_on(&ss);
257         assert(false, "%s", ss.as_string());
258         regalloc->C->record_method_not_compilable(ss.as_string());
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           }
317         }
318         omap->set_derived_oop(r, b);
319       }
320 
321     } else if( t->isa_narrowoop() ) {
322       assert( !OptoReg::is_valid(_callees[reg]), "oop can't be callee save" );
323       // Check for a legal reg name in the oopMap and bailout if it is not.
324       if (!omap->legal_vm_reg_name(r)) {
325         stringStream ss;
326         ss.print("illegal oopMap register name: ");
327         r->print_on(&ss);
328         assert(false, "%s", ss.as_string());
329         regalloc->C->record_method_not_compilable(ss.as_string());
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       omap->set_callee_saved(r, callee);
351 
352     } else {
353       // Other - some reaching non-oop value
354 #ifdef ASSERT
355       if (t->isa_rawptr()) {
356         ResourceMark rm;

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         stringStream ss;
255         ss.print("illegal oopMap register name: ");
256         r->print_on(&ss);
257         assert(false, "%s", ss.as_string());
258         regalloc->C->record_method_not_compilable(ss.as_string());
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           }
317         }
318         omap->set_derived_oop(r, b);
319       }
320 
321     } else if( t->isa_narrowoop() ) {
322       assert( !OptoReg::is_valid(_callees[reg]), "oop can't be callee save" );
323       // Check for a legal reg name in the oopMap and bailout if it is not.
324       if (!omap->legal_vm_reg_name(r)) {
325         stringStream ss;
326         ss.print("illegal oopMap register name: ");
327         r->print_on(&ss);
328         assert(false, "%s", ss.as_string());
329         regalloc->C->record_method_not_compilable(ss.as_string());
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       omap->set_callee_saved(r, callee);
351 
352     } else {
353       // Other - some reaching non-oop value
354 #ifdef ASSERT
355       if (t->isa_rawptr()) {
356         ResourceMark rm;
< prev index next >