Mercurial > hg > graal-jvmci-8
comparison src/share/vm/opto/regmask.cpp @ 7636:a7114d3d712e
8005055: pass outputStream to more opto debug routines
Summary: pass the output stream to node->dump() and everything reachable from there
Reviewed-by: kvn
Contributed-by: goetz.lindenmaier@sap.com
author | kvn |
---|---|
date | Tue, 22 Jan 2013 11:31:25 -0800 |
parents | 8c92982cbbc4 |
children | 2c673161698a |
comparison
equal
deleted
inserted
replaced
7619:46e60405583b | 7636:a7114d3d712e |
---|---|
106 } | 106 } |
107 | 107 |
108 //------------------------------dump------------------------------------------- | 108 //------------------------------dump------------------------------------------- |
109 | 109 |
110 #ifndef PRODUCT | 110 #ifndef PRODUCT |
111 void OptoReg::dump( int r ) { | 111 void OptoReg::dump(int r, outputStream *st) { |
112 switch( r ) { | 112 switch (r) { |
113 case Special: tty->print("r---"); break; | 113 case Special: st->print("r---"); break; |
114 case Bad: tty->print("rBAD"); break; | 114 case Bad: st->print("rBAD"); break; |
115 default: | 115 default: |
116 if( r < _last_Mach_Reg ) tty->print(Matcher::regName[r]); | 116 if (r < _last_Mach_Reg) st->print(Matcher::regName[r]); |
117 else tty->print("rS%d",r); | 117 else st->print("rS%d",r); |
118 break; | 118 break; |
119 } | 119 } |
120 } | 120 } |
121 #endif | 121 #endif |
122 | 122 |
402 return sum; | 402 return sum; |
403 } | 403 } |
404 | 404 |
405 #ifndef PRODUCT | 405 #ifndef PRODUCT |
406 //------------------------------print------------------------------------------ | 406 //------------------------------print------------------------------------------ |
407 void RegMask::dump( ) const { | 407 void RegMask::dump(outputStream *st) const { |
408 tty->print("["); | 408 st->print("["); |
409 RegMask rm = *this; // Structure copy into local temp | 409 RegMask rm = *this; // Structure copy into local temp |
410 | 410 |
411 OptoReg::Name start = rm.find_first_elem(); // Get a register | 411 OptoReg::Name start = rm.find_first_elem(); // Get a register |
412 if( OptoReg::is_valid(start) ) { // Check for empty mask | 412 if (OptoReg::is_valid(start)) { // Check for empty mask |
413 rm.Remove(start); // Yank from mask | 413 rm.Remove(start); // Yank from mask |
414 OptoReg::dump(start); // Print register | 414 OptoReg::dump(start, st); // Print register |
415 OptoReg::Name last = start; | 415 OptoReg::Name last = start; |
416 | 416 |
417 // Now I have printed an initial register. | 417 // Now I have printed an initial register. |
418 // Print adjacent registers as "rX-rZ" instead of "rX,rY,rZ". | 418 // Print adjacent registers as "rX-rZ" instead of "rX,rY,rZ". |
419 // Begin looping over the remaining registers. | 419 // Begin looping over the remaining registers. |
420 while( 1 ) { // | 420 while (1) { // |
421 OptoReg::Name reg = rm.find_first_elem(); // Get a register | 421 OptoReg::Name reg = rm.find_first_elem(); // Get a register |
422 if( !OptoReg::is_valid(reg) ) | 422 if (!OptoReg::is_valid(reg)) |
423 break; // Empty mask, end loop | 423 break; // Empty mask, end loop |
424 rm.Remove(reg); // Yank from mask | 424 rm.Remove(reg); // Yank from mask |
425 | 425 |
426 if( last+1 == reg ) { // See if they are adjacent | 426 if (last+1 == reg) { // See if they are adjacent |
427 // Adjacent registers just collect into long runs, no printing. | 427 // Adjacent registers just collect into long runs, no printing. |
428 last = reg; | 428 last = reg; |
429 } else { // Ending some kind of run | 429 } else { // Ending some kind of run |
430 if( start == last ) { // 1-register run; no special printing | 430 if (start == last) { // 1-register run; no special printing |
431 } else if( start+1 == last ) { | 431 } else if (start+1 == last) { |
432 tty->print(","); // 2-register run; print as "rX,rY" | 432 st->print(","); // 2-register run; print as "rX,rY" |
433 OptoReg::dump(last); | 433 OptoReg::dump(last, st); |
434 } else { // Multi-register run; print as "rX-rZ" | 434 } else { // Multi-register run; print as "rX-rZ" |
435 tty->print("-"); | 435 st->print("-"); |
436 OptoReg::dump(last); | 436 OptoReg::dump(last, st); |
437 } | 437 } |
438 tty->print(","); // Seperate start of new run | 438 st->print(","); // Seperate start of new run |
439 start = last = reg; // Start a new register run | 439 start = last = reg; // Start a new register run |
440 OptoReg::dump(start); // Print register | 440 OptoReg::dump(start, st); // Print register |
441 } // End of if ending a register run or not | 441 } // End of if ending a register run or not |
442 } // End of while regmask not empty | 442 } // End of while regmask not empty |
443 | 443 |
444 if( start == last ) { // 1-register run; no special printing | 444 if (start == last) { // 1-register run; no special printing |
445 } else if( start+1 == last ) { | 445 } else if (start+1 == last) { |
446 tty->print(","); // 2-register run; print as "rX,rY" | 446 st->print(","); // 2-register run; print as "rX,rY" |
447 OptoReg::dump(last); | 447 OptoReg::dump(last, st); |
448 } else { // Multi-register run; print as "rX-rZ" | 448 } else { // Multi-register run; print as "rX-rZ" |
449 tty->print("-"); | 449 st->print("-"); |
450 OptoReg::dump(last); | 450 OptoReg::dump(last, st); |
451 } | 451 } |
452 if( rm.is_AllStack() ) tty->print("..."); | 452 if (rm.is_AllStack()) st->print("..."); |
453 } | 453 } |
454 tty->print("]"); | 454 st->print("]"); |
455 } | 455 } |
456 #endif | 456 #endif |