comparison src/share/vm/opto/output.cpp @ 1265:b4b440360f1e

6926782: CodeBuffer size too small after 6921352 Summary: After 6921352 the CodeBuffer size was too small. Reviewed-by: kvn, never
author twisti
date Thu, 18 Feb 2010 11:35:41 +0100
parents f70b0d9ab095
children 2883969d09e7
comparison
equal deleted inserted replaced
1264:106f41e88c85 1265:b4b440360f1e
803 debug_info()->add_safepoint(safepoint_pc_offset, sfn->_oop_map); 803 debug_info()->add_safepoint(safepoint_pc_offset, sfn->_oop_map);
804 } else { 804 } else {
805 mcall = mach->as_MachCall(); 805 mcall = mach->as_MachCall();
806 806
807 // Is the call a MethodHandle call? 807 // Is the call a MethodHandle call?
808 if (mcall->is_MachCallJava()) 808 if (mcall->is_MachCallJava()) {
809 is_method_handle_invoke = mcall->as_MachCallJava()->_method_handle_invoke; 809 if (mcall->as_MachCallJava()->_method_handle_invoke) {
810 assert(has_method_handle_invokes(), "must have been set during call generation");
811 is_method_handle_invoke = true;
812 }
813 }
810 814
811 // Check if a call returns an object. 815 // Check if a call returns an object.
812 if (mcall->return_value_is_used() && 816 if (mcall->return_value_is_used() &&
813 mcall->tf()->range()->field_at(TypeFunc::Parms)->isa_ptr()) { 817 mcall->tf()->range()->field_at(TypeFunc::Parms)->isa_ptr()) {
814 return_oop = true; 818 return_oop = true;
1090 int deopt_handler_req = size_deopt_handler(); 1094 int deopt_handler_req = size_deopt_handler();
1091 exception_handler_req += MAX_stubs_size; // add marginal slop for handler 1095 exception_handler_req += MAX_stubs_size; // add marginal slop for handler
1092 deopt_handler_req += MAX_stubs_size; // add marginal slop for handler 1096 deopt_handler_req += MAX_stubs_size; // add marginal slop for handler
1093 stub_req += MAX_stubs_size; // ensure per-stub margin 1097 stub_req += MAX_stubs_size; // ensure per-stub margin
1094 code_req += MAX_inst_size; // ensure per-instruction margin 1098 code_req += MAX_inst_size; // ensure per-instruction margin
1099
1095 if (StressCodeBuffers) 1100 if (StressCodeBuffers)
1096 code_req = const_req = stub_req = exception_handler_req = deopt_handler_req = 0x10; // force expansion 1101 code_req = const_req = stub_req = exception_handler_req = deopt_handler_req = 0x10; // force expansion
1097 int total_req = code_req + pad_req + stub_req + exception_handler_req + deopt_handler_req + const_req; 1102
1103 int total_req =
1104 code_req +
1105 pad_req +
1106 stub_req +
1107 exception_handler_req +
1108 deopt_handler_req + // deopt handler
1109 const_req;
1110
1111 if (has_method_handle_invokes())
1112 total_req += deopt_handler_req; // deopt MH handler
1113
1098 CodeBuffer* cb = code_buffer(); 1114 CodeBuffer* cb = code_buffer();
1099 cb->initialize(total_req, locs_req); 1115 cb->initialize(total_req, locs_req);
1100 1116
1101 // Have we run out of code space? 1117 // Have we run out of code space?
1102 if ((cb->blob() == NULL) || (!CompileBroker::should_compile_new_jobs())) { 1118 if ((cb->blob() == NULL) || (!CompileBroker::should_compile_new_jobs())) {
1434 if (_method) { 1450 if (_method) {
1435 // Emit the exception handler code. 1451 // Emit the exception handler code.
1436 _code_offsets.set_value(CodeOffsets::Exceptions, emit_exception_handler(*cb)); 1452 _code_offsets.set_value(CodeOffsets::Exceptions, emit_exception_handler(*cb));
1437 // Emit the deopt handler code. 1453 // Emit the deopt handler code.
1438 _code_offsets.set_value(CodeOffsets::Deopt, emit_deopt_handler(*cb)); 1454 _code_offsets.set_value(CodeOffsets::Deopt, emit_deopt_handler(*cb));
1439 // Emit the MethodHandle deopt handler code. We can use the same 1455
1440 // code as for the normal deopt handler, we just need a different 1456 // Emit the MethodHandle deopt handler code (if required).
1441 // entry point address. 1457 if (has_method_handle_invokes()) {
1442 _code_offsets.set_value(CodeOffsets::DeoptMH, emit_deopt_handler(*cb)); 1458 // We can use the same code as for the normal deopt handler, we
1459 // just need a different entry point address.
1460 _code_offsets.set_value(CodeOffsets::DeoptMH, emit_deopt_handler(*cb));
1461 }
1443 } 1462 }
1444 1463
1445 // One last check for failed CodeBuffer::expand: 1464 // One last check for failed CodeBuffer::expand:
1446 if ((cb->blob() == NULL) || (!CompileBroker::should_compile_new_jobs())) { 1465 if ((cb->blob() == NULL) || (!CompileBroker::should_compile_new_jobs())) {
1447 turn_off_compiler(this); 1466 turn_off_compiler(this);