4238 |
4238 |
4239 // Conservatively insert a memory barrier on all memory slices. |
4239 // Conservatively insert a memory barrier on all memory slices. |
4240 // Do not let writes of the copy source or destination float below the copy. |
4240 // Do not let writes of the copy source or destination float below the copy. |
4241 insert_mem_bar(Op_MemBarCPUOrder); |
4241 insert_mem_bar(Op_MemBarCPUOrder); |
4242 |
4242 |
|
4243 Node* thread = _gvn.transform(new ThreadLocalNode()); |
|
4244 Node* doing_unsafe_access_addr = basic_plus_adr(top(), thread, in_bytes(JavaThread::doing_unsafe_access_offset())); |
|
4245 BasicType doing_unsafe_access_bt = T_BYTE; |
|
4246 assert((sizeof(bool) * CHAR_BIT) == 8, "not implemented"); |
|
4247 |
|
4248 // update volatile field |
|
4249 store_to_memory(control(), doing_unsafe_access_addr, intcon(1), doing_unsafe_access_bt, Compile::AliasIdxRaw, MemNode::unordered); |
|
4250 |
4243 // Call it. Note that the length argument is not scaled. |
4251 // Call it. Note that the length argument is not scaled. |
4244 make_runtime_call(RC_LEAF|RC_NO_FP, |
4252 make_runtime_call(RC_LEAF|RC_NO_FP, |
4245 OptoRuntime::fast_arraycopy_Type(), |
4253 OptoRuntime::fast_arraycopy_Type(), |
4246 StubRoutines::unsafe_arraycopy(), |
4254 StubRoutines::unsafe_arraycopy(), |
4247 "unsafe_arraycopy", |
4255 "unsafe_arraycopy", |
4248 TypeRawPtr::BOTTOM, |
4256 TypeRawPtr::BOTTOM, |
4249 src, dst, size XTOP); |
4257 src, dst, size XTOP); |
|
4258 |
|
4259 store_to_memory(control(), doing_unsafe_access_addr, intcon(0), doing_unsafe_access_bt, Compile::AliasIdxRaw, MemNode::unordered); |
4250 |
4260 |
4251 // Do not let reads of the copy destination float above the copy. |
4261 // Do not let reads of the copy destination float above the copy. |
4252 insert_mem_bar(Op_MemBarCPUOrder); |
4262 insert_mem_bar(Op_MemBarCPUOrder); |
4253 |
4263 |
4254 return true; |
4264 return true; |