mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-22 12:04:39 +02:00
8024921: PPC64 (part 113): Extend Load and Store nodes to know about memory ordering
Add a field to C2 LoadNode and StoreNode classes which indicates whether the load/store should do an acquire/release on platforms which support it. Reviewed-by: kvn
This commit is contained in:
parent
d8b9e9f681
commit
13b13f5259
17 changed files with 351 additions and 255 deletions
|
@ -104,13 +104,12 @@ void GraphKit::gen_stub(address C_function,
|
|||
//
|
||||
Node *adr_sp = basic_plus_adr(top(), thread, in_bytes(JavaThread::last_Java_sp_offset()));
|
||||
Node *last_sp = basic_plus_adr(top(), frameptr(), (intptr_t) STACK_BIAS);
|
||||
store_to_memory(NULL, adr_sp, last_sp, T_ADDRESS, NoAlias);
|
||||
store_to_memory(NULL, adr_sp, last_sp, T_ADDRESS, NoAlias, MemNode::unordered);
|
||||
|
||||
// Set _thread_in_native
|
||||
// The order of stores into TLS is critical! Setting _thread_in_native MUST
|
||||
// be last, because a GC is allowed at any time after setting it and the GC
|
||||
// will require last_Java_pc and last_Java_sp.
|
||||
Node* adr_state = basic_plus_adr(top(), thread, in_bytes(JavaThread::thread_state_offset()));
|
||||
|
||||
//-----------------------------
|
||||
// Compute signature for C call. Varies from the Java signature!
|
||||
|
@ -225,16 +224,15 @@ void GraphKit::gen_stub(address C_function,
|
|||
//-----------------------------
|
||||
|
||||
// Clear last_Java_sp
|
||||
store_to_memory(NULL, adr_sp, null(), T_ADDRESS, NoAlias);
|
||||
store_to_memory(NULL, adr_sp, null(), T_ADDRESS, NoAlias, MemNode::unordered);
|
||||
// Clear last_Java_pc and (optionally)_flags
|
||||
store_to_memory(NULL, adr_last_Java_pc, null(), T_ADDRESS, NoAlias);
|
||||
store_to_memory(NULL, adr_last_Java_pc, null(), T_ADDRESS, NoAlias, MemNode::unordered);
|
||||
#if defined(SPARC)
|
||||
store_to_memory(NULL, adr_flags, intcon(0), T_INT, NoAlias);
|
||||
store_to_memory(NULL, adr_flags, intcon(0), T_INT, NoAlias, MemNode::unordered);
|
||||
#endif /* defined(SPARC) */
|
||||
#if (defined(IA64) && !defined(AIX))
|
||||
Node* adr_last_Java_fp = basic_plus_adr(top(), thread, in_bytes(JavaThread::last_Java_fp_offset()));
|
||||
if( os::is_MP() ) insert_mem_bar(Op_MemBarRelease);
|
||||
store_to_memory(NULL, adr_last_Java_fp, null(), T_ADDRESS, NoAlias);
|
||||
store_to_memory(NULL, adr_last_Java_fp, null(), T_ADDRESS, NoAlias, MemNode::unordered);
|
||||
#endif
|
||||
|
||||
// For is-fancy-jump, the C-return value is also the branch target
|
||||
|
@ -242,16 +240,16 @@ void GraphKit::gen_stub(address C_function,
|
|||
// Runtime call returning oop in TLS? Fetch it out
|
||||
if( pass_tls ) {
|
||||
Node* adr = basic_plus_adr(top(), thread, in_bytes(JavaThread::vm_result_offset()));
|
||||
Node* vm_result = make_load(NULL, adr, TypeOopPtr::BOTTOM, T_OBJECT, NoAlias, false);
|
||||
Node* vm_result = make_load(NULL, adr, TypeOopPtr::BOTTOM, T_OBJECT, NoAlias, MemNode::unordered);
|
||||
map()->set_req(TypeFunc::Parms, vm_result); // vm_result passed as result
|
||||
// clear thread-local-storage(tls)
|
||||
store_to_memory(NULL, adr, null(), T_ADDRESS, NoAlias);
|
||||
store_to_memory(NULL, adr, null(), T_ADDRESS, NoAlias, MemNode::unordered);
|
||||
}
|
||||
|
||||
//-----------------------------
|
||||
// check exception
|
||||
Node* adr = basic_plus_adr(top(), thread, in_bytes(Thread::pending_exception_offset()));
|
||||
Node* pending = make_load(NULL, adr, TypeOopPtr::BOTTOM, T_OBJECT, NoAlias, false);
|
||||
Node* pending = make_load(NULL, adr, TypeOopPtr::BOTTOM, T_OBJECT, NoAlias, MemNode::unordered);
|
||||
|
||||
Node* exit_memory = reset_memory();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue