Mercurial > hg > graal-compiler
comparison src/cpu/sparc/vm/jvmciCodeInstaller_sparc.cpp @ 22114:d9f3acb4a9a1
[SPARC] Implement constant loads from constant table with base register
author | Stefan Anzinger <stefan.anzinger@oracle.com> |
---|---|
date | Sat, 27 Jun 2015 18:02:44 +0200 |
parents | be896a1983c0 |
children | a0d0ecbceeb4 |
comparison
equal
deleted
inserted
replaced
22113:598c75a3d1d1 | 22114:d9f3acb4a9a1 |
---|---|
64 } | 64 } |
65 } | 65 } |
66 | 66 |
67 void CodeInstaller::pd_patch_DataSectionReference(int pc_offset, int data_offset) { | 67 void CodeInstaller::pd_patch_DataSectionReference(int pc_offset, int data_offset) { |
68 address pc = _instructions->start() + pc_offset; | 68 address pc = _instructions->start() + pc_offset; |
69 address const_start = _constants->start(); | 69 NativeInstruction* inst = nativeInstruction_at(pc); |
70 address dest = _constants->start() + data_offset; | 70 NativeInstruction* inst1 = nativeInstruction_at(pc + 4); |
71 | 71 if(inst->is_sethi() && inst1->is_nop()) { |
72 _instructions->relocate(pc + NativeMovConstReg::sethi_offset, internal_word_Relocation::spec((address) dest)); | 72 address const_start = _constants->start(); |
73 _instructions->relocate(pc + NativeMovConstReg::add_offset, internal_word_Relocation::spec((address) dest)); | 73 address dest = _constants->start() + data_offset; |
74 TRACE_jvmci_3("relocating at %p with destination at %p (%d)", pc, dest, data_offset); | 74 if(_constants_size > 0) { |
75 _instructions->relocate(pc + NativeMovConstReg::sethi_offset, internal_word_Relocation::spec((address) dest)); | |
76 _instructions->relocate(pc + NativeMovConstReg::add_offset, internal_word_Relocation::spec((address) dest)); | |
77 } | |
78 TRACE_jvmci_3("relocating at %p (+%d) with destination at %d", pc, pc_offset, data_offset); | |
79 } else { | |
80 NativeMovRegMem* load = nativeMovRegMem_at(pc); | |
81 // The base pointer is set 4k off (see SPARCLoadConstantTableBaseOp) | |
82 load->set_offset(data_offset - (1<<12)); | |
83 TRACE_jvmci_3("relocating ld at %p (+%d) with destination at %d", pc, pc_offset, data_offset); | |
84 } | |
75 } | 85 } |
76 | 86 |
77 void CodeInstaller::pd_relocate_CodeBlob(CodeBlob* cb, NativeInstruction* inst) { | 87 void CodeInstaller::pd_relocate_CodeBlob(CodeBlob* cb, NativeInstruction* inst) { |
78 fatal("CodeInstaller::pd_relocate_CodeBlob - sparc unimp"); | 88 fatal("CodeInstaller::pd_relocate_CodeBlob - sparc unimp"); |
79 } | 89 } |