mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
6939182: Zero JNI handles fix
Zero will exit with an error when invoked with -Xcheck:jni. Reviewed-by: twisti, kamg
This commit is contained in:
parent
61b9d428d1
commit
55457c9cc7
8 changed files with 59 additions and 35 deletions
|
@ -32,6 +32,7 @@ void ZeroStack::handle_overflow(TRAPS) {
|
|||
// Set up the frame anchor if it isn't already
|
||||
bool has_last_Java_frame = thread->has_last_Java_frame();
|
||||
if (!has_last_Java_frame) {
|
||||
intptr_t *sp = thread->zero_stack()->sp();
|
||||
ZeroFrame *frame = thread->top_zero_frame();
|
||||
while (frame) {
|
||||
if (frame->is_shark_frame())
|
||||
|
@ -44,13 +45,14 @@ void ZeroStack::handle_overflow(TRAPS) {
|
|||
break;
|
||||
}
|
||||
|
||||
sp = ((intptr_t *) frame) + 1;
|
||||
frame = frame->next();
|
||||
}
|
||||
|
||||
if (frame == NULL)
|
||||
fatal("unrecoverable stack overflow");
|
||||
|
||||
thread->set_last_Java_frame(frame);
|
||||
thread->set_last_Java_frame(frame, sp);
|
||||
}
|
||||
|
||||
// Throw the exception
|
||||
|
@ -71,3 +73,9 @@ void ZeroStack::handle_overflow(TRAPS) {
|
|||
if (!has_last_Java_frame)
|
||||
thread->reset_last_Java_frame();
|
||||
}
|
||||
|
||||
#ifndef PRODUCT
|
||||
void ZeroStack::zap(int c) {
|
||||
memset(_base, c, available_words() * wordSize);
|
||||
}
|
||||
#endif // PRODUCT
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue