Mercurial > hg > graal-jvmci-8
comparison src/share/vm/code/relocInfo.cpp @ 14456:abec000618bf
Merge
author | kvn |
---|---|
date | Tue, 28 Jan 2014 12:25:34 -0800 |
parents | de6a9e811145 53fa76359eb1 |
children | d8041d695d19 78bbf4d43a14 |
comparison
equal
deleted
inserted
replaced
14269:2a8891e0a082 | 14456:abec000618bf |
---|---|
580 void static_stub_Relocation::unpack_data() { | 580 void static_stub_Relocation::unpack_data() { |
581 address base = binding()->section_start(CodeBuffer::SECT_INSTS); | 581 address base = binding()->section_start(CodeBuffer::SECT_INSTS); |
582 _static_call = address_from_scaled_offset(unpack_1_int(), base); | 582 _static_call = address_from_scaled_offset(unpack_1_int(), base); |
583 } | 583 } |
584 | 584 |
585 void trampoline_stub_Relocation::pack_data_to(CodeSection* dest ) { | |
586 short* p = (short*) dest->locs_end(); | |
587 CodeSection* insts = dest->outer()->insts(); | |
588 normalize_address(_owner, insts); | |
589 p = pack_1_int_to(p, scaled_offset(_owner, insts->start())); | |
590 dest->set_locs_end((relocInfo*) p); | |
591 } | |
592 | |
593 void trampoline_stub_Relocation::unpack_data() { | |
594 address base = binding()->section_start(CodeBuffer::SECT_INSTS); | |
595 _owner = address_from_scaled_offset(unpack_1_int(), base); | |
596 } | |
585 | 597 |
586 void external_word_Relocation::pack_data_to(CodeSection* dest) { | 598 void external_word_Relocation::pack_data_to(CodeSection* dest) { |
587 short* p = (short*) dest->locs_end(); | 599 short* p = (short*) dest->locs_end(); |
588 int32_t index = runtime_address_to_index(_target); | 600 int32_t index = runtime_address_to_index(_target); |
589 #ifndef _LP64 | 601 #ifndef _LP64 |
809 } | 821 } |
810 } | 822 } |
811 return NULL; | 823 return NULL; |
812 } | 824 } |
813 | 825 |
826 // Finds the trampoline address for a call. If no trampoline stub is | |
827 // found NULL is returned which can be handled by the caller. | |
828 address trampoline_stub_Relocation::get_trampoline_for(address call, nmethod* code) { | |
829 // There are no relocations available when the code gets relocated | |
830 // because of CodeBuffer expansion. | |
831 if (code->relocation_size() == 0) | |
832 return NULL; | |
833 | |
834 RelocIterator iter(code, call); | |
835 while (iter.next()) { | |
836 if (iter.type() == relocInfo::trampoline_stub_type) { | |
837 if (iter.trampoline_stub_reloc()->owner() == call) { | |
838 return iter.addr(); | |
839 } | |
840 } | |
841 } | |
842 | |
843 return NULL; | |
844 } | |
814 | 845 |
815 void static_stub_Relocation::clear_inline_cache() { | 846 void static_stub_Relocation::clear_inline_cache() { |
816 // Call stub is only used when calling the interpreted code. | 847 // Call stub is only used when calling the interpreted code. |
817 // It does not really need to be cleared, except that we want to clean out the methodoop. | 848 // It does not really need to be cleared, except that we want to clean out the methodoop. |
818 CompiledStaticCall::set_stub_to_clean(this); | 849 CompiledStaticCall::set_stub_to_clean(this); |
973 { | 1004 { |
974 static_stub_Relocation* r = (static_stub_Relocation*) reloc(); | 1005 static_stub_Relocation* r = (static_stub_Relocation*) reloc(); |
975 tty->print(" | [static_call=" INTPTR_FORMAT "]", r->static_call()); | 1006 tty->print(" | [static_call=" INTPTR_FORMAT "]", r->static_call()); |
976 break; | 1007 break; |
977 } | 1008 } |
1009 case relocInfo::trampoline_stub_type: | |
1010 { | |
1011 trampoline_stub_Relocation* r = (trampoline_stub_Relocation*) reloc(); | |
1012 tty->print(" | [trampoline owner=" INTPTR_FORMAT "]", r->owner()); | |
1013 break; | |
1014 } | |
978 } | 1015 } |
979 tty->cr(); | 1016 tty->cr(); |
980 } | 1017 } |
981 | 1018 |
982 | 1019 |