395 396 // Combine the Live Range Indices for these 2 Nodes into a single live 397 // range. Future requests for any Node in either live range will 398 // return the live range index for the combined live range. 399 void Union( const Node *src, const Node *dst ); 400 401 void new_lrg( const Node *x, uint lrg ); 402 403 // Compact live ranges, removing unused ones. Return new maxlrg. 404 void compact(); 405 406 uint _lo_degree; // Head of lo-degree LRGs list 407 uint _lo_stk_degree; // Head of lo-stk-degree LRGs list 408 uint _hi_degree; // Head of hi-degree LRGs list 409 uint _simplified; // Linked list head of simplified LRGs 410 411 // Helper functions for Split() 412 uint split_DEF( Node *def, Block *b, int loc, uint max, Node **Reachblock, Node **debug_defs, GrowableArray<uint> splits, int slidx ); 413 uint split_USE( Node *def, Block *b, Node *use, uint useidx, uint max, bool def_down, bool cisc_sp, GrowableArray<uint> splits, int slidx ); 414 415 bool clone_projs(Block *b, uint idx, Node *con, Node *copy, LiveRangeMap &lrg_map) { 416 bool found_projs = clone_projs_shared(b, idx, con, copy, lrg_map.max_lrg_id()); 417 418 if(found_projs) { 419 uint max_lrg_id = lrg_map.max_lrg_id(); 420 lrg_map.set_max_lrg_id(max_lrg_id + 1); 421 } 422 423 return found_projs; 424 } 425 426 //------------------------------clone_projs------------------------------------ 427 // After cloning some rematerialized instruction, clone any MachProj's that 428 // follow it. Example: Intel zero is XOR, kills flags. Sparc FP constants 429 // use G3 as an address temp. 430 bool clone_projs(Block *b, uint idx, Node *con, Node *copy, uint &max_lrg_id) { 431 bool found_projs = clone_projs_shared(b, idx, con, copy, max_lrg_id); 432 433 if(found_projs) { 434 max_lrg_id++; 435 } 436 437 return found_projs; 438 } 439 440 bool clone_projs_shared(Block *b, uint idx, Node *con, Node *copy, uint max_lrg_id); 441 442 Node *split_Rematerialize(Node *def, Block *b, uint insidx, uint &maxlrg, GrowableArray<uint> splits, 443 int slidx, uint *lrg2reach, Node **Reachblock, bool walkThru); 444 // True if lidx is used before any real register is def'd in the block 445 bool prompt_use( Block *b, uint lidx ); 446 Node *get_spillcopy_wide( Node *def, Node *use, uint uidx ); 447 // Insert the spill at chosen location. Skip over any intervening Proj's or 448 // Phis. Skip over a CatchNode and projs, inserting in the fall-through block 449 // instead. Update high-pressure indices. Create a new live range. 450 void insert_proj( Block *b, uint i, Node *spill, uint maxlrg ); 451 452 bool is_high_pressure( Block *b, LRG *lrg, uint insidx ); 453 454 uint _oldphi; // Node index which separates pre-allocation nodes 455 456 Block **_blks; // Array of blocks sorted by frequency for coalescing 457 458 float _high_frequency_lrg; // Frequency at which LRG will be spilled for debug info 459 460 #ifndef PRODUCT | 395 396 // Combine the Live Range Indices for these 2 Nodes into a single live 397 // range. Future requests for any Node in either live range will 398 // return the live range index for the combined live range. 399 void Union( const Node *src, const Node *dst ); 400 401 void new_lrg( const Node *x, uint lrg ); 402 403 // Compact live ranges, removing unused ones. Return new maxlrg. 404 void compact(); 405 406 uint _lo_degree; // Head of lo-degree LRGs list 407 uint _lo_stk_degree; // Head of lo-stk-degree LRGs list 408 uint _hi_degree; // Head of hi-degree LRGs list 409 uint _simplified; // Linked list head of simplified LRGs 410 411 // Helper functions for Split() 412 uint split_DEF( Node *def, Block *b, int loc, uint max, Node **Reachblock, Node **debug_defs, GrowableArray<uint> splits, int slidx ); 413 uint split_USE( Node *def, Block *b, Node *use, uint useidx, uint max, bool def_down, bool cisc_sp, GrowableArray<uint> splits, int slidx ); 414 415 int clone_projs(Block *b, uint idx, Node *orig, Node *copy, LiveRangeMap &lrg_map) { 416 uint max_lrg_id = lrg_map.max_lrg_id(); 417 int found_projs = clone_projs(b, idx, orig, copy, max_lrg_id); 418 if (found_projs > 0) { 419 // max_lrg_id is updated during call above 420 lrg_map.set_max_lrg_id(max_lrg_id); 421 } 422 return found_projs; 423 } 424 425 //------------------------------clone_projs------------------------------------ 426 // After cloning some rematerialized instruction, clone any MachProj's that 427 // follow it. Example: Intel zero is XOR, kills flags. Sparc FP constants 428 // use G3 as an address temp. 429 int clone_projs(Block *b, uint idx, Node *orig, Node *copy, uint &max_lrg_id); 430 431 Node *split_Rematerialize(Node *def, Block *b, uint insidx, uint &maxlrg, GrowableArray<uint> splits, 432 int slidx, uint *lrg2reach, Node **Reachblock, bool walkThru); 433 // True if lidx is used before any real register is def'd in the block 434 bool prompt_use( Block *b, uint lidx ); 435 Node *get_spillcopy_wide( Node *def, Node *use, uint uidx ); 436 // Insert the spill at chosen location. Skip over any intervening Proj's or 437 // Phis. Skip over a CatchNode and projs, inserting in the fall-through block 438 // instead. Update high-pressure indices. Create a new live range. 439 void insert_proj( Block *b, uint i, Node *spill, uint maxlrg ); 440 441 bool is_high_pressure( Block *b, LRG *lrg, uint insidx ); 442 443 uint _oldphi; // Node index which separates pre-allocation nodes 444 445 Block **_blks; // Array of blocks sorted by frequency for coalescing 446 447 float _high_frequency_lrg; // Frequency at which LRG will be spilled for debug info 448 449 #ifndef PRODUCT |