263 } |
263 } |
264 } |
264 } |
265 } |
265 } |
266 } |
266 } |
267 |
267 |
268 public static void decodeKlassPointer(AMD64MacroAssembler masm, Register register, Register scratch, AMD64Address address, CompressEncoding encoding) { |
268 public static void decodeKlassPointer(CompilationResultBuilder crb, AMD64MacroAssembler masm, Register register, Register scratch, AMD64Address address, GraalHotSpotVMConfig config) { |
|
269 CompressEncoding encoding = config.getKlassEncoding(); |
269 masm.movl(register, address); |
270 masm.movl(register, address); |
270 if (encoding.shift != 0) { |
271 if (encoding.shift != 0) { |
271 assert encoding.alignment == encoding.shift : "Decode algorithm is wrong"; |
272 assert encoding.alignment == encoding.shift : "Decode algorithm is wrong"; |
272 masm.shlq(register, encoding.alignment); |
273 masm.shlq(register, encoding.alignment); |
273 } |
274 } |
274 if (encoding.base != 0) { |
275 if (GeneratePIC.getValue() || encoding.base != 0) { |
275 masm.movq(scratch, encoding.base); |
276 if (GeneratePIC.getValue()) { |
|
277 masm.movq(scratch, masm.getPlaceholder(-1)); |
|
278 crb.recordMark(config.MARKID_NARROW_KLASS_BASE_ADDRESS); |
|
279 } else { |
|
280 assert encoding.base != 0; |
|
281 masm.movq(scratch, encoding.base); |
|
282 } |
276 masm.addq(register, scratch); |
283 masm.addq(register, scratch); |
277 } |
284 } |
278 } |
285 } |
279 } |
286 } |