comparison src/share/vm/opto/library_call.cpp @ 14726:92aa6797d639

Backed out merge changeset: b51e29501f30 Backed out merge revision to its first parent (8f483e200405)
author Doug Simon <doug.simon@oracle.com>
date Mon, 24 Mar 2014 21:30:43 +0100
parents 2edca307b15a
children
comparison
equal deleted inserted replaced
14719:0bdd0d157040 14726:92aa6797d639
3178 3178
3179 //------------------------inline_native_isInterrupted------------------ 3179 //------------------------inline_native_isInterrupted------------------
3180 // private native boolean java.lang.Thread.isInterrupted(boolean ClearInterrupted); 3180 // private native boolean java.lang.Thread.isInterrupted(boolean ClearInterrupted);
3181 bool LibraryCallKit::inline_native_isInterrupted() { 3181 bool LibraryCallKit::inline_native_isInterrupted() {
3182 // Add a fast path to t.isInterrupted(clear_int): 3182 // Add a fast path to t.isInterrupted(clear_int):
3183 // (t == Thread.current() && 3183 // (t == Thread.current() && (!TLS._osthread._interrupted || !clear_int))
3184 // (!TLS._osthread._interrupted || WINDOWS_ONLY(false) NOT_WINDOWS(!clear_int)))
3185 // ? TLS._osthread._interrupted : /*slow path:*/ t.isInterrupted(clear_int) 3184 // ? TLS._osthread._interrupted : /*slow path:*/ t.isInterrupted(clear_int)
3186 // So, in the common case that the interrupt bit is false, 3185 // So, in the common case that the interrupt bit is false,
3187 // we avoid making a call into the VM. Even if the interrupt bit 3186 // we avoid making a call into the VM. Even if the interrupt bit
3188 // is true, if the clear_int argument is false, we avoid the VM call. 3187 // is true, if the clear_int argument is false, we avoid the VM call.
3189 // However, if the receiver is not currentThread, we must call the VM, 3188 // However, if the receiver is not currentThread, we must call the VM,
3236 result_val->init_req(no_int_result_path, intcon(0)); 3235 result_val->init_req(no_int_result_path, intcon(0));
3237 3236
3238 // drop through to next case 3237 // drop through to next case
3239 set_control( _gvn.transform(new (C) IfTrueNode(iff_bit))); 3238 set_control( _gvn.transform(new (C) IfTrueNode(iff_bit)));
3240 3239
3241 #ifndef TARGET_OS_FAMILY_windows
3242 // (c) Or, if interrupt bit is set and clear_int is false, use 2nd fast path. 3240 // (c) Or, if interrupt bit is set and clear_int is false, use 2nd fast path.
3243 Node* clr_arg = argument(1); 3241 Node* clr_arg = argument(1);
3244 Node* cmp_arg = _gvn.transform(new (C) CmpINode(clr_arg, intcon(0))); 3242 Node* cmp_arg = _gvn.transform(new (C) CmpINode(clr_arg, intcon(0)));
3245 Node* bol_arg = _gvn.transform(new (C) BoolNode(cmp_arg, BoolTest::ne)); 3243 Node* bol_arg = _gvn.transform(new (C) BoolNode(cmp_arg, BoolTest::ne));
3246 IfNode* iff_arg = create_and_map_if(control(), bol_arg, PROB_FAIR, COUNT_UNKNOWN); 3244 IfNode* iff_arg = create_and_map_if(control(), bol_arg, PROB_FAIR, COUNT_UNKNOWN);
3250 result_rgn->init_req(no_clear_result_path, false_arg); 3248 result_rgn->init_req(no_clear_result_path, false_arg);
3251 result_val->init_req(no_clear_result_path, intcon(1)); 3249 result_val->init_req(no_clear_result_path, intcon(1));
3252 3250
3253 // drop through to next case 3251 // drop through to next case
3254 set_control( _gvn.transform(new (C) IfTrueNode(iff_arg))); 3252 set_control( _gvn.transform(new (C) IfTrueNode(iff_arg)));
3255 #else
3256 // To return true on Windows you must read the _interrupted field
3257 // and check the the event state i.e. take the slow path.
3258 #endif // TARGET_OS_FAMILY_windows
3259 3253
3260 // (d) Otherwise, go to the slow path. 3254 // (d) Otherwise, go to the slow path.
3261 slow_region->add_req(control()); 3255 slow_region->add_req(control());
3262 set_control( _gvn.transform(slow_region)); 3256 set_control( _gvn.transform(slow_region));
3263 3257