< prev index next >

src/hotspot/cpu/ppc/ppc.ad

Print this page

 1525   if (ConstantsALot) {
 1526     const int num_consts = const_size();
 1527     for (int i = 0; i < num_consts; i++) {
 1528       __ long_constant(0xB0B5B00BBABE);
 1529     }
 1530   }
 1531 #endif
 1532   if (!method_is_frameless) {
 1533     // Save return pc.
 1534     __ std(return_pc, _abi0(lr), callers_sp);
 1535   }
 1536 
 1537   if (C->stub_function() == nullptr) {
 1538     BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
 1539     bs->nmethod_entry_barrier(masm, push_frame_temp);
 1540   }
 1541 
 1542   C->output()->set_frame_complete(__ offset());
 1543 }
 1544 
 1545 uint MachPrologNode::size(PhaseRegAlloc *ra_) const {
 1546   // Variable size. determine dynamically.
 1547   return MachNode::size(ra_);
 1548 }
 1549 
 1550 int MachPrologNode::reloc() const {
 1551   // Return number of relocatable values contained in this instruction.
 1552   return 1; // 1 reloc entry for load_const(toc).
 1553 }
 1554 
 1555 //=============================================================================
 1556 
 1557 #ifndef PRODUCT
 1558 void MachEpilogNode::format(PhaseRegAlloc *ra_, outputStream *st) const {
 1559   Compile* C = ra_->C;
 1560 
 1561   st->print("EPILOG\n\t");
 1562   st->print("restore return pc\n\t");
 1563   st->print("pop frame\n\t");
 1564 
 1565   if (do_polling() && C->is_method_compilation()) {
 1566     st->print("safepoint poll\n\t");
 1567   }
 1568 }
 1569 #endif

 1588     __ addi(R1_SP, R1_SP, (int)framesize);
 1589   }
 1590 
 1591   if (StackReservedPages > 0 && C->has_reserved_stack_access()) {
 1592     __ reserved_stack_check(return_pc);
 1593   }
 1594 
 1595   if (method_needs_polling) {
 1596     Label dummy_label;
 1597     Label* code_stub = &dummy_label;
 1598     if (!UseSIGTRAP && !C->output()->in_scratch_emit_size()) {
 1599       C2SafepointPollStub* stub = new (C->comp_arena()) C2SafepointPollStub(__ offset());
 1600       C->output()->add_stub(stub);
 1601       code_stub = &stub->entry();
 1602       __ relocate(relocInfo::poll_return_type);
 1603     }
 1604     __ safepoint_poll(*code_stub, temp, true /* at_return */, true /* in_nmethod */);
 1605   }
 1606 }
 1607 
 1608 uint MachEpilogNode::size(PhaseRegAlloc *ra_) const {
 1609   // Variable size. Determine dynamically.
 1610   return MachNode::size(ra_);
 1611 }
 1612 
 1613 int MachEpilogNode::reloc() const {
 1614   // Return number of relocatable values contained in this instruction.
 1615   return 1; // 1 for load_from_polling_page.
 1616 }
 1617 
 1618 const Pipeline * MachEpilogNode::pipeline() const {
 1619   return MachNode::pipeline_class();
 1620 }
 1621 
 1622 // =============================================================================
 1623 
 1624 // Figure out which register class each belongs in: rc_int, rc_float, rc_vec or
 1625 // rc_stack.
 1626 enum RC { rc_bad, rc_int, rc_float, rc_vec, rc_stack };
 1627 
 1628 static enum RC rc_class(OptoReg::Name reg) {
 1629   // Return the register class for the given register. The given register
 1630   // reg is a <register>_num value, which is an index into the MachRegisterNumbers
 1631   // enumeration in adGlobals_ppc.hpp.
 1632 

 1942   st->print("ADDI    %s, SP, %d \t// box node", reg_str, offset);
 1943 }
 1944 #endif
 1945 
 1946 void BoxLockNode::emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const {
 1947   int offset = ra_->reg2offset(in_RegMask(0).find_first_elem());
 1948   int reg    = ra_->get_encode(this);
 1949 
 1950   if (Assembler::is_simm(offset, 16)) {
 1951     __ addi(as_Register(reg), R1, offset);
 1952   } else {
 1953     ShouldNotReachHere();
 1954   }
 1955 }
 1956 
 1957 uint BoxLockNode::size(PhaseRegAlloc *ra_) const {
 1958   // BoxLockNode is not a MachNode, so we can't just call MachNode::size(ra_).
 1959   return 4;
 1960 }
 1961 












 1962 #ifndef PRODUCT
 1963 void MachUEPNode::format(PhaseRegAlloc *ra_, outputStream *st) const {
 1964   st->print_cr("---- MachUEPNode ----");
 1965   st->print_cr("...");
 1966 }
 1967 #endif
 1968 
 1969 void MachUEPNode::emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const {
 1970   // This is the unverified entry point.
 1971   __ ic_check(CodeEntryAlignment);
 1972   // Argument is valid and klass is as expected, continue.
 1973 }
 1974 
 1975 uint MachUEPNode::size(PhaseRegAlloc *ra_) const {
 1976   // Variable size. Determine dynamically.
 1977   return MachNode::size(ra_);
 1978 }
 1979 
 1980 //=============================================================================
 1981 
 1982 %} // interrupt source
 1983 
 1984 source_hpp %{ // Header information of the source block.
 1985 
 1986 class HandlerImpl {
 1987 
 1988  public:
 1989 
 1990   static int emit_deopt_handler(C2_MacroAssembler* masm);
 1991 
 1992   static uint size_deopt_handler() {
 1993     // The deopt_handler is a bl64_patchable.
 1994     return MacroAssembler::bl64_patchable_size + BytesPerInstWord;
 1995   }
 1996 
 1997 };
 1998 
 1999 class Node::PD {

 1525   if (ConstantsALot) {
 1526     const int num_consts = const_size();
 1527     for (int i = 0; i < num_consts; i++) {
 1528       __ long_constant(0xB0B5B00BBABE);
 1529     }
 1530   }
 1531 #endif
 1532   if (!method_is_frameless) {
 1533     // Save return pc.
 1534     __ std(return_pc, _abi0(lr), callers_sp);
 1535   }
 1536 
 1537   if (C->stub_function() == nullptr) {
 1538     BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
 1539     bs->nmethod_entry_barrier(masm, push_frame_temp);
 1540   }
 1541 
 1542   C->output()->set_frame_complete(__ offset());
 1543 }
 1544 





 1545 int MachPrologNode::reloc() const {
 1546   // Return number of relocatable values contained in this instruction.
 1547   return 1; // 1 reloc entry for load_const(toc).
 1548 }
 1549 
 1550 //=============================================================================
 1551 
 1552 #ifndef PRODUCT
 1553 void MachEpilogNode::format(PhaseRegAlloc *ra_, outputStream *st) const {
 1554   Compile* C = ra_->C;
 1555 
 1556   st->print("EPILOG\n\t");
 1557   st->print("restore return pc\n\t");
 1558   st->print("pop frame\n\t");
 1559 
 1560   if (do_polling() && C->is_method_compilation()) {
 1561     st->print("safepoint poll\n\t");
 1562   }
 1563 }
 1564 #endif

 1583     __ addi(R1_SP, R1_SP, (int)framesize);
 1584   }
 1585 
 1586   if (StackReservedPages > 0 && C->has_reserved_stack_access()) {
 1587     __ reserved_stack_check(return_pc);
 1588   }
 1589 
 1590   if (method_needs_polling) {
 1591     Label dummy_label;
 1592     Label* code_stub = &dummy_label;
 1593     if (!UseSIGTRAP && !C->output()->in_scratch_emit_size()) {
 1594       C2SafepointPollStub* stub = new (C->comp_arena()) C2SafepointPollStub(__ offset());
 1595       C->output()->add_stub(stub);
 1596       code_stub = &stub->entry();
 1597       __ relocate(relocInfo::poll_return_type);
 1598     }
 1599     __ safepoint_poll(*code_stub, temp, true /* at_return */, true /* in_nmethod */);
 1600   }
 1601 }
 1602 





 1603 int MachEpilogNode::reloc() const {
 1604   // Return number of relocatable values contained in this instruction.
 1605   return 1; // 1 for load_from_polling_page.
 1606 }
 1607 
 1608 const Pipeline * MachEpilogNode::pipeline() const {
 1609   return MachNode::pipeline_class();
 1610 }
 1611 
 1612 // =============================================================================
 1613 
 1614 // Figure out which register class each belongs in: rc_int, rc_float, rc_vec or
 1615 // rc_stack.
 1616 enum RC { rc_bad, rc_int, rc_float, rc_vec, rc_stack };
 1617 
 1618 static enum RC rc_class(OptoReg::Name reg) {
 1619   // Return the register class for the given register. The given register
 1620   // reg is a <register>_num value, which is an index into the MachRegisterNumbers
 1621   // enumeration in adGlobals_ppc.hpp.
 1622 

 1932   st->print("ADDI    %s, SP, %d \t// box node", reg_str, offset);
 1933 }
 1934 #endif
 1935 
 1936 void BoxLockNode::emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const {
 1937   int offset = ra_->reg2offset(in_RegMask(0).find_first_elem());
 1938   int reg    = ra_->get_encode(this);
 1939 
 1940   if (Assembler::is_simm(offset, 16)) {
 1941     __ addi(as_Register(reg), R1, offset);
 1942   } else {
 1943     ShouldNotReachHere();
 1944   }
 1945 }
 1946 
 1947 uint BoxLockNode::size(PhaseRegAlloc *ra_) const {
 1948   // BoxLockNode is not a MachNode, so we can't just call MachNode::size(ra_).
 1949   return 4;
 1950 }
 1951 
 1952 #ifndef PRODUCT
 1953 void MachVEPNode::format(PhaseRegAlloc* ra_, outputStream* st) const
 1954 {
 1955   Unimplemented();
 1956 }
 1957 #endif
 1958 
 1959 void MachVEPNode::emit(C2_MacroAssembler *masm, PhaseRegAlloc* ra_) const
 1960 {
 1961   Unimplemented();
 1962 }
 1963 
 1964 #ifndef PRODUCT
 1965 void MachUEPNode::format(PhaseRegAlloc *ra_, outputStream *st) const {
 1966   st->print_cr("---- MachUEPNode ----");
 1967   st->print_cr("...");
 1968 }
 1969 #endif
 1970 
 1971 void MachUEPNode::emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const {
 1972   // This is the unverified entry point.
 1973   __ ic_check(CodeEntryAlignment);
 1974   // Argument is valid and klass is as expected, continue.
 1975 }
 1976 





 1977 //=============================================================================
 1978 
 1979 %} // interrupt source
 1980 
 1981 source_hpp %{ // Header information of the source block.
 1982 
 1983 class HandlerImpl {
 1984 
 1985  public:
 1986 
 1987   static int emit_deopt_handler(C2_MacroAssembler* masm);
 1988 
 1989   static uint size_deopt_handler() {
 1990     // The deopt_handler is a bl64_patchable.
 1991     return MacroAssembler::bl64_patchable_size + BytesPerInstWord;
 1992   }
 1993 
 1994 };
 1995 
 1996 class Node::PD {
< prev index next >