130 return gm.start(); |
130 return gm.start(); |
131 } |
131 } |
132 |
132 |
133 |
133 |
134 IRScope::IRScope(Compilation* compilation, IRScope* caller, int caller_bci, ciMethod* method, int osr_bci, bool create_graph) |
134 IRScope::IRScope(Compilation* compilation, IRScope* caller, int caller_bci, ciMethod* method, int osr_bci, bool create_graph) |
135 : _callees(2) |
135 : _compilation(compilation) |
136 , _compilation(compilation) |
136 , _callees(2) |
137 , _requires_phi_function(method->max_locals()) |
137 , _requires_phi_function(method->max_locals()) |
138 { |
138 { |
139 _caller = caller; |
139 _caller = caller; |
140 _level = caller == NULL ? 0 : caller->level() + 1; |
140 _level = caller == NULL ? 0 : caller->level() + 1; |
141 _method = method; |
141 _method = method; |
182 |
182 |
183 // Implementation of CodeEmitInfo |
183 // Implementation of CodeEmitInfo |
184 |
184 |
185 // Stack must be NON-null |
185 // Stack must be NON-null |
186 CodeEmitInfo::CodeEmitInfo(ValueStack* stack, XHandlers* exception_handlers, bool deoptimize_on_exception) |
186 CodeEmitInfo::CodeEmitInfo(ValueStack* stack, XHandlers* exception_handlers, bool deoptimize_on_exception) |
187 : _scope(stack->scope()) |
187 : _scope_debug_info(NULL) |
188 , _scope_debug_info(NULL) |
188 , _scope(stack->scope()) |
|
189 , _exception_handlers(exception_handlers) |
189 , _oop_map(NULL) |
190 , _oop_map(NULL) |
190 , _stack(stack) |
191 , _stack(stack) |
191 , _exception_handlers(exception_handlers) |
|
192 , _is_method_handle_invoke(false) |
192 , _is_method_handle_invoke(false) |
193 , _deoptimize_on_exception(deoptimize_on_exception) { |
193 , _deoptimize_on_exception(deoptimize_on_exception) { |
194 assert(_stack != NULL, "must be non null"); |
194 assert(_stack != NULL, "must be non null"); |
195 } |
195 } |
196 |
196 |
197 |
197 |
198 CodeEmitInfo::CodeEmitInfo(CodeEmitInfo* info, ValueStack* stack) |
198 CodeEmitInfo::CodeEmitInfo(CodeEmitInfo* info, ValueStack* stack) |
199 : _scope(info->_scope) |
199 : _scope_debug_info(NULL) |
|
200 , _scope(info->_scope) |
200 , _exception_handlers(NULL) |
201 , _exception_handlers(NULL) |
201 , _scope_debug_info(NULL) |
|
202 , _oop_map(NULL) |
202 , _oop_map(NULL) |
203 , _stack(stack == NULL ? info->_stack : stack) |
203 , _stack(stack == NULL ? info->_stack : stack) |
204 , _is_method_handle_invoke(info->_is_method_handle_invoke) |
204 , _is_method_handle_invoke(info->_is_method_handle_invoke) |
205 , _deoptimize_on_exception(info->_deoptimize_on_exception) { |
205 , _deoptimize_on_exception(info->_deoptimize_on_exception) { |
206 |
206 |
524 ComputeLinearScanOrder::ComputeLinearScanOrder(Compilation* c, BlockBegin* start_block) : |
524 ComputeLinearScanOrder::ComputeLinearScanOrder(Compilation* c, BlockBegin* start_block) : |
525 _max_block_id(BlockBegin::number_of_blocks()), |
525 _max_block_id(BlockBegin::number_of_blocks()), |
526 _num_blocks(0), |
526 _num_blocks(0), |
527 _num_loops(0), |
527 _num_loops(0), |
528 _iterative_dominators(false), |
528 _iterative_dominators(false), |
|
529 _linear_scan_order(NULL), // initialized later with correct size |
529 _visited_blocks(_max_block_id), |
530 _visited_blocks(_max_block_id), |
530 _active_blocks(_max_block_id), |
531 _active_blocks(_max_block_id), |
531 _dominator_blocks(_max_block_id), |
532 _dominator_blocks(_max_block_id), |
532 _forward_branches(_max_block_id, _max_block_id, 0), |
533 _forward_branches(_max_block_id, _max_block_id, 0), |
533 _loop_end_blocks(8), |
534 _loop_end_blocks(8), |
|
535 _loop_map(0), // initialized later with correct size |
534 _work_list(8), |
536 _work_list(8), |
535 _linear_scan_order(NULL), // initialized later with correct size |
|
536 _loop_map(0), // initialized later with correct size |
|
537 _compilation(c) |
537 _compilation(c) |
538 { |
538 { |
539 TRACE_LINEAR_SCAN(2, tty->print_cr("***** computing linear-scan block order")); |
539 TRACE_LINEAR_SCAN(2, tty->print_cr("***** computing linear-scan block order")); |
540 |
540 |
541 count_edges(start_block, NULL); |
541 count_edges(start_block, NULL); |