535
536
537 void virtual_call_Relocation::pack_data_to(CodeSection* dest) {
538 short* p = (short*) dest->locs_end();
539 address point = dest->locs_point();
540
541 normalize_address(_cached_value, dest);
542 jint x0 = scaled_offset_null_special(_cached_value, point);
543 p = pack_2_ints_to(p, x0, _method_index);
544 dest->set_locs_end((relocInfo*) p);
545 }
546
547
548 void virtual_call_Relocation::unpack_data() {
549 jint x0 = 0;
550 unpack_2_ints(x0, _method_index);
551 address point = addr();
552 _cached_value = x0==0? NULL: address_from_scaled_offset(x0, point);
553 }
554
555
556 void static_stub_Relocation::pack_data_to(CodeSection* dest) {
557 short* p = (short*) dest->locs_end();
558 CodeSection* insts = dest->outer()->insts();
559 normalize_address(_static_call, insts);
560 p = pack_1_int_to(p, scaled_offset(_static_call, insts->start()));
561 dest->set_locs_end((relocInfo*) p);
562 }
563
564 void static_stub_Relocation::unpack_data() {
565 address base = binding()->section_start(CodeBuffer::SECT_INSTS);
566 jint offset = unpack_1_int();
567 _static_call = address_from_scaled_offset(offset, base);
568 }
569
570 void trampoline_stub_Relocation::pack_data_to(CodeSection* dest ) {
571 short* p = (short*) dest->locs_end();
572 CodeSection* insts = dest->outer()->insts();
573 normalize_address(_owner, insts);
574 p = pack_1_int_to(p, scaled_offset(_owner, insts->start()));
992 metadata_value->print_value_on(tty);
993 }
994 break;
995 }
996 case relocInfo::external_word_type:
997 case relocInfo::internal_word_type:
998 case relocInfo::section_word_type:
999 {
1000 DataRelocation* r = (DataRelocation*) reloc();
1001 tty->print(" | [target=" INTPTR_FORMAT "]", p2i(r->value())); //value==target
1002 break;
1003 }
1004 case relocInfo::static_call_type:
1005 {
1006 static_call_Relocation* r = (static_call_Relocation*) reloc();
1007 tty->print(" | [destination=" INTPTR_FORMAT " metadata=" INTPTR_FORMAT "]",
1008 p2i(r->destination()), p2i(r->method_value()));
1009 break;
1010 }
1011 case relocInfo::runtime_call_type:
1012 {
1013 CallRelocation* r = (CallRelocation*) reloc();
1014 tty->print(" | [destination=" INTPTR_FORMAT "]", p2i(r->destination()));
1015 break;
1016 }
1017 case relocInfo::virtual_call_type:
1018 {
1019 virtual_call_Relocation* r = (virtual_call_Relocation*) reloc();
1020 tty->print(" | [destination=" INTPTR_FORMAT " cached_value=" INTPTR_FORMAT " metadata=" INTPTR_FORMAT "]",
1021 p2i(r->destination()), p2i(r->cached_value()), p2i(r->method_value()));
1022 break;
1023 }
1024 case relocInfo::static_stub_type:
1025 {
1026 static_stub_Relocation* r = (static_stub_Relocation*) reloc();
1027 tty->print(" | [static_call=" INTPTR_FORMAT "]", p2i(r->static_call()));
1028 break;
1029 }
1030 case relocInfo::trampoline_stub_type:
1031 {
|
535
536
537 void virtual_call_Relocation::pack_data_to(CodeSection* dest) {
538 short* p = (short*) dest->locs_end();
539 address point = dest->locs_point();
540
541 normalize_address(_cached_value, dest);
542 jint x0 = scaled_offset_null_special(_cached_value, point);
543 p = pack_2_ints_to(p, x0, _method_index);
544 dest->set_locs_end((relocInfo*) p);
545 }
546
547
548 void virtual_call_Relocation::unpack_data() {
549 jint x0 = 0;
550 unpack_2_ints(x0, _method_index);
551 address point = addr();
552 _cached_value = x0==0? NULL: address_from_scaled_offset(x0, point);
553 }
554
555 void runtime_call_w_cp_Relocation::pack_data_to(CodeSection * dest) {
556 short* p = pack_1_int_to((short *)dest->locs_end(), (jint)(_offset >> 2));
557 dest->set_locs_end((relocInfo*) p);
558 }
559
560 void runtime_call_w_cp_Relocation::unpack_data() {
561 _offset = unpack_1_int() << 2;
562 }
563
564 void static_stub_Relocation::pack_data_to(CodeSection* dest) {
565 short* p = (short*) dest->locs_end();
566 CodeSection* insts = dest->outer()->insts();
567 normalize_address(_static_call, insts);
568 p = pack_1_int_to(p, scaled_offset(_static_call, insts->start()));
569 dest->set_locs_end((relocInfo*) p);
570 }
571
572 void static_stub_Relocation::unpack_data() {
573 address base = binding()->section_start(CodeBuffer::SECT_INSTS);
574 jint offset = unpack_1_int();
575 _static_call = address_from_scaled_offset(offset, base);
576 }
577
578 void trampoline_stub_Relocation::pack_data_to(CodeSection* dest ) {
579 short* p = (short*) dest->locs_end();
580 CodeSection* insts = dest->outer()->insts();
581 normalize_address(_owner, insts);
582 p = pack_1_int_to(p, scaled_offset(_owner, insts->start()));
1000 metadata_value->print_value_on(tty);
1001 }
1002 break;
1003 }
1004 case relocInfo::external_word_type:
1005 case relocInfo::internal_word_type:
1006 case relocInfo::section_word_type:
1007 {
1008 DataRelocation* r = (DataRelocation*) reloc();
1009 tty->print(" | [target=" INTPTR_FORMAT "]", p2i(r->value())); //value==target
1010 break;
1011 }
1012 case relocInfo::static_call_type:
1013 {
1014 static_call_Relocation* r = (static_call_Relocation*) reloc();
1015 tty->print(" | [destination=" INTPTR_FORMAT " metadata=" INTPTR_FORMAT "]",
1016 p2i(r->destination()), p2i(r->method_value()));
1017 break;
1018 }
1019 case relocInfo::runtime_call_type:
1020 case relocInfo::runtime_call_w_cp_type:
1021 {
1022 CallRelocation* r = (CallRelocation*) reloc();
1023 tty->print(" | [destination=" INTPTR_FORMAT "]", p2i(r->destination()));
1024 break;
1025 }
1026 case relocInfo::virtual_call_type:
1027 {
1028 virtual_call_Relocation* r = (virtual_call_Relocation*) reloc();
1029 tty->print(" | [destination=" INTPTR_FORMAT " cached_value=" INTPTR_FORMAT " metadata=" INTPTR_FORMAT "]",
1030 p2i(r->destination()), p2i(r->cached_value()), p2i(r->method_value()));
1031 break;
1032 }
1033 case relocInfo::static_stub_type:
1034 {
1035 static_stub_Relocation* r = (static_stub_Relocation*) reloc();
1036 tty->print(" | [static_call=" INTPTR_FORMAT "]", p2i(r->static_call()));
1037 break;
1038 }
1039 case relocInfo::trampoline_stub_type:
1040 {
|