comparison src/hotspot/cpu/aarch64/jvmciCodeInstaller_aarch64.cpp @ 54526:ee29b516a36a

revert changes
author jlaskey
date Wed, 23 Jan 2019 16:09:20 -0400
parents d7df2dd501ce
children ad45b3802d4e
comparison
equal deleted inserted replaced
2:e21d6ce9a772 3:aa8bacfcfd62
33 jint CodeInstaller::pd_next_offset(NativeInstruction* inst, jint pc_offset, Handle method, TRAPS) { 33 jint CodeInstaller::pd_next_offset(NativeInstruction* inst, jint pc_offset, Handle method, TRAPS) {
34 if (inst->is_call() || inst->is_jump() || inst->is_blr()) { 34 if (inst->is_call() || inst->is_jump() || inst->is_blr()) {
35 return pc_offset + NativeCall::instruction_size; 35 return pc_offset + NativeCall::instruction_size;
36 } else if (inst->is_general_jump()) { 36 } else if (inst->is_general_jump()) {
37 return pc_offset + NativeGeneralJump::instruction_size; 37 return pc_offset + NativeGeneralJump::instruction_size;
38 } else if (NativeInstruction::is_adrp_at((address)inst)) {
39 // adrp; add; blr
40 return pc_offset + 3 * NativeInstruction::instruction_size;
38 } else { 41 } else {
39 JVMCI_ERROR_0("unsupported type of instruction for call site"); 42 JVMCI_ERROR_0("unsupported type of instruction for call site");
40 } 43 }
41 } 44 }
42 45
79 } 82 }
80 83
81 void CodeInstaller::pd_patch_DataSectionReference(int pc_offset, int data_offset, TRAPS) { 84 void CodeInstaller::pd_patch_DataSectionReference(int pc_offset, int data_offset, TRAPS) {
82 address pc = _instructions->start() + pc_offset; 85 address pc = _instructions->start() + pc_offset;
83 NativeInstruction* inst = nativeInstruction_at(pc); 86 NativeInstruction* inst = nativeInstruction_at(pc);
84 if (inst->is_adr_aligned() || inst->is_ldr_literal()) { 87 if (inst->is_adr_aligned() || inst->is_ldr_literal()
88 || (NativeInstruction::maybe_cpool_ref(pc))) {
85 address dest = _constants->start() + data_offset; 89 address dest = _constants->start() + data_offset;
86 _instructions->relocate(pc, section_word_Relocation::spec((address) dest, CodeBuffer::SECT_CONSTS)); 90 _instructions->relocate(pc, section_word_Relocation::spec((address) dest, CodeBuffer::SECT_CONSTS));
87 TRACE_jvmci_3("relocating at " PTR_FORMAT " (+%d) with destination at %d", p2i(pc), pc_offset, data_offset); 91 TRACE_jvmci_3("relocating at " PTR_FORMAT " (+%d) with destination at %d", p2i(pc), pc_offset, data_offset);
88 } else { 92 } else {
89 JVMCI_ERROR("unknown load or move instruction at " PTR_FORMAT, p2i(pc)); 93 JVMCI_ERROR("unknown load or move instruction at " PTR_FORMAT, p2i(pc));
102 _instructions->relocate(jump->instruction_address(), runtime_call_Relocation::spec()); 106 _instructions->relocate(jump->instruction_address(), runtime_call_Relocation::spec());
103 } else if (inst->is_general_jump()) { 107 } else if (inst->is_general_jump()) {
104 NativeGeneralJump* jump = nativeGeneralJump_at(pc); 108 NativeGeneralJump* jump = nativeGeneralJump_at(pc);
105 jump->set_jump_destination((address) foreign_call_destination); 109 jump->set_jump_destination((address) foreign_call_destination);
106 _instructions->relocate(jump->instruction_address(), runtime_call_Relocation::spec()); 110 _instructions->relocate(jump->instruction_address(), runtime_call_Relocation::spec());
111 } else if (NativeInstruction::is_adrp_at((address)inst)) {
112 // adrp; add; blr
113 MacroAssembler::pd_patch_instruction_size((address)inst,
114 (address)foreign_call_destination);
107 } else { 115 } else {
108 JVMCI_ERROR("unknown call or jump instruction at " PTR_FORMAT, p2i(pc)); 116 JVMCI_ERROR("unknown call or jump instruction at " PTR_FORMAT, p2i(pc));
109 } 117 }
110 TRACE_jvmci_3("relocating (foreign call) at " PTR_FORMAT, p2i(inst)); 118 TRACE_jvmci_3("relocating (foreign call) at " PTR_FORMAT, p2i(inst));
111 } 119 }