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