Mercurial > hg > truffle
comparison src/cpu/x86/vm/templateTable_x86_32.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 |
---|---|
294 } | 294 } |
295 | 295 |
296 | 296 |
297 void TemplateTable::sipush() { | 297 void TemplateTable::sipush() { |
298 transition(vtos, itos); | 298 transition(vtos, itos); |
299 __ load_unsigned_word(rax, at_bcp(1)); | 299 __ load_unsigned_short(rax, at_bcp(1)); |
300 __ bswapl(rax); | 300 __ bswapl(rax); |
301 __ sarl(rax, 16); | 301 __ sarl(rax, 16); |
302 } | 302 } |
303 | 303 |
304 void TemplateTable::ldc(bool wide) { | 304 void TemplateTable::ldc(bool wide) { |
660 transition(itos, itos); | 660 transition(itos, itos); |
661 // rdx: array | 661 // rdx: array |
662 index_check(rdx, rax); // kills rbx, | 662 index_check(rdx, rax); // kills rbx, |
663 // rax,: index | 663 // rax,: index |
664 // can do better code for P5 - may want to improve this at some point | 664 // can do better code for P5 - may want to improve this at some point |
665 __ load_unsigned_word(rbx, Address(rdx, rax, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_CHAR))); | 665 __ load_unsigned_short(rbx, Address(rdx, rax, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_CHAR))); |
666 __ mov(rax, rbx); | 666 __ mov(rax, rbx); |
667 } | 667 } |
668 | 668 |
669 // iload followed by caload frequent pair | 669 // iload followed by caload frequent pair |
670 void TemplateTable::fast_icaload() { | 670 void TemplateTable::fast_icaload() { |
675 debug_only(__ verify_local_tag(frame::TagValue, rbx)); | 675 debug_only(__ verify_local_tag(frame::TagValue, rbx)); |
676 | 676 |
677 // rdx: array | 677 // rdx: array |
678 index_check(rdx, rax); | 678 index_check(rdx, rax); |
679 // rax,: index | 679 // rax,: index |
680 __ load_unsigned_word(rbx, Address(rdx, rax, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_CHAR))); | 680 __ load_unsigned_short(rbx, Address(rdx, rax, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_CHAR))); |
681 __ mov(rax, rbx); | 681 __ mov(rax, rbx); |
682 } | 682 } |
683 | 683 |
684 void TemplateTable::saload() { | 684 void TemplateTable::saload() { |
685 transition(itos, itos); | 685 transition(itos, itos); |
686 // rdx: array | 686 // rdx: array |
687 index_check(rdx, rax); // kills rbx, | 687 index_check(rdx, rax); // kills rbx, |
688 // rax,: index | 688 // rax,: index |
689 // can do better code for P5 - may want to improve this at some point | 689 // can do better code for P5 - may want to improve this at some point |
690 __ load_signed_word(rbx, Address(rdx, rax, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_SHORT))); | 690 __ load_signed_short(rbx, Address(rdx, rax, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_SHORT))); |
691 __ mov(rax, rbx); | 691 __ mov(rax, rbx); |
692 } | 692 } |
693 | 693 |
694 | 694 |
695 void TemplateTable::iload(int n) { | 695 void TemplateTable::iload(int n) { |
2308 __ bind(notObj); | 2308 __ bind(notObj); |
2309 // ctos | 2309 // ctos |
2310 __ cmpl(flags, ctos ); | 2310 __ cmpl(flags, ctos ); |
2311 __ jcc(Assembler::notEqual, notChar); | 2311 __ jcc(Assembler::notEqual, notChar); |
2312 | 2312 |
2313 __ load_unsigned_word(rax, lo ); | 2313 __ load_unsigned_short(rax, lo ); |
2314 __ push(ctos); | 2314 __ push(ctos); |
2315 if (!is_static) { | 2315 if (!is_static) { |
2316 patch_bytecode(Bytecodes::_fast_cgetfield, rcx, rbx); | 2316 patch_bytecode(Bytecodes::_fast_cgetfield, rcx, rbx); |
2317 } | 2317 } |
2318 __ jmp(Done); | 2318 __ jmp(Done); |
2320 __ bind(notChar); | 2320 __ bind(notChar); |
2321 // stos | 2321 // stos |
2322 __ cmpl(flags, stos ); | 2322 __ cmpl(flags, stos ); |
2323 __ jcc(Assembler::notEqual, notShort); | 2323 __ jcc(Assembler::notEqual, notShort); |
2324 | 2324 |
2325 __ load_signed_word(rax, lo ); | 2325 __ load_signed_short(rax, lo ); |
2326 __ push(stos); | 2326 __ push(stos); |
2327 if (!is_static) { | 2327 if (!is_static) { |
2328 patch_bytecode(Bytecodes::_fast_sgetfield, rcx, rbx); | 2328 patch_bytecode(Bytecodes::_fast_sgetfield, rcx, rbx); |
2329 } | 2329 } |
2330 __ jmp(Done); | 2330 __ jmp(Done); |
2828 const Address hi = Address(rax, rbx, Address::times_1, 1*wordSize); | 2828 const Address hi = Address(rax, rbx, Address::times_1, 1*wordSize); |
2829 | 2829 |
2830 // access field | 2830 // access field |
2831 switch (bytecode()) { | 2831 switch (bytecode()) { |
2832 case Bytecodes::_fast_bgetfield: __ movsbl(rax, lo ); break; | 2832 case Bytecodes::_fast_bgetfield: __ movsbl(rax, lo ); break; |
2833 case Bytecodes::_fast_sgetfield: __ load_signed_word(rax, lo ); break; | 2833 case Bytecodes::_fast_sgetfield: __ load_signed_short(rax, lo ); break; |
2834 case Bytecodes::_fast_cgetfield: __ load_unsigned_word(rax, lo ); break; | 2834 case Bytecodes::_fast_cgetfield: __ load_unsigned_short(rax, lo ); break; |
2835 case Bytecodes::_fast_igetfield: __ movl(rax, lo); break; | 2835 case Bytecodes::_fast_igetfield: __ movl(rax, lo); break; |
2836 case Bytecodes::_fast_lgetfield: __ stop("should not be rewritten"); break; | 2836 case Bytecodes::_fast_lgetfield: __ stop("should not be rewritten"); break; |
2837 case Bytecodes::_fast_fgetfield: __ fld_s(lo); break; | 2837 case Bytecodes::_fast_fgetfield: __ fld_s(lo); break; |
2838 case Bytecodes::_fast_dgetfield: __ fld_d(lo); break; | 2838 case Bytecodes::_fast_dgetfield: __ fld_d(lo); break; |
2839 case Bytecodes::_fast_agetfield: __ movptr(rax, lo); __ verify_oop(rax); break; | 2839 case Bytecodes::_fast_agetfield: __ movptr(rax, lo); __ verify_oop(rax); break; |