< prev index next >

src/hotspot/share/c1/c1_Compilation.hpp

Print this page

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

 85   bool               _install_code;
 86   const char*        _bailout_msg;
 87   ExceptionInfoList* _exception_info_list;
 88   ExceptionHandlerTable _exception_handler_table;
 89   ImplicitExceptionTable _implicit_exception_table;
 90   LinearScan*        _allocator;
 91   CodeOffsets        _offsets;
 92   CodeBuffer         _code;
 93   bool               _has_access_indexed;
 94   int                _interpreter_frame_size; // Stack space needed in case of a deoptimization
 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();

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

140   int max_vector_size() const                    { return 0; }
141   ciMethod* method() const                       { return _method; }
142   int osr_bci() const                            { return _osr_bci; }
143   bool is_osr_compile() const                    { return osr_bci() >= 0; }
144   IR* hir() const                                { return _hir; }
145   int max_spills() const                         { return _max_spills; }
146   FrameMap* frame_map() const                    { return _frame_map; }
147   CodeBuffer* code()                             { return &_code; }
148   C1_MacroAssembler* masm() const                { return _masm; }
149   CodeOffsets* offsets()                         { return &_offsets; }
150   Arena* arena()                                 { return _arena; }
151   bool has_access_indexed()                      { return _has_access_indexed; }
152   bool should_install_code()                     { return _install_code && InstallMethods; }
153   LinearScan* allocator()                        { return _allocator; }
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   // Add a set of exception handlers covering the given PC offset
170   void add_exception_handlers_for_pco(int pco, XHandlers* exception_handlers);
171   // Statistics gathering
172   void notice_inlined_method(ciMethod* method);
173 
174   // JSR 292
175   bool     has_method_handle_invokes() const { return _has_method_handle_invokes;     }
176   void set_has_method_handle_invokes(bool z) {        _has_method_handle_invokes = z; }
177 
178   bool     has_reserved_stack_access() const { return _has_reserved_stack_access; }
179   void set_has_reserved_stack_access(bool z) { _has_reserved_stack_access = z; }
180 
181   DebugInformationRecorder* debug_info_recorder() const; // = _env->debug_info();
182   Dependencies* dependency_recorder() const; // = _env->dependencies()
183   ImplicitExceptionTable* implicit_exception_table()     { return &_implicit_exception_table; }
184 
185   Instruction* current_instruction() const       { return _current_instruction; }
186   Instruction* set_current_instruction(Instruction* instr) {
187     Instruction* previous = _current_instruction;
188     _current_instruction = instr;

 65   // compilation specifics
 66   Arena* _arena;
 67   int _next_id;
 68   int _next_block_id;
 69   AbstractCompiler*  _compiler;
 70   DirectiveSet*      _directive;
 71   ciEnv*             _env;
 72   CompileLog*        _log;
 73   ciMethod*          _method;
 74   int                _osr_bci;
 75   IR*                _hir;
 76   int                _max_spills;
 77   FrameMap*          _frame_map;
 78   C1_MacroAssembler* _masm;
 79   bool               _has_exception_handlers;
 80   bool               _has_fpu_code;
 81   bool               _has_unsafe_access;
 82   bool               _would_profile;
 83   bool               _has_method_handle_invokes;  // True if this method has MethodHandle invokes.
 84   bool               _has_reserved_stack_access;
 85   int                _max_monitors; // Max number of active monitors, for fast-locking
 86   bool               _install_code;
 87   const char*        _bailout_msg;
 88   ExceptionInfoList* _exception_info_list;
 89   ExceptionHandlerTable _exception_handler_table;
 90   ImplicitExceptionTable _implicit_exception_table;
 91   LinearScan*        _allocator;
 92   CodeOffsets        _offsets;
 93   CodeBuffer         _code;
 94   bool               _has_access_indexed;
 95   int                _interpreter_frame_size; // Stack space needed in case of a deoptimization
 96 
 97   // compilation helpers
 98   void initialize();
 99   void build_hir();
100   void emit_lir();
101 
102   void emit_code_epilog(LIR_Assembler* assembler);
103   int  emit_code_body();
104 
105   int  compile_java_method();

121 
122  public:
123   // creation
124   Compilation(AbstractCompiler* compiler, ciEnv* env, ciMethod* method,
125               int osr_bci, BufferBlob* buffer_blob, bool install_code, 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   int max_monitors() const                       { return _max_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   bool should_install_code()                     { return _install_code && InstallMethods; }
155   LinearScan* allocator()                        { return _allocator; }
156 
157   // Instruction ids
158   int get_next_id()                              { return _next_id++; }
159   int number_of_instructions() const             { return _next_id; }
160 
161   // BlockBegin ids
162   int get_next_block_id()                        { return _next_block_id++; }
163   int number_of_blocks() const                   { return _next_block_id; }
164 
165   // setters
166   void set_has_exception_handlers(bool f)        { _has_exception_handlers = f; }
167   void set_has_fpu_code(bool f)                  { _has_fpu_code = f; }
168   void set_has_unsafe_access(bool f)             { _has_unsafe_access = f; }
169   void set_would_profile(bool f)                 { _would_profile = f; }
170   void set_has_access_indexed(bool f)            { _has_access_indexed = f; }
171   void push_monitor()                            { _max_monitors++; }
172 
173   // Add a set of exception handlers covering the given PC offset
174   void add_exception_handlers_for_pco(int pco, XHandlers* exception_handlers);
175   // Statistics gathering
176   void notice_inlined_method(ciMethod* method);
177 
178   // JSR 292
179   bool     has_method_handle_invokes() const { return _has_method_handle_invokes;     }
180   void set_has_method_handle_invokes(bool z) {        _has_method_handle_invokes = z; }
181 
182   bool     has_reserved_stack_access() const { return _has_reserved_stack_access; }
183   void set_has_reserved_stack_access(bool z) { _has_reserved_stack_access = z; }
184 
185   DebugInformationRecorder* debug_info_recorder() const; // = _env->debug_info();
186   Dependencies* dependency_recorder() const; // = _env->dependencies()
187   ImplicitExceptionTable* implicit_exception_table()     { return &_implicit_exception_table; }
188 
189   Instruction* current_instruction() const       { return _current_instruction; }
190   Instruction* set_current_instruction(Instruction* instr) {
191     Instruction* previous = _current_instruction;
192     _current_instruction = instr;
< prev index next >