src/share/vm/c1/c1_CodeStubs.hpp

Print this page




   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 










  25 class CodeEmitInfo;
  26 class LIR_Assembler;
  27 class LIR_OpVisitState;
  28 
  29 // CodeStubs are little 'out-of-line' pieces of code that
  30 // usually handle slow cases of operations. All code stubs
  31 // are collected and code is emitted at the end of the
  32 // nmethod.
  33 
  34 class CodeStub: public CompilationResourceObj {
  35  protected:
  36   Label _entry;                                  // label at the stub entry point
  37   Label _continuation;                           // label where stub continues, if any
  38 
  39  public:
  40   CodeStub() {}
  41 
  42   // code generation
  43   void assert_no_unbound_labels()                { assert(!_entry.is_unbound() && !_continuation.is_unbound(), "unbound label"); }
  44   virtual void emit_code(LIR_Assembler* e) = 0;


 569   // addr (the address of the object head) and new_val must be registers.
 570   G1PostBarrierStub(LIR_Opr addr, LIR_Opr new_val): _addr(addr), _new_val(new_val) { }
 571 
 572   LIR_Opr addr() const { return _addr; }
 573   LIR_Opr new_val() const { return _new_val; }
 574 
 575   virtual void emit_code(LIR_Assembler* e);
 576   virtual void visit(LIR_OpVisitState* visitor) {
 577     // don't pass in the code emit info since it's processed in the fast path
 578     visitor->do_slow_case();
 579     visitor->do_input(_addr);
 580     visitor->do_input(_new_val);
 581   }
 582 #ifndef PRODUCT
 583   virtual void print_name(outputStream* out) const { out->print("G1PostBarrierStub"); }
 584 #endif // PRODUCT
 585 };
 586 
 587 #endif // SERIALGC
 588 //////////////////////////////////////////////////////////////////////////////////////////




   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_C1_C1_CODESTUBS_HPP
  26 #define SHARE_VM_C1_C1_CODESTUBS_HPP
  27 
  28 #include "c1/c1_FrameMap.hpp"
  29 #include "c1/c1_IR.hpp"
  30 #include "c1/c1_Instruction.hpp"
  31 #include "c1/c1_LIR.hpp"
  32 #include "c1/c1_Runtime1.hpp"
  33 #include "utilities/array.hpp"
  34 
  35 class CodeEmitInfo;
  36 class LIR_Assembler;
  37 class LIR_OpVisitState;
  38 
  39 // CodeStubs are little 'out-of-line' pieces of code that
  40 // usually handle slow cases of operations. All code stubs
  41 // are collected and code is emitted at the end of the
  42 // nmethod.
  43 
  44 class CodeStub: public CompilationResourceObj {
  45  protected:
  46   Label _entry;                                  // label at the stub entry point
  47   Label _continuation;                           // label where stub continues, if any
  48 
  49  public:
  50   CodeStub() {}
  51 
  52   // code generation
  53   void assert_no_unbound_labels()                { assert(!_entry.is_unbound() && !_continuation.is_unbound(), "unbound label"); }
  54   virtual void emit_code(LIR_Assembler* e) = 0;


 579   // addr (the address of the object head) and new_val must be registers.
 580   G1PostBarrierStub(LIR_Opr addr, LIR_Opr new_val): _addr(addr), _new_val(new_val) { }
 581 
 582   LIR_Opr addr() const { return _addr; }
 583   LIR_Opr new_val() const { return _new_val; }
 584 
 585   virtual void emit_code(LIR_Assembler* e);
 586   virtual void visit(LIR_OpVisitState* visitor) {
 587     // don't pass in the code emit info since it's processed in the fast path
 588     visitor->do_slow_case();
 589     visitor->do_input(_addr);
 590     visitor->do_input(_new_val);
 591   }
 592 #ifndef PRODUCT
 593   virtual void print_name(outputStream* out) const { out->print("G1PostBarrierStub"); }
 594 #endif // PRODUCT
 595 };
 596 
 597 #endif // SERIALGC
 598 //////////////////////////////////////////////////////////////////////////////////////////
 599 
 600 #endif // SHARE_VM_C1_C1_CODESTUBS_HPP