comparison src/share/vm/opto/machnode.cpp @ 18041:52b4284cb496

Merge with jdk8u20-b26
author Gilles Duboscq <duboscq@ssw.jku.at>
date Wed, 15 Oct 2014 16:02:50 +0200
parents 4ca6dc0799b6
children 7848fc12602b
comparison
equal deleted inserted replaced
17606:45d7b2c7029d 18041:52b4284cb496
131 tty->print("missing MachNode emit function: "); 131 tty->print("missing MachNode emit function: ");
132 dump(); 132 dump();
133 #endif 133 #endif
134 ShouldNotCallThis(); 134 ShouldNotCallThis();
135 } 135 }
136
137 //---------------------------postalloc_expand----------------------------------
138 // Expand node after register allocation.
139 void MachNode::postalloc_expand(GrowableArray <Node *> *nodes, PhaseRegAlloc *ra_) {}
136 140
137 //------------------------------size------------------------------------------- 141 //------------------------------size-------------------------------------------
138 // Size of instruction in bytes 142 // Size of instruction in bytes
139 uint MachNode::size(PhaseRegAlloc *ra_) const { 143 uint MachNode::size(PhaseRegAlloc *ra_) const {
140 // If a virtual was not defined for this specific instruction, 144 // If a virtual was not defined for this specific instruction,
391 skipped += num_edges; 395 skipped += num_edges;
392 } 396 }
393 return skipped; 397 return skipped;
394 } 398 }
395 399
400 int MachNode::operand_index(const MachOper *oper) const {
401 uint skipped = oper_input_base(); // Sum of leaves skipped so far
402 uint opcnt;
403 for (opcnt = 1; opcnt < num_opnds(); opcnt++) {
404 if (_opnds[opcnt] == oper) break;
405 uint num_edges = _opnds[opcnt]->num_edges(); // leaves for operand
406 skipped += num_edges;
407 }
408 if (_opnds[opcnt] != oper) return -1;
409 return skipped;
410 }
396 411
397 //------------------------------peephole--------------------------------------- 412 //------------------------------peephole---------------------------------------
398 // Apply peephole rule(s) to this instruction 413 // Apply peephole rule(s) to this instruction
399 MachNode *MachNode::peephole( Block *block, int block_index, PhaseRegAlloc *ra_, int &deleted, Compile* C ) { 414 MachNode *MachNode::peephole( Block *block, int block_index, PhaseRegAlloc *ra_, int &deleted, Compile* C ) {
400 return NULL; 415 return NULL;
499 _constant.set_offset(constant_table.table_base_offset() + offset); 514 _constant.set_offset(constant_table.table_base_offset() + offset);
500 } 515 }
501 return _constant.offset(); 516 return _constant.offset();
502 } 517 }
503 518
519 int MachConstantNode::constant_offset_unchecked() const {
520 return _constant.offset();
521 }
504 522
505 //============================================================================= 523 //=============================================================================
506 #ifndef PRODUCT 524 #ifndef PRODUCT
507 void MachNullCheckNode::format( PhaseRegAlloc *ra_, outputStream *st ) const { 525 void MachNullCheckNode::format( PhaseRegAlloc *ra_, outputStream *st ) const {
508 int reg = ra_->get_reg_first(in(1)->in(_vidx)); 526 int reg = ra_->get_reg_first(in(1)->in(_vidx));
639 return false; 657 return false;
640 } 658 }
641 659
642 660
643 //------------------------------Registers-------------------------------------- 661 //------------------------------Registers--------------------------------------
644 const RegMask &MachCallNode::in_RegMask( uint idx ) const { 662 const RegMask &MachCallNode::in_RegMask(uint idx) const {
645 // Values in the domain use the users calling convention, embodied in the 663 // Values in the domain use the users calling convention, embodied in the
646 // _in_rms array of RegMasks. 664 // _in_rms array of RegMasks.
647 if (idx < tf()->domain()->cnt()) return _in_rms[idx]; 665 if (idx < tf()->domain()->cnt()) {
666 return _in_rms[idx];
667 }
668 if (idx == mach_constant_base_node_input()) {
669 return MachConstantBaseNode::static_out_RegMask();
670 }
648 // Values outside the domain represent debug info 671 // Values outside the domain represent debug info
649 return *Compile::current()->matcher()->idealreg2debugmask[in(idx)->ideal_reg()]; 672 return *Compile::current()->matcher()->idealreg2debugmask[in(idx)->ideal_reg()];
650 } 673 }
651 674
652 //============================================================================= 675 //=============================================================================
669 692
670 //------------------------------Registers-------------------------------------- 693 //------------------------------Registers--------------------------------------
671 const RegMask &MachCallJavaNode::in_RegMask(uint idx) const { 694 const RegMask &MachCallJavaNode::in_RegMask(uint idx) const {
672 // Values in the domain use the users calling convention, embodied in the 695 // Values in the domain use the users calling convention, embodied in the
673 // _in_rms array of RegMasks. 696 // _in_rms array of RegMasks.
674 if (idx < tf()->domain()->cnt()) return _in_rms[idx]; 697 if (idx < tf()->domain()->cnt()) {
698 return _in_rms[idx];
699 }
700 if (idx == mach_constant_base_node_input()) {
701 return MachConstantBaseNode::static_out_RegMask();
702 }
675 // Values outside the domain represent debug info 703 // Values outside the domain represent debug info
676 Matcher* m = Compile::current()->matcher(); 704 Matcher* m = Compile::current()->matcher();
677 // If this call is a MethodHandle invoke we have to use a different 705 // If this call is a MethodHandle invoke we have to use a different
678 // debugmask which does not include the register we use to save the 706 // debugmask which does not include the register we use to save the
679 // SP over MH invokes. 707 // SP over MH invokes.