< prev index next >

src/hotspot/share/c1/c1_Compilation.hpp

Print this page




  64   // compilation specifics
  65   Arena* _arena;
  66   int _next_id;
  67   int _next_block_id;
  68   AbstractCompiler*  _compiler;
  69   DirectiveSet*      _directive;
  70   ciEnv*             _env;
  71   CompileLog*        _log;
  72   ciMethod*          _method;
  73   int                _osr_bci;
  74   IR*                _hir;
  75   int                _max_spills;
  76   FrameMap*          _frame_map;
  77   C1_MacroAssembler* _masm;
  78   bool               _has_exception_handlers;
  79   bool               _has_fpu_code;
  80   bool               _has_unsafe_access;
  81   bool               _would_profile;
  82   bool               _has_method_handle_invokes;  // True if this method has MethodHandle invokes.
  83   bool               _has_reserved_stack_access;

  84   const char*        _bailout_msg;
  85   ExceptionInfoList* _exception_info_list;
  86   ExceptionHandlerTable _exception_handler_table;
  87   ImplicitExceptionTable _implicit_exception_table;
  88   LinearScan*        _allocator;
  89   CodeOffsets        _offsets;
  90   CodeBuffer         _code;
  91   bool               _has_access_indexed;
  92   int                _interpreter_frame_size; // Stack space needed in case of a deoptimization

  93 
  94   // compilation helpers
  95   void initialize();
  96   void build_hir();
  97   void emit_lir();
  98 
  99   void emit_code_epilog(LIR_Assembler* assembler);
 100   int  emit_code_body();
 101 
 102   int  compile_java_method();
 103   void install_code(int frame_size);
 104   void compile_method();
 105 
 106   void generate_exception_handler_table();
 107 
 108   ExceptionInfoList* exception_info_list() const { return _exception_info_list; }
 109   ExceptionHandlerTable* exception_handler_table() { return &_exception_handler_table; }
 110 
 111   LinearScan* allocator()                          { return _allocator;      }
 112   void        set_allocator(LinearScan* allocator) { _allocator = allocator; }


 119 
 120  public:
 121   // creation
 122   Compilation(AbstractCompiler* compiler, ciEnv* env, ciMethod* method,
 123               int osr_bci, BufferBlob* buffer_blob, DirectiveSet* directive);
 124   ~Compilation();
 125 
 126 
 127   static Compilation* current() {
 128     return (Compilation*) ciEnv::current()->compiler_data();
 129   }
 130 
 131   // accessors
 132   ciEnv* env() const                             { return _env; }
 133   DirectiveSet* directive() const                { return _directive; }
 134   CompileLog* log() const                        { return _log; }
 135   AbstractCompiler* compiler() const             { return _compiler; }
 136   bool has_exception_handlers() const            { return _has_exception_handlers; }
 137   bool has_fpu_code() const                      { return _has_fpu_code; }
 138   bool has_unsafe_access() const                 { return _has_unsafe_access; }

 139   int max_vector_size() const                    { return 0; }
 140   ciMethod* method() const                       { return _method; }
 141   int osr_bci() const                            { return _osr_bci; }
 142   bool is_osr_compile() const                    { return osr_bci() >= 0; }
 143   IR* hir() const                                { return _hir; }
 144   int max_spills() const                         { return _max_spills; }
 145   FrameMap* frame_map() const                    { return _frame_map; }
 146   CodeBuffer* code()                             { return &_code; }
 147   C1_MacroAssembler* masm() const                { return _masm; }
 148   CodeOffsets* offsets()                         { return &_offsets; }
 149   Arena* arena()                                 { return _arena; }
 150   bool has_access_indexed()                      { return _has_access_indexed; }
 151 
 152   // Instruction ids
 153   int get_next_id()                              { return _next_id++; }
 154   int number_of_instructions() const             { return _next_id; }
 155 
 156   // BlockBegin ids
 157   int get_next_block_id()                        { return _next_block_id++; }
 158   int number_of_blocks() const                   { return _next_block_id; }
 159 
 160   // setters
 161   void set_has_exception_handlers(bool f)        { _has_exception_handlers = f; }
 162   void set_has_fpu_code(bool f)                  { _has_fpu_code = f; }
 163   void set_has_unsafe_access(bool f)             { _has_unsafe_access = f; }
 164   void set_would_profile(bool f)                 { _would_profile = f; }
 165   void set_has_access_indexed(bool f)            { _has_access_indexed = f; }

 166   // Add a set of exception handlers covering the given PC offset
 167   void add_exception_handlers_for_pco(int pco, XHandlers* exception_handlers);
 168   // Statistics gathering
 169   void notice_inlined_method(ciMethod* method);
 170 
 171   // JSR 292
 172   bool     has_method_handle_invokes() const { return _has_method_handle_invokes;     }
 173   void set_has_method_handle_invokes(bool z) {        _has_method_handle_invokes = z; }
 174 
 175   bool     has_reserved_stack_access() const { return _has_reserved_stack_access; }
 176   void set_has_reserved_stack_access(bool z) { _has_reserved_stack_access = z; }
 177 
 178   DebugInformationRecorder* debug_info_recorder() const; // = _env->debug_info();
 179   Dependencies* dependency_recorder() const; // = _env->dependencies()
 180   ImplicitExceptionTable* implicit_exception_table()     { return &_implicit_exception_table; }
 181 
 182   Instruction* current_instruction() const       { return _current_instruction; }
 183   Instruction* set_current_instruction(Instruction* instr) {
 184     Instruction* previous = _current_instruction;
 185     _current_instruction = instr;




  64   // compilation specifics
  65   Arena* _arena;
  66   int _next_id;
  67   int _next_block_id;
  68   AbstractCompiler*  _compiler;
  69   DirectiveSet*      _directive;
  70   ciEnv*             _env;
  71   CompileLog*        _log;
  72   ciMethod*          _method;
  73   int                _osr_bci;
  74   IR*                _hir;
  75   int                _max_spills;
  76   FrameMap*          _frame_map;
  77   C1_MacroAssembler* _masm;
  78   bool               _has_exception_handlers;
  79   bool               _has_fpu_code;
  80   bool               _has_unsafe_access;
  81   bool               _would_profile;
  82   bool               _has_method_handle_invokes;  // True if this method has MethodHandle invokes.
  83   bool               _has_reserved_stack_access;
  84   bool               _has_monitors; // Fastpath monitors detection for Continuations
  85   const char*        _bailout_msg;
  86   ExceptionInfoList* _exception_info_list;
  87   ExceptionHandlerTable _exception_handler_table;
  88   ImplicitExceptionTable _implicit_exception_table;
  89   LinearScan*        _allocator;
  90   CodeOffsets        _offsets;
  91   CodeBuffer         _code;
  92   bool               _has_access_indexed;
  93   int                _interpreter_frame_size; // Stack space needed in case of a deoptimization
  94   int                _immediate_oops_patched;
  95 
  96   // compilation helpers
  97   void initialize();
  98   void build_hir();
  99   void emit_lir();
 100 
 101   void emit_code_epilog(LIR_Assembler* assembler);
 102   int  emit_code_body();
 103 
 104   int  compile_java_method();
 105   void install_code(int frame_size);
 106   void compile_method();
 107 
 108   void generate_exception_handler_table();
 109 
 110   ExceptionInfoList* exception_info_list() const { return _exception_info_list; }
 111   ExceptionHandlerTable* exception_handler_table() { return &_exception_handler_table; }
 112 
 113   LinearScan* allocator()                          { return _allocator;      }
 114   void        set_allocator(LinearScan* allocator) { _allocator = allocator; }


 121 
 122  public:
 123   // creation
 124   Compilation(AbstractCompiler* compiler, ciEnv* env, ciMethod* method,
 125               int osr_bci, BufferBlob* buffer_blob, DirectiveSet* directive);
 126   ~Compilation();
 127 
 128 
 129   static Compilation* current() {
 130     return (Compilation*) ciEnv::current()->compiler_data();
 131   }
 132 
 133   // accessors
 134   ciEnv* env() const                             { return _env; }
 135   DirectiveSet* directive() const                { return _directive; }
 136   CompileLog* log() const                        { return _log; }
 137   AbstractCompiler* compiler() const             { return _compiler; }
 138   bool has_exception_handlers() const            { return _has_exception_handlers; }
 139   bool has_fpu_code() const                      { return _has_fpu_code; }
 140   bool has_unsafe_access() const                 { return _has_unsafe_access; }
 141   bool has_monitors() const                      { return _has_monitors; }
 142   int max_vector_size() const                    { return 0; }
 143   ciMethod* method() const                       { return _method; }
 144   int osr_bci() const                            { return _osr_bci; }
 145   bool is_osr_compile() const                    { return osr_bci() >= 0; }
 146   IR* hir() const                                { return _hir; }
 147   int max_spills() const                         { return _max_spills; }
 148   FrameMap* frame_map() const                    { return _frame_map; }
 149   CodeBuffer* code()                             { return &_code; }
 150   C1_MacroAssembler* masm() const                { return _masm; }
 151   CodeOffsets* offsets()                         { return &_offsets; }
 152   Arena* arena()                                 { return _arena; }
 153   bool has_access_indexed()                      { return _has_access_indexed; }
 154 
 155   // Instruction ids
 156   int get_next_id()                              { return _next_id++; }
 157   int number_of_instructions() const             { return _next_id; }
 158 
 159   // BlockBegin ids
 160   int get_next_block_id()                        { return _next_block_id++; }
 161   int number_of_blocks() const                   { return _next_block_id; }
 162 
 163   // setters
 164   void set_has_exception_handlers(bool f)        { _has_exception_handlers = f; }
 165   void set_has_fpu_code(bool f)                  { _has_fpu_code = f; }
 166   void set_has_unsafe_access(bool f)             { _has_unsafe_access = f; }
 167   void set_would_profile(bool f)                 { _would_profile = f; }
 168   void set_has_access_indexed(bool f)            { _has_access_indexed = f; }
 169   void set_has_monitors(bool f)                  { _has_monitors = f; }
 170   // Add a set of exception handlers covering the given PC offset
 171   void add_exception_handlers_for_pco(int pco, XHandlers* exception_handlers);
 172   // Statistics gathering
 173   void notice_inlined_method(ciMethod* method);
 174 
 175   // JSR 292
 176   bool     has_method_handle_invokes() const { return _has_method_handle_invokes;     }
 177   void set_has_method_handle_invokes(bool z) {        _has_method_handle_invokes = z; }
 178 
 179   bool     has_reserved_stack_access() const { return _has_reserved_stack_access; }
 180   void set_has_reserved_stack_access(bool z) { _has_reserved_stack_access = z; }
 181 
 182   DebugInformationRecorder* debug_info_recorder() const; // = _env->debug_info();
 183   Dependencies* dependency_recorder() const; // = _env->dependencies()
 184   ImplicitExceptionTable* implicit_exception_table()     { return &_implicit_exception_table; }
 185 
 186   Instruction* current_instruction() const       { return _current_instruction; }
 187   Instruction* set_current_instruction(Instruction* instr) {
 188     Instruction* previous = _current_instruction;
 189     _current_instruction = instr;


< prev index next >