Mercurial > hg > graal-compiler
comparison src/share/vm/opto/output.cpp @ 1202:5f24d0319e54
4360113: Evict nmethods when code cache gets full
Summary: Speculatively unload the oldest nmethods when code cache gets full.
Reviewed-by: never, kvn
Contributed-by: eric.caspole@amd.com
author | kvn |
---|---|
date | Fri, 29 Jan 2010 09:27:22 -0800 |
parents | 24128c2ffa87 |
children | 18a389214829 |
comparison
equal
deleted
inserted
replaced
1201:24128c2ffa87 | 1202:5f24d0319e54 |
---|---|
1091 int total_req = code_req + pad_req + stub_req + exception_handler_req + deopt_handler_req + const_req; | 1091 int total_req = code_req + pad_req + stub_req + exception_handler_req + deopt_handler_req + const_req; |
1092 CodeBuffer* cb = code_buffer(); | 1092 CodeBuffer* cb = code_buffer(); |
1093 cb->initialize(total_req, locs_req); | 1093 cb->initialize(total_req, locs_req); |
1094 | 1094 |
1095 // Have we run out of code space? | 1095 // Have we run out of code space? |
1096 if (cb->blob() == NULL) { | 1096 if ((cb->blob() == NULL) || (!CompileBroker::should_compile_new_jobs())) { |
1097 turn_off_compiler(this); | 1097 turn_off_compiler(this); |
1098 return; | 1098 return; |
1099 } | 1099 } |
1100 // Configure the code buffer. | 1100 // Configure the code buffer. |
1101 cb->initialize_consts_size(const_req); | 1101 cb->initialize_consts_size(const_req); |
1312 } | 1312 } |
1313 } | 1313 } |
1314 | 1314 |
1315 // Verify that there is sufficient space remaining | 1315 // Verify that there is sufficient space remaining |
1316 cb->insts()->maybe_expand_to_ensure_remaining(MAX_inst_size); | 1316 cb->insts()->maybe_expand_to_ensure_remaining(MAX_inst_size); |
1317 if (cb->blob() == NULL) { | 1317 if ((cb->blob() == NULL) || (!CompileBroker::should_compile_new_jobs())) { |
1318 turn_off_compiler(this); | 1318 turn_off_compiler(this); |
1319 return; | 1319 return; |
1320 } | 1320 } |
1321 | 1321 |
1322 // Save the offset for the listing | 1322 // Save the offset for the listing |
1431 // Emit the deopt handler code. | 1431 // Emit the deopt handler code. |
1432 _code_offsets.set_value(CodeOffsets::Deopt, emit_deopt_handler(*cb)); | 1432 _code_offsets.set_value(CodeOffsets::Deopt, emit_deopt_handler(*cb)); |
1433 } | 1433 } |
1434 | 1434 |
1435 // One last check for failed CodeBuffer::expand: | 1435 // One last check for failed CodeBuffer::expand: |
1436 if (cb->blob() == NULL) { | 1436 if ((cb->blob() == NULL) || (!CompileBroker::should_compile_new_jobs())) { |
1437 turn_off_compiler(this); | 1437 turn_off_compiler(this); |
1438 return; | 1438 return; |
1439 } | 1439 } |
1440 | 1440 |
1441 #ifndef PRODUCT | 1441 #ifndef PRODUCT |