Mercurial > hg > truffle
comparison src/share/vm/runtime/javaCalls.cpp @ 702:b9fba36710f2
6699669: Hotspot server leaves synchronized block with monitor in bad state
Summary: Remove usage of _highest_lock field in Thread so that is_lock_owned won't depend on the correct update of that field.
Reviewed-by: never, dice, acorn
author | xlu |
---|---|
date | Mon, 06 Apr 2009 15:47:39 -0700 |
parents | 0fbdb4381b99 |
children | 09e7826ecf01 2338d41fbd81 |
comparison
equal
deleted
inserted
replaced
697:922aedc96ef5 | 702:b9fba36710f2 |
---|---|
35 guarantee(thread->is_Java_thread(), "crucial check - the VM thread cannot and must not escape to Java code"); | 35 guarantee(thread->is_Java_thread(), "crucial check - the VM thread cannot and must not escape to Java code"); |
36 assert(!thread->owns_locks(), "must release all locks when leaving VM"); | 36 assert(!thread->owns_locks(), "must release all locks when leaving VM"); |
37 guarantee(!thread->is_Compiler_thread(), "cannot make java calls from the compiler"); | 37 guarantee(!thread->is_Compiler_thread(), "cannot make java calls from the compiler"); |
38 _result = result; | 38 _result = result; |
39 | 39 |
40 // Make sure that that the value of the higest_lock is at least the same as the current stackpointer, | |
41 // since, the Java code is highly likely to use locks. | |
42 // Use '(address)this' to guarantee that highest_lock address is conservative and inside our thread | |
43 thread->update_highest_lock((address)this); | |
44 | |
45 // Allocate handle block for Java code. This must be done before we change thread_state to _thread_in_Java_or_stub, | 40 // Allocate handle block for Java code. This must be done before we change thread_state to _thread_in_Java_or_stub, |
46 // since it can potentially block. | 41 // since it can potentially block. |
47 JNIHandleBlock* new_handles = JNIHandleBlock::allocate_block(thread); | 42 JNIHandleBlock* new_handles = JNIHandleBlock::allocate_block(thread); |
48 | 43 |
49 // After this, we are official in JavaCode. This needs to be done before we change any of the thread local | 44 // After this, we are official in JavaCode. This needs to be done before we change any of the thread local |