src/share/vm/opto/library_call.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File
*** old/src/share/vm/opto/library_call.cpp	Fri Dec 14 01:02:53 2012
--- new/src/share/vm/opto/library_call.cpp	Fri Dec 14 01:02:52 2012

*** 2950,2983 **** --- 2950,2991 ---- // However, if the receiver is not currentThread, we must call the VM, // because there must be some locking done around the operation. // We only go to the fast case code if we pass two guards. // Paths which do not pass are accumulated in the slow_region. + + insert_mem_bar(Op_MemBarCPUOrder); + + enum { + no_int_result_path = 1, // t == Thread.current() && TLS._osthread._interrupted + no_clear_result_path = 2, // t == Thread.current() && !TLS._osthread._interrupted && !clear_int + slow_result_path = 3, // slow path: t.isInterrupted(clear_int) + PATH_LIMIT + }; + + RegionNode* result_rgn = new (C) RegionNode(PATH_LIMIT); + PhiNode* result_val = new (C) PhiNode(result_rgn, TypeInt::BOOL); + RegionNode* slow_region = new (C) RegionNode(1); record_for_igvn(slow_region); RegionNode* result_rgn = new (C) RegionNode(1+3); // fast1, fast2, slow PhiNode* result_val = new (C) PhiNode(result_rgn, TypeInt::BOOL); enum { no_int_result_path = 1, no_clear_result_path = 2, slow_result_path = 3 }; // (a) Receiving thread must be the current thread. Node* rec_thr = argument(0); Node* tls_ptr = NULL; Node* cur_thr = generate_current_thread(tls_ptr); Node* cmp_thr = _gvn.transform( new (C) CmpPNode(cur_thr, rec_thr) ); Node* bol_thr = _gvn.transform( new (C) BoolNode(cmp_thr, BoolTest::ne) ); bool known_current_thread = (_gvn.type(bol_thr) == TypeInt::ZERO); if (!known_current_thread) + generate_slow_guard(bol_thr, slow_region); // (b) Interrupt bit on TLS must be false. Node* p = basic_plus_adr(top()/*!oop*/, tls_ptr, in_bytes(JavaThread::osthread_offset())); Node* osthread = make_load(NULL, p, TypeRawPtr::NOTNULL, T_ADDRESS); p = basic_plus_adr(top()/*!oop*/, osthread, in_bytes(OSThread::interrupted_offset())); + // Set the control input on the field _interrupted read to prevent it floating up. Node* int_bit = make_load(control(), p, TypeInt::BOOL, T_INT); Node* cmp_bit = _gvn.transform( new (C) CmpINode(int_bit, intcon(0)) ); Node* bol_bit = _gvn.transform( new (C) BoolNode(cmp_bit, BoolTest::ne) );
*** 3019,3043 **** --- 3027,3053 ---- Node* slow_val = set_results_for_java_call(slow_call); // this->control() comes from set_results_for_java_call // If we know that the result of the slow call will be true, tell the optimizer! - if (known_current_thread) slow_val = intcon(1); + slow_val = intcon(1); Node* fast_io = slow_call->in(TypeFunc::I_O); Node* fast_mem = slow_call->in(TypeFunc::Memory); + // These two phis are pre-filled with copies of of the fast IO and Memory ! Node* io_phi = PhiNode::make(result_rgn, fast_io, Type::ABIO); ! Node* mem_phi = PhiNode::make(result_rgn, fast_mem, Type::MEMORY, TypePtr::BOTTOM); ! PhiNode* result_mem = PhiNode::make(result_rgn, fast_mem, Type::MEMORY, TypePtr::BOTTOM); ! PhiNode* result_io = PhiNode::make(result_rgn, fast_io, Type::ABIO); result_rgn->init_req(slow_result_path, control()); ! io_phi ->init_req(slow_result_path, i_o()); ! mem_phi ->init_req(slow_result_path, reset_memory()); ! result_io ->init_req(slow_result_path, i_o()); ! result_mem->init_req(slow_result_path, reset_memory()); result_val->init_req(slow_result_path, slow_val); ! set_all_memory( _gvn.transform(mem_phi) ); ! set_i_o( _gvn.transform(io_phi) ); ! set_all_memory(_gvn.transform(result_mem)); ! set_i_o( _gvn.transform(result_io)); } C->set_has_split_ifs(true); // Has chance for split-if optimization set_result(result_rgn, result_val); return true;

src/share/vm/opto/library_call.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File