Mercurial > hg > graal-jvmci-8
comparison src/cpu/sparc/vm/assembler_sparc.inline.hpp @ 4059:44ce519bc3d1
7104960: JSR 292: +VerifyMethodHandles in product JVM can overflow buffer
Reviewed-by: kvn, jrose, twisti
author | never |
---|---|
date | Tue, 08 Nov 2011 10:31:53 -0800 |
parents | 3d42f82cd811 |
children | 0382d2b469b2 |
comparison
equal
deleted
inserted
replaced
4058:59e515ee9354 | 4059:44ce519bc3d1 |
---|---|
595 | 595 |
596 inline void MacroAssembler::jmp( Register s1, Register s2 ) { jmpl( s1, s2, G0 ); } | 596 inline void MacroAssembler::jmp( Register s1, Register s2 ) { jmpl( s1, s2, G0 ); } |
597 inline void MacroAssembler::jmp( Register s1, int simm13a, RelocationHolder const& rspec ) { jmpl( s1, simm13a, G0, rspec); } | 597 inline void MacroAssembler::jmp( Register s1, int simm13a, RelocationHolder const& rspec ) { jmpl( s1, simm13a, G0, rspec); } |
598 | 598 |
599 inline bool MacroAssembler::is_far_target(address d) { | 599 inline bool MacroAssembler::is_far_target(address d) { |
600 if (ForceUnreachable) { | |
601 // References outside the code cache should be treated as far | |
602 return d < CodeCache::low_bound() || d > CodeCache::high_bound(); | |
603 } | |
600 return !is_in_wdisp30_range(d, CodeCache::low_bound()) || !is_in_wdisp30_range(d, CodeCache::high_bound()); | 604 return !is_in_wdisp30_range(d, CodeCache::low_bound()) || !is_in_wdisp30_range(d, CodeCache::high_bound()); |
601 } | 605 } |
602 | 606 |
603 // Call with a check to see if we need to deal with the added | 607 // Call with a check to see if we need to deal with the added |
604 // expense of relocation and if we overflow the displacement | 608 // expense of relocation and if we overflow the displacement |
677 } | 681 } |
678 | 682 |
679 | 683 |
680 inline void MacroAssembler::load_contents(const AddressLiteral& addrlit, Register d, int offset) { | 684 inline void MacroAssembler::load_contents(const AddressLiteral& addrlit, Register d, int offset) { |
681 assert_not_delayed(); | 685 assert_not_delayed(); |
682 sethi(addrlit, d); | 686 if (ForceUnreachable) { |
687 patchable_sethi(addrlit, d); | |
688 } else { | |
689 sethi(addrlit, d); | |
690 } | |
683 ld(d, addrlit.low10() + offset, d); | 691 ld(d, addrlit.low10() + offset, d); |
684 } | 692 } |
685 | 693 |
686 | 694 |
687 inline void MacroAssembler::load_ptr_contents(const AddressLiteral& addrlit, Register d, int offset) { | 695 inline void MacroAssembler::load_ptr_contents(const AddressLiteral& addrlit, Register d, int offset) { |
688 assert_not_delayed(); | 696 assert_not_delayed(); |
689 sethi(addrlit, d); | 697 if (ForceUnreachable) { |
698 patchable_sethi(addrlit, d); | |
699 } else { | |
700 sethi(addrlit, d); | |
701 } | |
690 ld_ptr(d, addrlit.low10() + offset, d); | 702 ld_ptr(d, addrlit.low10() + offset, d); |
691 } | 703 } |
692 | 704 |
693 | 705 |
694 inline void MacroAssembler::store_contents(Register s, const AddressLiteral& addrlit, Register temp, int offset) { | 706 inline void MacroAssembler::store_contents(Register s, const AddressLiteral& addrlit, Register temp, int offset) { |
695 assert_not_delayed(); | 707 assert_not_delayed(); |
696 sethi(addrlit, temp); | 708 if (ForceUnreachable) { |
709 patchable_sethi(addrlit, temp); | |
710 } else { | |
711 sethi(addrlit, temp); | |
712 } | |
697 st(s, temp, addrlit.low10() + offset); | 713 st(s, temp, addrlit.low10() + offset); |
698 } | 714 } |
699 | 715 |
700 | 716 |
701 inline void MacroAssembler::store_ptr_contents(Register s, const AddressLiteral& addrlit, Register temp, int offset) { | 717 inline void MacroAssembler::store_ptr_contents(Register s, const AddressLiteral& addrlit, Register temp, int offset) { |
702 assert_not_delayed(); | 718 assert_not_delayed(); |
703 sethi(addrlit, temp); | 719 if (ForceUnreachable) { |
720 patchable_sethi(addrlit, temp); | |
721 } else { | |
722 sethi(addrlit, temp); | |
723 } | |
704 st_ptr(s, temp, addrlit.low10() + offset); | 724 st_ptr(s, temp, addrlit.low10() + offset); |
705 } | 725 } |
706 | 726 |
707 | 727 |
708 // This code sequence is relocatable to any address, even on LP64. | 728 // This code sequence is relocatable to any address, even on LP64. |