# HG changeset patch # User Tom Rodriguez # Date 1425928648 25200 # Node ID 72a3e399587986ae5a6867839c8b04d8627126a4 # Parent 3f7cd3c367348a58f474b5fa8e9236cd00273021 Fix possible race in assertion diff -r 3f7cd3c36734 -r 72a3e3995879 src/cpu/x86/vm/compiledIC_x86.cpp --- a/src/cpu/x86/vm/compiledIC_x86.cpp Mon Mar 09 17:49:57 2015 +0100 +++ b/src/cpu/x86/vm/compiledIC_x86.cpp Mon Mar 09 12:17:28 2015 -0700 @@ -135,10 +135,15 @@ NativeMovConstReg* method_holder = nativeMovConstReg_at(stub); NativeJump* jump = nativeJump_at(method_holder->next_instruction_address()); - assert(method_holder->data() == 0 || method_holder->data() == (intptr_t)callee(), +#ifdef ASSERT + // read the value once + intptr_t data = method_holder->data(); + address destination = jump->jump_destination(); + assert(data == 0 || data == (intptr_t)callee(), "a) MT-unsafe modification of inline cache"); - assert(jump->jump_destination() == (address)-1 || jump->jump_destination() == entry, + assert(destination == (address)-1 || destination == entry, "b) MT-unsafe modification of inline cache"); +#endif // Update stub. method_holder->set_data((intptr_t)callee());