src/share/vm/opto/graphKit.cpp

Print this page
rev 3898 : 8005031: Some cleanup in c2 to prepare for incremental inlining support
Summary: collection of small changes to prepare for incremental inlining.
Reviewed-by:


1754     assert(hook_mem == NULL, "");
1755     // This is not a "slow path" call; all memory comes from the call.
1756     set_all_memory_call(call);
1757   }
1758 }
1759 
1760 
1761 // Replace the call with the current state of the kit.
1762 void GraphKit::replace_call(CallNode* call, Node* result) {
1763   JVMState* ejvms = NULL;
1764   if (has_exceptions()) {
1765     ejvms = transfer_exceptions_into_jvms();
1766   }
1767 
1768   SafePointNode* final_state = stop();
1769 
1770   // Find all the needed outputs of this call
1771   CallProjections callprojs;
1772   call->extract_projections(&callprojs, true);
1773 
1774   // Replace all the old call edges with the edges from the inlining result
1775   C->gvn_replace_by(callprojs.fallthrough_catchproj, final_state->in(TypeFunc::Control));
1776   C->gvn_replace_by(callprojs.fallthrough_memproj,   final_state->in(TypeFunc::Memory));
1777   C->gvn_replace_by(callprojs.fallthrough_ioproj,    final_state->in(TypeFunc::I_O));
1778   Node* final_mem = final_state->in(TypeFunc::Memory);













1779 
1780   // Replace the result with the new result if it exists and is used
1781   if (callprojs.resproj != NULL && result != NULL) {
1782     C->gvn_replace_by(callprojs.resproj, result);
1783   }
1784 
1785   if (ejvms == NULL) {
1786     // No exception edges to simply kill off those paths
1787     C->gvn_replace_by(callprojs.catchall_catchproj, C->top());
1788     C->gvn_replace_by(callprojs.catchall_memproj,   C->top());
1789     C->gvn_replace_by(callprojs.catchall_ioproj,    C->top());
1790 
1791     // Replace the old exception object with top
1792     if (callprojs.exobj != NULL) {
1793       C->gvn_replace_by(callprojs.exobj, C->top());
1794     }
1795   } else {
1796     GraphKit ekit(ejvms);
1797 
1798     // Load my combined exception state into the kit, with all phis transformed:




1754     assert(hook_mem == NULL, "");
1755     // This is not a "slow path" call; all memory comes from the call.
1756     set_all_memory_call(call);
1757   }
1758 }
1759 
1760 
1761 // Replace the call with the current state of the kit.
1762 void GraphKit::replace_call(CallNode* call, Node* result) {
1763   JVMState* ejvms = NULL;
1764   if (has_exceptions()) {
1765     ejvms = transfer_exceptions_into_jvms();
1766   }
1767 
1768   SafePointNode* final_state = stop();
1769 
1770   // Find all the needed outputs of this call
1771   CallProjections callprojs;
1772   call->extract_projections(&callprojs, true);
1773 
1774   Node* init_mem = call->in(TypeFunc::Memory);



1775   Node* final_mem = final_state->in(TypeFunc::Memory);
1776   Node* final_ctl = final_state->in(TypeFunc::Control);
1777   Node* final_io = final_state->in(TypeFunc::I_O);
1778   
1779   // Replace all the old call edges with the edges from the inlining result
1780   if (callprojs.fallthrough_catchproj != NULL) {
1781     C->gvn_replace_by(callprojs.fallthrough_catchproj, final_ctl);
1782   }
1783   if (callprojs.fallthrough_memproj != NULL) {
1784     C->gvn_replace_by(callprojs.fallthrough_memproj,   final_mem);
1785   }
1786   if (callprojs.fallthrough_ioproj != NULL) {
1787     C->gvn_replace_by(callprojs.fallthrough_ioproj,    final_io);
1788   }
1789 
1790   // Replace the result with the new result if it exists and is used
1791   if (callprojs.resproj != NULL && result != NULL) {
1792     C->gvn_replace_by(callprojs.resproj, result);
1793   }
1794 
1795   if (ejvms == NULL) {
1796     // No exception edges to simply kill off those paths
1797     C->gvn_replace_by(callprojs.catchall_catchproj, C->top());
1798     C->gvn_replace_by(callprojs.catchall_memproj,   C->top());
1799     C->gvn_replace_by(callprojs.catchall_ioproj,    C->top());
1800 
1801     // Replace the old exception object with top
1802     if (callprojs.exobj != NULL) {
1803       C->gvn_replace_by(callprojs.exobj, C->top());
1804     }
1805   } else {
1806     GraphKit ekit(ejvms);
1807 
1808     // Load my combined exception state into the kit, with all phis transformed: