Mercurial > hg > truffle
comparison src/cpu/x86/vm/templateTable_x86_64.cpp @ 622:56aae7be60d4
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
Summary: minor assembler enhancements preparing for method handles
Reviewed-by: kvn
author | jrose |
---|---|
date | Wed, 04 Mar 2009 09:58:39 -0800 |
parents | 98cb887364d3 |
children | 9adddb8c0fc8 |
comparison
equal
deleted
inserted
replaced
621:19f25e603e7b | 622:56aae7be60d4 |
---|---|
305 __ load_signed_byte(rax, at_bcp(1)); | 305 __ load_signed_byte(rax, at_bcp(1)); |
306 } | 306 } |
307 | 307 |
308 void TemplateTable::sipush() { | 308 void TemplateTable::sipush() { |
309 transition(vtos, itos); | 309 transition(vtos, itos); |
310 __ load_unsigned_word(rax, at_bcp(1)); | 310 __ load_unsigned_short(rax, at_bcp(1)); |
311 __ bswapl(rax); | 311 __ bswapl(rax); |
312 __ sarl(rax, 16); | 312 __ sarl(rax, 16); |
313 } | 313 } |
314 | 314 |
315 void TemplateTable::ldc(bool wide) { | 315 void TemplateTable::ldc(bool wide) { |
643 transition(itos, itos); | 643 transition(itos, itos); |
644 __ pop_ptr(rdx); | 644 __ pop_ptr(rdx); |
645 // eax: index | 645 // eax: index |
646 // rdx: array | 646 // rdx: array |
647 index_check(rdx, rax); // kills rbx | 647 index_check(rdx, rax); // kills rbx |
648 __ load_unsigned_word(rax, | 648 __ load_unsigned_short(rax, |
649 Address(rdx, rax, | 649 Address(rdx, rax, |
650 Address::times_2, | 650 Address::times_2, |
651 arrayOopDesc::base_offset_in_bytes(T_CHAR))); | 651 arrayOopDesc::base_offset_in_bytes(T_CHAR))); |
652 } | 652 } |
653 | 653 |
654 // iload followed by caload frequent pair | 654 // iload followed by caload frequent pair |
655 void TemplateTable::fast_icaload() { | 655 void TemplateTable::fast_icaload() { |
656 transition(vtos, itos); | 656 transition(vtos, itos); |
661 | 661 |
662 // eax: index | 662 // eax: index |
663 // rdx: array | 663 // rdx: array |
664 __ pop_ptr(rdx); | 664 __ pop_ptr(rdx); |
665 index_check(rdx, rax); // kills rbx | 665 index_check(rdx, rax); // kills rbx |
666 __ load_unsigned_word(rax, | 666 __ load_unsigned_short(rax, |
667 Address(rdx, rax, | 667 Address(rdx, rax, |
668 Address::times_2, | 668 Address::times_2, |
669 arrayOopDesc::base_offset_in_bytes(T_CHAR))); | 669 arrayOopDesc::base_offset_in_bytes(T_CHAR))); |
670 } | 670 } |
671 | 671 |
672 void TemplateTable::saload() { | 672 void TemplateTable::saload() { |
673 transition(itos, itos); | 673 transition(itos, itos); |
674 __ pop_ptr(rdx); | 674 __ pop_ptr(rdx); |
675 // eax: index | 675 // eax: index |
676 // rdx: array | 676 // rdx: array |
677 index_check(rdx, rax); // kills rbx | 677 index_check(rdx, rax); // kills rbx |
678 __ load_signed_word(rax, | 678 __ load_signed_short(rax, |
679 Address(rdx, rax, | 679 Address(rdx, rax, |
680 Address::times_2, | 680 Address::times_2, |
681 arrayOopDesc::base_offset_in_bytes(T_SHORT))); | 681 arrayOopDesc::base_offset_in_bytes(T_SHORT))); |
682 } | 682 } |
683 | 683 |
684 void TemplateTable::iload(int n) { | 684 void TemplateTable::iload(int n) { |
685 transition(vtos, itos); | 685 transition(vtos, itos); |
686 __ movl(rax, iaddress(n)); | 686 __ movl(rax, iaddress(n)); |
2274 | 2274 |
2275 __ bind(notInt); | 2275 __ bind(notInt); |
2276 __ cmpl(flags, ctos); | 2276 __ cmpl(flags, ctos); |
2277 __ jcc(Assembler::notEqual, notChar); | 2277 __ jcc(Assembler::notEqual, notChar); |
2278 // ctos | 2278 // ctos |
2279 __ load_unsigned_word(rax, field); | 2279 __ load_unsigned_short(rax, field); |
2280 __ push(ctos); | 2280 __ push(ctos); |
2281 // Rewrite bytecode to be faster | 2281 // Rewrite bytecode to be faster |
2282 if (!is_static) { | 2282 if (!is_static) { |
2283 patch_bytecode(Bytecodes::_fast_cgetfield, bc, rbx); | 2283 patch_bytecode(Bytecodes::_fast_cgetfield, bc, rbx); |
2284 } | 2284 } |
2286 | 2286 |
2287 __ bind(notChar); | 2287 __ bind(notChar); |
2288 __ cmpl(flags, stos); | 2288 __ cmpl(flags, stos); |
2289 __ jcc(Assembler::notEqual, notShort); | 2289 __ jcc(Assembler::notEqual, notShort); |
2290 // stos | 2290 // stos |
2291 __ load_signed_word(rax, field); | 2291 __ load_signed_short(rax, field); |
2292 __ push(stos); | 2292 __ push(stos); |
2293 // Rewrite bytecode to be faster | 2293 // Rewrite bytecode to be faster |
2294 if (!is_static) { | 2294 if (!is_static) { |
2295 patch_bytecode(Bytecodes::_fast_sgetfield, bc, rbx); | 2295 patch_bytecode(Bytecodes::_fast_sgetfield, bc, rbx); |
2296 } | 2296 } |
2749 break; | 2749 break; |
2750 case Bytecodes::_fast_bgetfield: | 2750 case Bytecodes::_fast_bgetfield: |
2751 __ movsbl(rax, field); | 2751 __ movsbl(rax, field); |
2752 break; | 2752 break; |
2753 case Bytecodes::_fast_sgetfield: | 2753 case Bytecodes::_fast_sgetfield: |
2754 __ load_signed_word(rax, field); | 2754 __ load_signed_short(rax, field); |
2755 break; | 2755 break; |
2756 case Bytecodes::_fast_cgetfield: | 2756 case Bytecodes::_fast_cgetfield: |
2757 __ load_unsigned_word(rax, field); | 2757 __ load_unsigned_short(rax, field); |
2758 break; | 2758 break; |
2759 case Bytecodes::_fast_fgetfield: | 2759 case Bytecodes::_fast_fgetfield: |
2760 __ movflt(xmm0, field); | 2760 __ movflt(xmm0, field); |
2761 break; | 2761 break; |
2762 case Bytecodes::_fast_dgetfield: | 2762 case Bytecodes::_fast_dgetfield: |