< prev index next >

src/hotspot/share/opto/output.hpp

Print this page
*** 27,10 ***
--- 27,11 ---
  
  #include "code/debugInfo.hpp"
  #include "code/exceptionHandlerTable.hpp"
  #include "metaprogramming/enableIf.hpp"
  #include "opto/ad.hpp"
+ #include "opto/c2_CodeStubs.hpp"
  #include "opto/constantTable.hpp"
  #include "opto/phase.hpp"
  #include "runtime/vm_version.hpp"
  #include "utilities/globalDefinitions.hpp"
  #include "utilities/macros.hpp"

*** 70,60 ***
      _const(0),
      _reloc(0)
    { };
  };
  
- class C2SafepointPollStubTable {
- private:
-   struct C2SafepointPollStub: public ResourceObj {
-     uintptr_t _safepoint_offset;
-     Label     _stub_label;
-     Label     _trampoline_label;
-     C2SafepointPollStub(uintptr_t safepoint_offset) :
-       _safepoint_offset(safepoint_offset),
-       _stub_label(),
-       _trampoline_label() {}
-   };
- 
-   GrowableArray<C2SafepointPollStub*> _safepoints;
- 
-   static volatile int _stub_size;
- 
-   void emit_stub_impl(MacroAssembler& masm, C2SafepointPollStub* entry) const;
- 
-   // The selection logic below relieves the need to add dummy files to unsupported platforms.
-   template <bool enabled>
-   typename EnableIf<enabled>::type
-   select_emit_stub(MacroAssembler& masm, C2SafepointPollStub* entry) const {
-     emit_stub_impl(masm, entry);
-   }
- 
-   template <bool enabled>
-   typename EnableIf<!enabled>::type
-   select_emit_stub(MacroAssembler& masm, C2SafepointPollStub* entry) const {}
- 
-   void emit_stub(MacroAssembler& masm, C2SafepointPollStub* entry) const {
-     select_emit_stub<VM_Version::supports_stack_watermark_barrier()>(masm, entry);
-   }
- 
-   int stub_size_lazy() const;
- 
- public:
-   Label& add_safepoint(uintptr_t safepoint_offset);
-   int estimate_stub_size() const;
-   void emit(CodeBuffer& cb);
- };
- 
  class PhaseOutput : public Phase {
  private:
    // Instruction bits passed off to the VM
    int                    _method_size;           // Size of nmethod code segment in bytes
    CodeBuffer             _code_buffer;           // Where the code is assembled
    int                    _first_block_size;      // Size of unvalidated entry point code / OSR poison code
    ExceptionHandlerTable  _handler_table;         // Table of native-code exception handlers
    ImplicitExceptionTable _inc_table;             // Table of implicit null checks in native code
!   C2SafepointPollStubTable _safepoint_poll_table;// Table for safepoint polls
    OopMapSet*             _oop_map_set;           // Table of oop maps (one for each safepoint location)
    BufferBlob*            _scratch_buffer_blob;   // For temporary code buffers.
    relocInfo*             _scratch_locs_memory;   // For temporary code buffers.
    int                    _scratch_const_size;    // For temporary code buffers.
    bool                   _in_scratch_emit_size;  // true when in scratch_emit_size.
--- 71,19 ---
      _const(0),
      _reloc(0)
    { };
  };
  
  class PhaseOutput : public Phase {
  private:
    // Instruction bits passed off to the VM
    int                    _method_size;           // Size of nmethod code segment in bytes
    CodeBuffer             _code_buffer;           // Where the code is assembled
    int                    _first_block_size;      // Size of unvalidated entry point code / OSR poison code
    ExceptionHandlerTable  _handler_table;         // Table of native-code exception handlers
    ImplicitExceptionTable _inc_table;             // Table of implicit null checks in native code
!   C2CodeStubList         _stub_list;             // List of code stubs
    OopMapSet*             _oop_map_set;           // Table of oop maps (one for each safepoint location)
    BufferBlob*            _scratch_buffer_blob;   // For temporary code buffers.
    relocInfo*             _scratch_locs_memory;   // For temporary code buffers.
    int                    _scratch_const_size;    // For temporary code buffers.
    bool                   _in_scratch_emit_size;  // true when in scratch_emit_size.

*** 167,12 ***
    void install_stub(const char* stub_name);
  
    // Constant table
    ConstantTable& constant_table() { return _constant_table; }
  
!   // Safepoint poll table
!   C2SafepointPollStubTable* safepoint_poll_table() { return &_safepoint_poll_table; }
  
    // Code emission iterator
    Block* block()   { return _block; }
    int index()      { return _index; }
  
--- 127,12 ---
    void install_stub(const char* stub_name);
  
    // Constant table
    ConstantTable& constant_table() { return _constant_table; }
  
!   // Code stubs list
!   void add_stub(C2CodeStub* stub) { _stub_list.add_stub(stub); }
  
    // Code emission iterator
    Block* block()   { return _block; }
    int index()      { return _index; }
  
< prev index next >