Mercurial > hg > graal-jvmci-8
comparison src/cpu/x86/vm/sharedRuntime_x86_64.cpp @ 17780:606acabe7b5c
8031320: Use Intel RTM instructions for locks
Summary: Use RTM for inflated locks and stack locks.
Reviewed-by: iveresov, twisti, roland, dcubed
author | kvn |
---|---|
date | Thu, 20 Mar 2014 17:49:27 -0700 |
parents | 55fb97c4c58d |
children | 62c54fcc0a35 |
comparison
equal
deleted
inserted
replaced
17778:a48e16541e6b | 17780:606acabe7b5c |
---|---|
2008 __ subptr(rsp, stack_size - 2*wordSize); | 2008 __ subptr(rsp, stack_size - 2*wordSize); |
2009 | 2009 |
2010 // Frame is now completed as far as size and linkage. | 2010 // Frame is now completed as far as size and linkage. |
2011 int frame_complete = ((intptr_t)__ pc()) - start; | 2011 int frame_complete = ((intptr_t)__ pc()) - start; |
2012 | 2012 |
2013 if (UseRTMLocking) { | |
2014 // Abort RTM transaction before calling JNI | |
2015 // because critical section will be large and will be | |
2016 // aborted anyway. Also nmethod could be deoptimized. | |
2017 __ xabort(0); | |
2018 } | |
2019 | |
2013 #ifdef ASSERT | 2020 #ifdef ASSERT |
2014 { | 2021 { |
2015 Label L; | 2022 Label L; |
2016 __ mov(rax, rsp); | 2023 __ mov(rax, rsp); |
2017 __ andptr(rax, -16); // must be 16 byte boundary (see amd64 ABI) | 2024 __ andptr(rax, -16); // must be 16 byte boundary (see amd64 ABI) |
3608 | 3615 |
3609 assert(SimpleRuntimeFrame::framesize % 4 == 0, "sp not 16-byte aligned"); | 3616 assert(SimpleRuntimeFrame::framesize % 4 == 0, "sp not 16-byte aligned"); |
3610 | 3617 |
3611 address start = __ pc(); | 3618 address start = __ pc(); |
3612 | 3619 |
3620 if (UseRTMLocking) { | |
3621 // Abort RTM transaction before possible nmethod deoptimization. | |
3622 __ xabort(0); | |
3623 } | |
3624 | |
3613 // Push self-frame. We get here with a return address on the | 3625 // Push self-frame. We get here with a return address on the |
3614 // stack, so rsp is 8-byte aligned until we allocate our frame. | 3626 // stack, so rsp is 8-byte aligned until we allocate our frame. |
3615 __ subptr(rsp, SimpleRuntimeFrame::return_off << LogBytesPerInt); // Epilog! | 3627 __ subptr(rsp, SimpleRuntimeFrame::return_off << LogBytesPerInt); // Epilog! |
3616 | 3628 |
3617 // No callee saved registers. rbp is assumed implicitly saved | 3629 // No callee saved registers. rbp is assumed implicitly saved |
3787 address start = __ pc(); | 3799 address start = __ pc(); |
3788 address call_pc = NULL; | 3800 address call_pc = NULL; |
3789 int frame_size_in_words; | 3801 int frame_size_in_words; |
3790 bool cause_return = (poll_type == POLL_AT_RETURN); | 3802 bool cause_return = (poll_type == POLL_AT_RETURN); |
3791 bool save_vectors = (poll_type == POLL_AT_VECTOR_LOOP); | 3803 bool save_vectors = (poll_type == POLL_AT_VECTOR_LOOP); |
3804 | |
3805 if (UseRTMLocking) { | |
3806 // Abort RTM transaction before calling runtime | |
3807 // because critical section will be large and will be | |
3808 // aborted anyway. Also nmethod could be deoptimized. | |
3809 __ xabort(0); | |
3810 } | |
3792 | 3811 |
3793 // Make room for return address (or push it again) | 3812 // Make room for return address (or push it again) |
3794 if (!cause_return) { | 3813 if (!cause_return) { |
3795 __ push(rbx); | 3814 __ push(rbx); |
3796 } | 3815 } |