src/share/vm/opto/generateOptoStub.cpp

Print this page
rev 5661 : 8024921: PPC64 (part 113): Extend Load and Store nodes to know about memory ordering.

*** 102,118 **** // as soon as last_Java_sp != NULL the has_last_Java_frame is true and // users will look at the other fields. // 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); // 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! const Type **fields = TypeTuple::fields(2*parm_cnt+2); uint cnt = TypeFunc::Parms; --- 102,117 ---- // as soon as last_Java_sp != NULL the has_last_Java_frame is true and // users will look at the other fields. // 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, false, StoreNode::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. //----------------------------- // Compute signature for C call. Varies from the Java signature! const Type **fields = TypeTuple::fields(2*parm_cnt+2); uint cnt = TypeFunc::Parms;
*** 223,259 **** } //----------------------------- // Clear last_Java_sp ! store_to_memory(NULL, adr_sp, null(), T_ADDRESS, NoAlias); // Clear last_Java_pc and (optionally)_flags ! store_to_memory(NULL, adr_last_Java_pc, null(), T_ADDRESS, NoAlias); #if defined(SPARC) ! store_to_memory(NULL, adr_flags, intcon(0), T_INT, NoAlias); #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); #endif // For is-fancy-jump, the C-return value is also the branch target Node* target = map()->in(TypeFunc::Parms); // 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); 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); } //----------------------------- // 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* exit_memory = reset_memory(); Node* cmp = _gvn.transform( new (C) CmpPNode(pending, null()) ); Node* bo = _gvn.transform( new (C) BoolNode(cmp, BoolTest::ne) ); --- 222,257 ---- } //----------------------------- // Clear last_Java_sp ! store_to_memory(NULL, adr_sp, null(), T_ADDRESS, NoAlias, false, StoreNode::unordered); // Clear last_Java_pc and (optionally)_flags ! store_to_memory(NULL, adr_last_Java_pc, null(), T_ADDRESS, NoAlias, false, StoreNode::unordered); #if defined(SPARC) ! store_to_memory(NULL, adr_flags, intcon(0), T_INT, NoAlias, false, StoreNode::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())); ! store_to_memory(NULL, adr_last_Java_fp, null(), T_ADDRESS, NoAlias, false, StoreNode::unordered); #endif // For is-fancy-jump, the C-return value is also the branch target Node* target = map()->in(TypeFunc::Parms); // 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, LoadNode::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, false, StoreNode::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, LoadNode::unordered); Node* exit_memory = reset_memory(); Node* cmp = _gvn.transform( new (C) CmpPNode(pending, null()) ); Node* bo = _gvn.transform( new (C) BoolNode(cmp, BoolTest::ne) );