Mercurial > hg > graal-compiler
comparison src/cpu/x86/vm/x86_32.ad @ 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 | 8a8ff6b577ed |
children | 62c54fcc0a35 |
comparison
equal
deleted
inserted
replaced
17778:a48e16541e6b | 17780:606acabe7b5c |
---|---|
12913 ins_pipe( pipe_jmp ); | 12913 ins_pipe( pipe_jmp ); |
12914 %} | 12914 %} |
12915 | 12915 |
12916 // inlined locking and unlocking | 12916 // inlined locking and unlocking |
12917 | 12917 |
12918 instruct cmpFastLockRTM(eFlagsReg cr, eRegP object, eBXRegP box, eAXRegI tmp, eDXRegI scr, rRegI cx1, rRegI cx2) %{ | |
12919 predicate(Compile::current()->use_rtm()); | |
12920 match(Set cr (FastLock object box)); | |
12921 effect(TEMP tmp, TEMP scr, TEMP cx1, TEMP cx2, USE_KILL box); | |
12922 ins_cost(300); | |
12923 format %{ "FASTLOCK $object,$box\t! kills $box,$tmp,$scr,$cx1,$cx2" %} | |
12924 ins_encode %{ | |
12925 __ fast_lock($object$$Register, $box$$Register, $tmp$$Register, | |
12926 $scr$$Register, $cx1$$Register, $cx2$$Register, | |
12927 _counters, _rtm_counters, _stack_rtm_counters, | |
12928 ((Method*)(ra_->C->method()->constant_encoding()))->method_data(), | |
12929 true, ra_->C->profile_rtm()); | |
12930 %} | |
12931 ins_pipe(pipe_slow); | |
12932 %} | |
12933 | |
12918 instruct cmpFastLock(eFlagsReg cr, eRegP object, eBXRegP box, eAXRegI tmp, eRegP scr) %{ | 12934 instruct cmpFastLock(eFlagsReg cr, eRegP object, eBXRegP box, eAXRegI tmp, eRegP scr) %{ |
12935 predicate(!Compile::current()->use_rtm()); | |
12919 match(Set cr (FastLock object box)); | 12936 match(Set cr (FastLock object box)); |
12920 effect(TEMP tmp, TEMP scr, USE_KILL box); | 12937 effect(TEMP tmp, TEMP scr, USE_KILL box); |
12921 ins_cost(300); | 12938 ins_cost(300); |
12922 format %{ "FASTLOCK $object,$box\t! kills $box,$tmp,$scr" %} | 12939 format %{ "FASTLOCK $object,$box\t! kills $box,$tmp,$scr" %} |
12923 ins_encode %{ | 12940 ins_encode %{ |
12924 __ fast_lock($object$$Register, $box$$Register, $tmp$$Register, $scr$$Register, _counters); | 12941 __ fast_lock($object$$Register, $box$$Register, $tmp$$Register, |
12942 $scr$$Register, noreg, noreg, _counters, NULL, NULL, NULL, false, false); | |
12925 %} | 12943 %} |
12926 ins_pipe(pipe_slow); | 12944 ins_pipe(pipe_slow); |
12927 %} | 12945 %} |
12928 | 12946 |
12929 instruct cmpFastUnlock(eFlagsReg cr, eRegP object, eAXRegP box, eRegP tmp ) %{ | 12947 instruct cmpFastUnlock(eFlagsReg cr, eRegP object, eAXRegP box, eRegP tmp ) %{ |
12930 match(Set cr (FastUnlock object box)); | 12948 match(Set cr (FastUnlock object box)); |
12931 effect(TEMP tmp, USE_KILL box); | 12949 effect(TEMP tmp, USE_KILL box); |
12932 ins_cost(300); | 12950 ins_cost(300); |
12933 format %{ "FASTUNLOCK $object,$box\t! kills $box,$tmp" %} | 12951 format %{ "FASTUNLOCK $object,$box\t! kills $box,$tmp" %} |
12934 ins_encode %{ | 12952 ins_encode %{ |
12935 __ fast_unlock($object$$Register, $box$$Register, $tmp$$Register); | 12953 __ fast_unlock($object$$Register, $box$$Register, $tmp$$Register, ra_->C->use_rtm()); |
12936 %} | 12954 %} |
12937 ins_pipe(pipe_slow); | 12955 ins_pipe(pipe_slow); |
12938 %} | 12956 %} |
12939 | 12957 |
12940 | 12958 |