Mercurial > hg > truffle
comparison src/share/vm/opto/library_call.cpp @ 14654:2edca307b15a
8036102: part of the fix for 6498581 lost in mismerge
Summary: Restore code lost in mis-merge
Reviewed-by: dcubed
author | dsamersoff |
---|---|
date | Sat, 01 Mar 2014 09:56:15 -0800 |
parents | ef7328717719 |
children | 92aa6797d639 |
comparison
equal
deleted
inserted
replaced
14653:0d8d78c0329a | 14654:2edca307b15a |
---|---|
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() && (!TLS._osthread._interrupted || !clear_int)) | 3183 // (t == Thread.current() && |
3184 // (!TLS._osthread._interrupted || WINDOWS_ONLY(false) NOT_WINDOWS(!clear_int))) | |
3184 // ? TLS._osthread._interrupted : /*slow path:*/ t.isInterrupted(clear_int) | 3185 // ? TLS._osthread._interrupted : /*slow path:*/ t.isInterrupted(clear_int) |
3185 // So, in the common case that the interrupt bit is false, | 3186 // So, in the common case that the interrupt bit is false, |
3186 // we avoid making a call into the VM. Even if the interrupt bit | 3187 // we avoid making a call into the VM. Even if the interrupt bit |
3187 // is true, if the clear_int argument is false, we avoid the VM call. | 3188 // is true, if the clear_int argument is false, we avoid the VM call. |
3188 // However, if the receiver is not currentThread, we must call the VM, | 3189 // However, if the receiver is not currentThread, we must call the VM, |
3235 result_val->init_req(no_int_result_path, intcon(0)); | 3236 result_val->init_req(no_int_result_path, intcon(0)); |
3236 | 3237 |
3237 // drop through to next case | 3238 // drop through to next case |
3238 set_control( _gvn.transform(new (C) IfTrueNode(iff_bit))); | 3239 set_control( _gvn.transform(new (C) IfTrueNode(iff_bit))); |
3239 | 3240 |
3241 #ifndef TARGET_OS_FAMILY_windows | |
3240 // (c) Or, if interrupt bit is set and clear_int is false, use 2nd fast path. | 3242 // (c) Or, if interrupt bit is set and clear_int is false, use 2nd fast path. |
3241 Node* clr_arg = argument(1); | 3243 Node* clr_arg = argument(1); |
3242 Node* cmp_arg = _gvn.transform(new (C) CmpINode(clr_arg, intcon(0))); | 3244 Node* cmp_arg = _gvn.transform(new (C) CmpINode(clr_arg, intcon(0))); |
3243 Node* bol_arg = _gvn.transform(new (C) BoolNode(cmp_arg, BoolTest::ne)); | 3245 Node* bol_arg = _gvn.transform(new (C) BoolNode(cmp_arg, BoolTest::ne)); |
3244 IfNode* iff_arg = create_and_map_if(control(), bol_arg, PROB_FAIR, COUNT_UNKNOWN); | 3246 IfNode* iff_arg = create_and_map_if(control(), bol_arg, PROB_FAIR, COUNT_UNKNOWN); |
3248 result_rgn->init_req(no_clear_result_path, false_arg); | 3250 result_rgn->init_req(no_clear_result_path, false_arg); |
3249 result_val->init_req(no_clear_result_path, intcon(1)); | 3251 result_val->init_req(no_clear_result_path, intcon(1)); |
3250 | 3252 |
3251 // drop through to next case | 3253 // drop through to next case |
3252 set_control( _gvn.transform(new (C) IfTrueNode(iff_arg))); | 3254 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 | |
3253 | 3259 |
3254 // (d) Otherwise, go to the slow path. | 3260 // (d) Otherwise, go to the slow path. |
3255 slow_region->add_req(control()); | 3261 slow_region->add_req(control()); |
3256 set_control( _gvn.transform(slow_region)); | 3262 set_control( _gvn.transform(slow_region)); |
3257 | 3263 |