Mercurial > hg > truffle
comparison src/cpu/x86/vm/assembler_x86.cpp @ 2415:09f96c3ff1ad
7032388: guarantee(VM_Version::supports_cmov()) failed: illegal instruction on i586 after 6919934
Summary: 6919934 added some unguarded cmov instructions which hit a guarantee on older hardware.
Reviewed-by: never, iveresov, kvn, phh
author | twisti |
---|---|
date | Thu, 31 Mar 2011 00:27:08 -0700 |
parents | b40d4fa697bf |
children | d86923d96dca 92add02409c9 |
comparison
equal
deleted
inserted
replaced
2414:9d343b8113db | 2415:09f96c3ff1ad |
---|---|
7767 lea(rscratch1, src); | 7767 lea(rscratch1, src); |
7768 xorps(dst, Address(rscratch1, 0)); | 7768 xorps(dst, Address(rscratch1, 0)); |
7769 } | 7769 } |
7770 } | 7770 } |
7771 | 7771 |
7772 void MacroAssembler::cmov32(Condition cc, Register dst, Address src) { | |
7773 if (VM_Version::supports_cmov()) { | |
7774 cmovl(cc, dst, src); | |
7775 } else { | |
7776 Label L; | |
7777 jccb(negate_condition(cc), L); | |
7778 movl(dst, src); | |
7779 bind(L); | |
7780 } | |
7781 } | |
7782 | |
7783 void MacroAssembler::cmov32(Condition cc, Register dst, Register src) { | |
7784 if (VM_Version::supports_cmov()) { | |
7785 cmovl(cc, dst, src); | |
7786 } else { | |
7787 Label L; | |
7788 jccb(negate_condition(cc), L); | |
7789 movl(dst, src); | |
7790 bind(L); | |
7791 } | |
7792 } | |
7793 | |
7772 void MacroAssembler::verify_oop(Register reg, const char* s) { | 7794 void MacroAssembler::verify_oop(Register reg, const char* s) { |
7773 if (!VerifyOops) return; | 7795 if (!VerifyOops) return; |
7774 | 7796 |
7775 // Pass register number to verify_oop_subroutine | 7797 // Pass register number to verify_oop_subroutine |
7776 char* b = new char[strlen(s) + 50]; | 7798 char* b = new char[strlen(s) + 50]; |
9017 // difference of the string lengths (stack). | 9039 // difference of the string lengths (stack). |
9018 // Do the conditional move stuff | 9040 // Do the conditional move stuff |
9019 movl(result, cnt1); | 9041 movl(result, cnt1); |
9020 subl(cnt1, cnt2); | 9042 subl(cnt1, cnt2); |
9021 push(cnt1); | 9043 push(cnt1); |
9022 if (VM_Version::supports_cmov()) { | 9044 cmov32(Assembler::lessEqual, cnt2, result); |
9023 cmovl(Assembler::lessEqual, cnt2, result); | |
9024 } else { | |
9025 Label GT_LABEL; | |
9026 jccb(Assembler::greater, GT_LABEL); | |
9027 movl(cnt2, result); | |
9028 bind(GT_LABEL); | |
9029 } | |
9030 | 9045 |
9031 // Is the minimum length zero? | 9046 // Is the minimum length zero? |
9032 testl(cnt2, cnt2); | 9047 testl(cnt2, cnt2); |
9033 jcc(Assembler::zero, LENGTH_DIFF_LABEL); | 9048 jcc(Assembler::zero, LENGTH_DIFF_LABEL); |
9034 | 9049 |