< 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();
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   void        set_allocator(LinearScan* allocator) { _allocator = allocator; }
114 

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   bool               _has_monitors; // Fastpath monitors detection for Continuations
 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   int                _immediate_oops_patched;
 97 
 98   // compilation helpers
 99   void initialize();
100   void build_hir();
101   void emit_lir();
102 
103   void emit_code_epilog(LIR_Assembler* assembler);
104   int  emit_code_body();
105 
106   int  compile_java_method();
107   void install_code(int frame_size);
108   void compile_method();
109 
110   void generate_exception_handler_table();
111 
112   ExceptionInfoList* exception_info_list() const { return _exception_info_list; }
113   ExceptionHandlerTable* exception_handler_table() { return &_exception_handler_table; }
114 
115   void        set_allocator(LinearScan* allocator) { _allocator = allocator; }
116 

122 
123  public:
124   // creation
125   Compilation(AbstractCompiler* compiler, ciEnv* env, ciMethod* method,
126               int osr_bci, BufferBlob* buffer_blob, bool install_code, DirectiveSet* directive);
127   ~Compilation();
128 
129 
130   static Compilation* current() {
131     return (Compilation*) ciEnv::current()->compiler_data();
132   }
133 
134   // accessors
135   ciEnv* env() const                             { return _env; }
136   DirectiveSet* directive() const                { return _directive; }
137   CompileLog* log() const                        { return _log; }
138   AbstractCompiler* compiler() const             { return _compiler; }
139   bool has_exception_handlers() const            { return _has_exception_handlers; }
140   bool has_fpu_code() const                      { return _has_fpu_code; }
141   bool has_unsafe_access() const                 { return _has_unsafe_access; }
142   bool has_monitors() const                      { return _has_monitors; }
143   int max_vector_size() const                    { return 0; }
144   ciMethod* method() const                       { return _method; }
145   int osr_bci() const                            { return _osr_bci; }
146   bool is_osr_compile() const                    { return osr_bci() >= 0; }
147   IR* hir() const                                { return _hir; }
148   int max_spills() const                         { return _max_spills; }
149   FrameMap* frame_map() const                    { return _frame_map; }
150   CodeBuffer* code()                             { return &_code; }
151   C1_MacroAssembler* masm() const                { return _masm; }
152   CodeOffsets* offsets()                         { return &_offsets; }
153   Arena* arena()                                 { return _arena; }
154   bool has_access_indexed()                      { return _has_access_indexed; }
155   bool should_install_code()                     { return _install_code && InstallMethods; }
156   LinearScan* allocator()                        { return _allocator; }
157 
158   // Instruction ids
159   int get_next_id()                              { return _next_id++; }
160   int number_of_instructions() const             { return _next_id; }
161 
162   // BlockBegin ids
163   int get_next_block_id()                        { return _next_block_id++; }
164   int number_of_blocks() const                   { return _next_block_id; }
165 
166   // setters
167   void set_has_exception_handlers(bool f)        { _has_exception_handlers = f; }
168   void set_has_fpu_code(bool f)                  { _has_fpu_code = f; }
169   void set_has_unsafe_access(bool f)             { _has_unsafe_access = f; }
170   void set_would_profile(bool f)                 { _would_profile = f; }
171   void set_has_access_indexed(bool f)            { _has_access_indexed = f; }
172   void set_has_monitors(bool f)                  { _has_monitors = f; }
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 >