977 // n |
977 // n |
978 // .... <-- call destination |
978 // .... <-- call destination |
979 |
979 |
980 address stub_location = caller_frame.pc() + PatchingStub::patch_info_offset(); |
980 address stub_location = caller_frame.pc() + PatchingStub::patch_info_offset(); |
981 |
981 |
982 #if defined(MIPS32) && defined(_LP64) |
|
983 /* Jin: In MIPS64, byte_skip is much larger than that in X86. It can not be contained in a byte: |
|
984 * int bc = 0x20; |
|
985 * int bs = 0x190; |
|
986 * int bi = 0x1b0; |
|
987 * |
|
988 * To minimize the modification of share codes, the values are decreased 4 times when generated. |
|
989 * See [mips/c1_CodeStubs_mips.cpp 307] PatchingStub::emit_code(). |
|
990 */ |
|
991 int bc = *(unsigned char*) (stub_location - 1) * 4; |
|
992 int bs = *(unsigned char*) (stub_location - 2) * 4; |
|
993 int bi = *(unsigned char*) (stub_location - 3) * 4; |
|
994 |
|
995 int *byte_count = &bc; |
|
996 int *byte_skip = &bs; |
|
997 int *being_initialized_entry_offset = &bi; |
|
998 #else |
|
999 unsigned char* byte_count = (unsigned char*) (stub_location - 1); |
982 unsigned char* byte_count = (unsigned char*) (stub_location - 1); |
1000 unsigned char* byte_skip = (unsigned char*) (stub_location - 2); |
983 unsigned char* byte_skip = (unsigned char*) (stub_location - 2); |
1001 unsigned char* being_initialized_entry_offset = (unsigned char*) (stub_location - 3); |
984 unsigned char* being_initialized_entry_offset = (unsigned char*) (stub_location - 3); |
1002 #endif |
|
1003 address copy_buff = stub_location - *byte_skip - *byte_count; |
985 address copy_buff = stub_location - *byte_skip - *byte_count; |
1004 address being_initialized_entry = stub_location - *being_initialized_entry_offset; |
986 address being_initialized_entry = stub_location - *being_initialized_entry_offset; |
1005 |
987 |
1006 if (TracePatching) { |
988 if (TracePatching) { |
1007 tty->print_cr(" Patching %s at bci %d at address " INTPTR_FORMAT " (%s)", Bytecodes::name(code), bci, |
989 tty->print_cr(" Patching %s at bci %d at address " INTPTR_FORMAT " (%s)", Bytecodes::name(code), bci, |
1015 OopMap* map = caller_code->oop_map_for_return_address(caller_frame.pc()); |
997 OopMap* map = caller_code->oop_map_for_return_address(caller_frame.pc()); |
1016 assert(map != NULL, "null check"); |
998 assert(map != NULL, "null check"); |
1017 map->print(); |
999 map->print(); |
1018 tty->cr(); |
1000 tty->cr(); |
1019 |
1001 |
1020 Disassembler::decode(copy_buff, copy_buff + *byte_count, tty); |
1002 Disassembler::decode(copy_buff - *byte_count, copy_buff + *byte_count, tty); |
1021 } |
1003 } |
1022 // depending on the code below, do_patch says whether to copy the patch body back into the nmethod |
1004 // depending on the code below, do_patch says whether to copy the patch body back into the nmethod |
1023 bool do_patch = true; |
1005 bool do_patch = true; |
1024 if (stub_id == Runtime1::access_field_patching_id) { |
1006 if (stub_id == Runtime1::access_field_patching_id) { |
1025 // The offset may not be correct if the class was not loaded at code generation time. |
1007 // The offset may not be correct if the class was not loaded at code generation time. |