Mercurial > hg > truffle
comparison src/share/vm/c1/c1_GraphBuilder.cpp @ 14477:96d2c94bbdd0
8035493: JVMTI PopFrame capability must instruct compilers not to prune locals
Reviewed-by: kvn, sla, coleenp, sspitsyn
author | mgronlun |
---|---|
date | Sat, 22 Feb 2014 10:22:05 +0100 |
parents | 1128e5fec05f |
children | d8041d695d19 3edd4a71588b |
comparison
equal
deleted
inserted
replaced
14476:4510a3502166 | 14477:96d2c94bbdd0 |
---|---|
2274 | 2274 |
2275 XHandlers* GraphBuilder::handle_exception(Instruction* instruction) { | 2275 XHandlers* GraphBuilder::handle_exception(Instruction* instruction) { |
2276 if (!has_handler() && (!instruction->needs_exception_state() || instruction->exception_state() != NULL)) { | 2276 if (!has_handler() && (!instruction->needs_exception_state() || instruction->exception_state() != NULL)) { |
2277 assert(instruction->exception_state() == NULL | 2277 assert(instruction->exception_state() == NULL |
2278 || instruction->exception_state()->kind() == ValueStack::EmptyExceptionState | 2278 || instruction->exception_state()->kind() == ValueStack::EmptyExceptionState |
2279 || (instruction->exception_state()->kind() == ValueStack::ExceptionState && _compilation->env()->jvmti_can_access_local_variables()), | 2279 || (instruction->exception_state()->kind() == ValueStack::ExceptionState && _compilation->env()->should_retain_local_variables()), |
2280 "exception_state should be of exception kind"); | 2280 "exception_state should be of exception kind"); |
2281 return new XHandlers(); | 2281 return new XHandlers(); |
2282 } | 2282 } |
2283 | 2283 |
2284 XHandlers* exception_handlers = new XHandlers(); | 2284 XHandlers* exception_handlers = new XHandlers(); |
2365 | 2365 |
2366 if (exception_handlers->length() == 0) { | 2366 if (exception_handlers->length() == 0) { |
2367 // This scope and all callees do not handle exceptions, so the local | 2367 // This scope and all callees do not handle exceptions, so the local |
2368 // variables of this scope are not needed. However, the scope itself is | 2368 // variables of this scope are not needed. However, the scope itself is |
2369 // required for a correct exception stack trace -> clear out the locals. | 2369 // required for a correct exception stack trace -> clear out the locals. |
2370 if (_compilation->env()->jvmti_can_access_local_variables()) { | 2370 if (_compilation->env()->should_retain_local_variables()) { |
2371 cur_state = cur_state->copy(ValueStack::ExceptionState, cur_state->bci()); | 2371 cur_state = cur_state->copy(ValueStack::ExceptionState, cur_state->bci()); |
2372 } else { | 2372 } else { |
2373 cur_state = cur_state->copy(ValueStack::EmptyExceptionState, cur_state->bci()); | 2373 cur_state = cur_state->copy(ValueStack::EmptyExceptionState, cur_state->bci()); |
2374 } | 2374 } |
2375 if (prev_state != NULL) { | 2375 if (prev_state != NULL) { |
3249 } | 3249 } |
3250 | 3250 |
3251 ValueStack* GraphBuilder::copy_state_for_exception_with_bci(int bci) { | 3251 ValueStack* GraphBuilder::copy_state_for_exception_with_bci(int bci) { |
3252 ValueStack* s = copy_state_exhandling_with_bci(bci); | 3252 ValueStack* s = copy_state_exhandling_with_bci(bci); |
3253 if (s == NULL) { | 3253 if (s == NULL) { |
3254 if (_compilation->env()->jvmti_can_access_local_variables()) { | 3254 if (_compilation->env()->should_retain_local_variables()) { |
3255 s = state()->copy(ValueStack::ExceptionState, bci); | 3255 s = state()->copy(ValueStack::ExceptionState, bci); |
3256 } else { | 3256 } else { |
3257 s = state()->copy(ValueStack::EmptyExceptionState, bci); | 3257 s = state()->copy(ValueStack::EmptyExceptionState, bci); |
3258 } | 3258 } |
3259 } | 3259 } |