comparison src/cpu/x86/vm/compiledIC_x86.cpp @ 19727:72a3e3995879

Fix possible race in assertion
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Mon, 09 Mar 2015 12:17:28 -0700
parents 52b4284cb496
children 7848fc12602b
comparison
equal deleted inserted replaced
19726:3f7cd3c36734 19727:72a3e3995879
133 133
134 // Creation also verifies the object. 134 // Creation also verifies the object.
135 NativeMovConstReg* method_holder = nativeMovConstReg_at(stub); 135 NativeMovConstReg* method_holder = nativeMovConstReg_at(stub);
136 NativeJump* jump = nativeJump_at(method_holder->next_instruction_address()); 136 NativeJump* jump = nativeJump_at(method_holder->next_instruction_address());
137 137
138 assert(method_holder->data() == 0 || method_holder->data() == (intptr_t)callee(), 138 #ifdef ASSERT
139 // read the value once
140 intptr_t data = method_holder->data();
141 address destination = jump->jump_destination();
142 assert(data == 0 || data == (intptr_t)callee(),
139 "a) MT-unsafe modification of inline cache"); 143 "a) MT-unsafe modification of inline cache");
140 assert(jump->jump_destination() == (address)-1 || jump->jump_destination() == entry, 144 assert(destination == (address)-1 || destination == entry,
141 "b) MT-unsafe modification of inline cache"); 145 "b) MT-unsafe modification of inline cache");
146 #endif
142 147
143 // Update stub. 148 // Update stub.
144 method_holder->set_data((intptr_t)callee()); 149 method_holder->set_data((intptr_t)callee());
145 jump->set_jump_destination(entry); 150 jump->set_jump_destination(entry);
146 151