< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRGenerator.java

Print this page




  22  */
  23 package org.graalvm.compiler.hotspot.amd64;
  24 
  25 import static jdk.vm.ci.amd64.AMD64.rbp;
  26 import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC;
  27 import static org.graalvm.compiler.hotspot.HotSpotBackend.INITIALIZE_KLASS_BY_SYMBOL;
  28 import static org.graalvm.compiler.hotspot.HotSpotBackend.RESOLVE_KLASS_BY_SYMBOL;
  29 import static org.graalvm.compiler.hotspot.HotSpotBackend.RESOLVE_METHOD_BY_SYMBOL_AND_LOAD_COUNTERS;
  30 import static org.graalvm.compiler.hotspot.HotSpotBackend.RESOLVE_STRING_BY_SYMBOL;
  31 import static org.graalvm.compiler.hotspot.HotSpotBackend.RESOLVE_DYNAMIC_INVOKE;
  32 import static org.graalvm.compiler.hotspot.meta.HotSpotConstantLoadAction.RESOLVE;
  33 import static org.graalvm.compiler.hotspot.meta.HotSpotConstantLoadAction.INITIALIZE;
  34 import static org.graalvm.compiler.hotspot.meta.HotSpotConstantLoadAction.LOAD_COUNTERS;
  35 
  36 import java.util.ArrayList;
  37 import java.util.List;
  38 
  39 import org.graalvm.compiler.asm.amd64.AMD64Address.Scale;
  40 import org.graalvm.compiler.core.amd64.AMD64ArithmeticLIRGenerator;
  41 import org.graalvm.compiler.core.amd64.AMD64LIRGenerator;
  42 import org.graalvm.compiler.core.amd64.AMD64LIRKindTool;
  43 import org.graalvm.compiler.core.amd64.AMD64MoveFactoryBase.BackupSlotProvider;
  44 import org.graalvm.compiler.core.common.CompressEncoding;
  45 import org.graalvm.compiler.core.common.LIRKind;
  46 import org.graalvm.compiler.core.common.spi.ForeignCallDescriptor;
  47 import org.graalvm.compiler.core.common.spi.ForeignCallLinkage;
  48 import org.graalvm.compiler.core.common.spi.LIRKindTool;
  49 import org.graalvm.compiler.debug.DebugContext;
  50 import org.graalvm.compiler.debug.GraalError;
  51 import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig;
  52 import org.graalvm.compiler.hotspot.HotSpotBackend;
  53 import org.graalvm.compiler.hotspot.HotSpotDebugInfoBuilder;
  54 import org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage;
  55 import org.graalvm.compiler.hotspot.HotSpotLIRGenerationResult;
  56 import org.graalvm.compiler.hotspot.HotSpotLIRGenerator;
  57 import org.graalvm.compiler.hotspot.HotSpotLockStack;
  58 import org.graalvm.compiler.hotspot.debug.BenchmarkCounters;
  59 import org.graalvm.compiler.hotspot.meta.HotSpotConstantLoadAction;
  60 import org.graalvm.compiler.hotspot.meta.HotSpotProviders;
  61 import org.graalvm.compiler.hotspot.stubs.Stub;
  62 import org.graalvm.compiler.lir.LIR;


  99 import jdk.vm.ci.meta.DeoptimizationReason;
 100 import jdk.vm.ci.meta.JavaConstant;
 101 import jdk.vm.ci.meta.JavaKind;
 102 import jdk.vm.ci.meta.PlatformKind;
 103 import jdk.vm.ci.meta.PrimitiveConstant;
 104 import jdk.vm.ci.meta.Value;
 105 
 106 /**
 107  * LIR generator specialized for AMD64 HotSpot.
 108  */
 109 public class AMD64HotSpotLIRGenerator extends AMD64LIRGenerator implements HotSpotLIRGenerator {
 110 
 111     final GraalHotSpotVMConfig config;
 112     private HotSpotDebugInfoBuilder debugInfoBuilder;
 113 
 114     protected AMD64HotSpotLIRGenerator(HotSpotProviders providers, GraalHotSpotVMConfig config, LIRGenerationResult lirGenRes) {
 115         this(providers, config, lirGenRes, new BackupSlotProvider(lirGenRes.getFrameMapBuilder()));
 116     }
 117 
 118     private AMD64HotSpotLIRGenerator(HotSpotProviders providers, GraalHotSpotVMConfig config, LIRGenerationResult lirGenRes, BackupSlotProvider backupSlotProvider) {
 119         this(new AMD64LIRKindTool(), new AMD64HotSpotArithmeticLIRGenerator(), new AMD64HotSpotMoveFactory(backupSlotProvider), providers, config, lirGenRes);
 120     }
 121 
 122     protected AMD64HotSpotLIRGenerator(LIRKindTool lirKindTool, AMD64ArithmeticLIRGenerator arithmeticLIRGen, MoveFactory moveFactory, HotSpotProviders providers, GraalHotSpotVMConfig config,
 123                     LIRGenerationResult lirGenRes) {
 124         super(lirKindTool, arithmeticLIRGen, moveFactory, providers, lirGenRes);
 125         assert config.basicLockSize == 8;
 126         this.config = config;
 127     }
 128 
 129     @Override
 130     public HotSpotProviders getProviders() {
 131         return (HotSpotProviders) super.getProviders();
 132     }
 133 
 134     /**
 135      * Utility for emitting the instruction to save RBP.
 136      */
 137     class SaveRbp {
 138 
 139         final NoOp placeholder;


 346     }
 347 
 348     @Override
 349     public HotSpotLIRGenerationResult getResult() {
 350         return ((HotSpotLIRGenerationResult) super.getResult());
 351     }
 352 
 353     public void setDebugInfoBuilder(HotSpotDebugInfoBuilder debugInfoBuilder) {
 354         this.debugInfoBuilder = debugInfoBuilder;
 355     }
 356 
 357     @Override
 358     public Variable emitForeignCall(ForeignCallLinkage linkage, LIRFrameState state, Value... args) {
 359         HotSpotForeignCallLinkage hotspotLinkage = (HotSpotForeignCallLinkage) linkage;
 360         boolean destroysRegisters = hotspotLinkage.destroysRegisters();
 361 
 362         AMD64SaveRegistersOp save = null;
 363         Stub stub = getStub();
 364         if (destroysRegisters) {
 365             if (stub != null && stub.preservesRegisters()) {
 366                 Register[] savedRegisters = getResult().getFrameMapBuilder().getRegisterConfig().getAllocatableRegisters().toArray();
 367                 save = emitSaveAllRegisters(savedRegisters, true);
 368             }
 369         }
 370 
 371         Variable result;
 372         LIRFrameState debugInfo = null;
 373         if (hotspotLinkage.needsDebugInfo()) {
 374             debugInfo = state;
 375             assert debugInfo != null || stub != null;
 376         }
 377 
 378         if (hotspotLinkage.needsJavaFrameAnchor()) {
 379             Register thread = getProviders().getRegisters().getThreadRegister();
 380             append(new AMD64HotSpotCRuntimeCallPrologueOp(config.threadLastJavaSpOffset(), thread));
 381             result = super.emitForeignCall(hotspotLinkage, debugInfo, args);
 382             append(new AMD64HotSpotCRuntimeCallEpilogueOp(config.threadLastJavaSpOffset(), config.threadLastJavaFpOffset(), config.threadLastJavaPcOffset(), thread));
 383         } else {
 384             result = super.emitForeignCall(hotspotLinkage, debugInfo, args);
 385         }
 386 


 550 
 551         getResult().setMaxInterpreterFrameSize(debugInfoBuilder.maxInterpreterFrameSize());
 552 
 553         for (AMD64HotSpotRestoreRbpOp op : epilogueOps) {
 554             op.setSavedRbp(savedRbp);
 555         }
 556         if (BenchmarkCounters.enabled) {
 557             // ensure that the rescue slot is available
 558             LIRInstruction op = getOrInitRescueSlotOp();
 559             // insert dummy instruction into the start block
 560             LIR lir = getResult().getLIR();
 561             ArrayList<LIRInstruction> instructions = lir.getLIRforBlock(lir.getControlFlowGraph().getStartBlock());
 562             instructions.add(1, op);
 563             lir.getDebug().dump(DebugContext.INFO_LEVEL, lir, "created rescue dummy op");
 564         }
 565     }
 566 
 567     @Override
 568     public Value emitCompress(Value pointer, CompressEncoding encoding, boolean nonNull) {
 569         LIRKind inputKind = pointer.getValueKind(LIRKind.class);
 570         assert inputKind.getPlatformKind() == AMD64Kind.QWORD;

 571         if (inputKind.isReference(0)) {
 572             // oop
 573             Variable result = newVariable(LIRKind.reference(AMD64Kind.DWORD));
 574             append(new AMD64HotSpotMove.CompressPointer(result, asAllocatable(pointer), getProviders().getRegisters().getHeapBaseRegister().asValue(), encoding, nonNull));
 575             return result;
 576         } else {
 577             // metaspace pointer
 578             Variable result = newVariable(LIRKind.value(AMD64Kind.DWORD));
 579             AllocatableValue base = Value.ILLEGAL;
 580             OptionValues options = getResult().getLIR().getOptions();
 581             if (encoding.hasBase() || GeneratePIC.getValue(options)) {
 582                 if (GeneratePIC.getValue(options)) {
 583                     Variable baseAddress = newVariable(LIRKind.value(AMD64Kind.QWORD));
 584                     AMD64HotSpotMove.BaseMove move = new AMD64HotSpotMove.BaseMove(baseAddress, config);
 585                     append(move);
 586                     base = baseAddress;
 587                 } else {
 588                     base = emitLoadConstant(LIRKind.value(AMD64Kind.QWORD), JavaConstant.forLong(encoding.getBase()));
 589                 }
 590             }
 591             append(new AMD64HotSpotMove.CompressPointer(result, asAllocatable(pointer), base, encoding, nonNull));
 592             return result;
 593         }
 594     }
 595 
 596     @Override
 597     public Value emitUncompress(Value pointer, CompressEncoding encoding, boolean nonNull) {
 598         LIRKind inputKind = pointer.getValueKind(LIRKind.class);
 599         assert inputKind.getPlatformKind() == AMD64Kind.DWORD;

 600         if (inputKind.isReference(0)) {
 601             // oop
 602             Variable result = newVariable(LIRKind.reference(AMD64Kind.QWORD));
 603             append(new AMD64HotSpotMove.UncompressPointer(result, asAllocatable(pointer), getProviders().getRegisters().getHeapBaseRegister().asValue(), encoding, nonNull));
 604             return result;
 605         } else {
 606             // metaspace pointer
 607             Variable result = newVariable(LIRKind.value(AMD64Kind.QWORD));

 608             AllocatableValue base = Value.ILLEGAL;
 609             OptionValues options = getResult().getLIR().getOptions();
 610             if (encoding.hasBase() || GeneratePIC.getValue(options)) {
 611                 if (GeneratePIC.getValue(options)) {
 612                     Variable baseAddress = newVariable(LIRKind.value(AMD64Kind.QWORD));
 613                     AMD64HotSpotMove.BaseMove move = new AMD64HotSpotMove.BaseMove(baseAddress, config);
 614                     append(move);
 615                     base = baseAddress;
 616                 } else {
 617                     base = emitLoadConstant(LIRKind.value(AMD64Kind.QWORD), JavaConstant.forLong(encoding.getBase()));
 618                 }
 619             }
 620             append(new AMD64HotSpotMove.UncompressPointer(result, asAllocatable(pointer), base, encoding, nonNull));
 621             return result;
 622         }
 623     }
 624 
 625     @Override
 626     public void emitNullCheck(Value address, LIRFrameState state) {
 627         if (address.getValueKind().getPlatformKind() == AMD64Kind.DWORD) {
 628             CompressEncoding encoding = config.getOopEncoding();
 629             Value uncompressed;
 630             if (encoding.getShift() <= 3) {
 631                 LIRKind wordKind = LIRKind.unknownReference(target().arch.getWordKind());
 632                 uncompressed = new AMD64AddressValue(wordKind, getProviders().getRegisters().getHeapBaseRegister().asValue(wordKind), asAllocatable(address), Scale.fromInt(1 << encoding.getShift()),
 633                                 0);
 634             } else {
 635                 uncompressed = emitUncompress(address, encoding, false);
 636             }
 637             append(new AMD64Move.NullCheckOp(asAddressValue(uncompressed), state));
 638         } else {
 639             super.emitNullCheck(address, state);
 640         }

 641     }
 642 
 643     @Override
 644     public LIRInstruction createBenchmarkCounter(String name, String group, Value increment) {
 645         if (BenchmarkCounters.enabled) {
 646             return new AMD64HotSpotCounterOp(name, group, increment, getProviders().getRegisters(), config, getOrInitRescueSlot());
 647         }
 648         throw GraalError.shouldNotReachHere("BenchmarkCounters are not enabled!");
 649     }
 650 
 651     @Override
 652     public LIRInstruction createMultiBenchmarkCounter(String[] names, String[] groups, Value[] increments) {
 653         if (BenchmarkCounters.enabled) {
 654             return new AMD64HotSpotCounterOp(names, groups, increments, getProviders().getRegisters(), config, getOrInitRescueSlot());
 655         }
 656         throw GraalError.shouldNotReachHere("BenchmarkCounters are not enabled!");
 657     }
 658 
 659     @Override
 660     public void emitPrefetchAllocate(Value address) {


  22  */
  23 package org.graalvm.compiler.hotspot.amd64;
  24 
  25 import static jdk.vm.ci.amd64.AMD64.rbp;
  26 import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC;
  27 import static org.graalvm.compiler.hotspot.HotSpotBackend.INITIALIZE_KLASS_BY_SYMBOL;
  28 import static org.graalvm.compiler.hotspot.HotSpotBackend.RESOLVE_KLASS_BY_SYMBOL;
  29 import static org.graalvm.compiler.hotspot.HotSpotBackend.RESOLVE_METHOD_BY_SYMBOL_AND_LOAD_COUNTERS;
  30 import static org.graalvm.compiler.hotspot.HotSpotBackend.RESOLVE_STRING_BY_SYMBOL;
  31 import static org.graalvm.compiler.hotspot.HotSpotBackend.RESOLVE_DYNAMIC_INVOKE;
  32 import static org.graalvm.compiler.hotspot.meta.HotSpotConstantLoadAction.RESOLVE;
  33 import static org.graalvm.compiler.hotspot.meta.HotSpotConstantLoadAction.INITIALIZE;
  34 import static org.graalvm.compiler.hotspot.meta.HotSpotConstantLoadAction.LOAD_COUNTERS;
  35 
  36 import java.util.ArrayList;
  37 import java.util.List;
  38 
  39 import org.graalvm.compiler.asm.amd64.AMD64Address.Scale;
  40 import org.graalvm.compiler.core.amd64.AMD64ArithmeticLIRGenerator;
  41 import org.graalvm.compiler.core.amd64.AMD64LIRGenerator;

  42 import org.graalvm.compiler.core.amd64.AMD64MoveFactoryBase.BackupSlotProvider;
  43 import org.graalvm.compiler.core.common.CompressEncoding;
  44 import org.graalvm.compiler.core.common.LIRKind;
  45 import org.graalvm.compiler.core.common.spi.ForeignCallDescriptor;
  46 import org.graalvm.compiler.core.common.spi.ForeignCallLinkage;
  47 import org.graalvm.compiler.core.common.spi.LIRKindTool;
  48 import org.graalvm.compiler.debug.DebugContext;
  49 import org.graalvm.compiler.debug.GraalError;
  50 import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig;
  51 import org.graalvm.compiler.hotspot.HotSpotBackend;
  52 import org.graalvm.compiler.hotspot.HotSpotDebugInfoBuilder;
  53 import org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage;
  54 import org.graalvm.compiler.hotspot.HotSpotLIRGenerationResult;
  55 import org.graalvm.compiler.hotspot.HotSpotLIRGenerator;
  56 import org.graalvm.compiler.hotspot.HotSpotLockStack;
  57 import org.graalvm.compiler.hotspot.debug.BenchmarkCounters;
  58 import org.graalvm.compiler.hotspot.meta.HotSpotConstantLoadAction;
  59 import org.graalvm.compiler.hotspot.meta.HotSpotProviders;
  60 import org.graalvm.compiler.hotspot.stubs.Stub;
  61 import org.graalvm.compiler.lir.LIR;


  98 import jdk.vm.ci.meta.DeoptimizationReason;
  99 import jdk.vm.ci.meta.JavaConstant;
 100 import jdk.vm.ci.meta.JavaKind;
 101 import jdk.vm.ci.meta.PlatformKind;
 102 import jdk.vm.ci.meta.PrimitiveConstant;
 103 import jdk.vm.ci.meta.Value;
 104 
 105 /**
 106  * LIR generator specialized for AMD64 HotSpot.
 107  */
 108 public class AMD64HotSpotLIRGenerator extends AMD64LIRGenerator implements HotSpotLIRGenerator {
 109 
 110     final GraalHotSpotVMConfig config;
 111     private HotSpotDebugInfoBuilder debugInfoBuilder;
 112 
 113     protected AMD64HotSpotLIRGenerator(HotSpotProviders providers, GraalHotSpotVMConfig config, LIRGenerationResult lirGenRes) {
 114         this(providers, config, lirGenRes, new BackupSlotProvider(lirGenRes.getFrameMapBuilder()));
 115     }
 116 
 117     private AMD64HotSpotLIRGenerator(HotSpotProviders providers, GraalHotSpotVMConfig config, LIRGenerationResult lirGenRes, BackupSlotProvider backupSlotProvider) {
 118         this(new AMD64HotSpotLIRKindTool(), new AMD64HotSpotArithmeticLIRGenerator(), new AMD64HotSpotMoveFactory(backupSlotProvider), providers, config, lirGenRes);
 119     }
 120 
 121     protected AMD64HotSpotLIRGenerator(LIRKindTool lirKindTool, AMD64ArithmeticLIRGenerator arithmeticLIRGen, MoveFactory moveFactory, HotSpotProviders providers, GraalHotSpotVMConfig config,
 122                     LIRGenerationResult lirGenRes) {
 123         super(lirKindTool, arithmeticLIRGen, moveFactory, providers, lirGenRes);
 124         assert config.basicLockSize == 8;
 125         this.config = config;
 126     }
 127 
 128     @Override
 129     public HotSpotProviders getProviders() {
 130         return (HotSpotProviders) super.getProviders();
 131     }
 132 
 133     /**
 134      * Utility for emitting the instruction to save RBP.
 135      */
 136     class SaveRbp {
 137 
 138         final NoOp placeholder;


 345     }
 346 
 347     @Override
 348     public HotSpotLIRGenerationResult getResult() {
 349         return ((HotSpotLIRGenerationResult) super.getResult());
 350     }
 351 
 352     public void setDebugInfoBuilder(HotSpotDebugInfoBuilder debugInfoBuilder) {
 353         this.debugInfoBuilder = debugInfoBuilder;
 354     }
 355 
 356     @Override
 357     public Variable emitForeignCall(ForeignCallLinkage linkage, LIRFrameState state, Value... args) {
 358         HotSpotForeignCallLinkage hotspotLinkage = (HotSpotForeignCallLinkage) linkage;
 359         boolean destroysRegisters = hotspotLinkage.destroysRegisters();
 360 
 361         AMD64SaveRegistersOp save = null;
 362         Stub stub = getStub();
 363         if (destroysRegisters) {
 364             if (stub != null && stub.preservesRegisters()) {
 365                 Register[] savedRegisters = getRegisterConfig().getAllocatableRegisters().toArray();
 366                 save = emitSaveAllRegisters(savedRegisters, true);
 367             }
 368         }
 369 
 370         Variable result;
 371         LIRFrameState debugInfo = null;
 372         if (hotspotLinkage.needsDebugInfo()) {
 373             debugInfo = state;
 374             assert debugInfo != null || stub != null;
 375         }
 376 
 377         if (hotspotLinkage.needsJavaFrameAnchor()) {
 378             Register thread = getProviders().getRegisters().getThreadRegister();
 379             append(new AMD64HotSpotCRuntimeCallPrologueOp(config.threadLastJavaSpOffset(), thread));
 380             result = super.emitForeignCall(hotspotLinkage, debugInfo, args);
 381             append(new AMD64HotSpotCRuntimeCallEpilogueOp(config.threadLastJavaSpOffset(), config.threadLastJavaFpOffset(), config.threadLastJavaPcOffset(), thread));
 382         } else {
 383             result = super.emitForeignCall(hotspotLinkage, debugInfo, args);
 384         }
 385 


 549 
 550         getResult().setMaxInterpreterFrameSize(debugInfoBuilder.maxInterpreterFrameSize());
 551 
 552         for (AMD64HotSpotRestoreRbpOp op : epilogueOps) {
 553             op.setSavedRbp(savedRbp);
 554         }
 555         if (BenchmarkCounters.enabled) {
 556             // ensure that the rescue slot is available
 557             LIRInstruction op = getOrInitRescueSlotOp();
 558             // insert dummy instruction into the start block
 559             LIR lir = getResult().getLIR();
 560             ArrayList<LIRInstruction> instructions = lir.getLIRforBlock(lir.getControlFlowGraph().getStartBlock());
 561             instructions.add(1, op);
 562             lir.getDebug().dump(DebugContext.INFO_LEVEL, lir, "created rescue dummy op");
 563         }
 564     }
 565 
 566     @Override
 567     public Value emitCompress(Value pointer, CompressEncoding encoding, boolean nonNull) {
 568         LIRKind inputKind = pointer.getValueKind(LIRKind.class);
 569         LIRKindTool lirKindTool = getLIRKindTool();
 570         assert inputKind.getPlatformKind() == lirKindTool.getObjectKind().getPlatformKind();
 571         if (inputKind.isReference(0)) {
 572             // oop
 573             Variable result = newVariable(lirKindTool.getNarrowOopKind());
 574             append(new AMD64Move.CompressPointer(result, asAllocatable(pointer), getProviders().getRegisters().getHeapBaseRegister().asValue(), encoding, nonNull, getLIRKindTool()));
 575             return result;
 576         } else {
 577             // metaspace pointer
 578             Variable result = newVariable(lirKindTool.getNarrowPointerKind());
 579             AllocatableValue base = Value.ILLEGAL;
 580             OptionValues options = getResult().getLIR().getOptions();
 581             if (encoding.hasBase() || GeneratePIC.getValue(options)) {
 582                 if (GeneratePIC.getValue(options)) {
 583                     Variable baseAddress = newVariable(lirKindTool.getWordKind());
 584                     AMD64HotSpotMove.BaseMove move = new AMD64HotSpotMove.BaseMove(baseAddress, config);
 585                     append(move);
 586                     base = baseAddress;
 587                 } else {
 588                     base = emitLoadConstant(lirKindTool.getWordKind(), JavaConstant.forLong(encoding.getBase()));
 589                 }
 590             }
 591             append(new AMD64Move.CompressPointer(result, asAllocatable(pointer), base, encoding, nonNull, getLIRKindTool()));
 592             return result;
 593         }
 594     }
 595 
 596     @Override
 597     public Value emitUncompress(Value pointer, CompressEncoding encoding, boolean nonNull) {
 598         LIRKind inputKind = pointer.getValueKind(LIRKind.class);
 599         LIRKindTool lirKindTool = getLIRKindTool();
 600         assert inputKind.getPlatformKind() == lirKindTool.getNarrowOopKind().getPlatformKind();
 601         if (inputKind.isReference(0)) {
 602             // oop
 603             Variable result = newVariable(lirKindTool.getObjectKind());
 604             append(new AMD64Move.UncompressPointer(result, asAllocatable(pointer), getProviders().getRegisters().getHeapBaseRegister().asValue(), encoding, nonNull, lirKindTool));
 605             return result;
 606         } else {
 607             // metaspace pointer
 608             LIRKind uncompressedKind = lirKindTool.getWordKind();
 609             Variable result = newVariable(uncompressedKind);
 610             AllocatableValue base = Value.ILLEGAL;
 611             OptionValues options = getResult().getLIR().getOptions();
 612             if (encoding.hasBase() || GeneratePIC.getValue(options)) {
 613                 if (GeneratePIC.getValue(options)) {
 614                     Variable baseAddress = newVariable(uncompressedKind);
 615                     AMD64HotSpotMove.BaseMove move = new AMD64HotSpotMove.BaseMove(baseAddress, config);
 616                     append(move);
 617                     base = baseAddress;
 618                 } else {
 619                     base = emitLoadConstant(uncompressedKind, JavaConstant.forLong(encoding.getBase()));
 620                 }
 621             }
 622             append(new AMD64Move.UncompressPointer(result, asAllocatable(pointer), base, encoding, nonNull, lirKindTool));
 623             return result;
 624         }
 625     }
 626 
 627     @Override
 628     public void emitNullCheck(Value address, LIRFrameState state) {
 629         if (address.getValueKind().getPlatformKind() == getLIRKindTool().getNarrowOopKind().getPlatformKind()) {
 630             CompressEncoding encoding = config.getOopEncoding();
 631             Value uncompressed;
 632             if (encoding.getShift() <= 3) {
 633                 LIRKind wordKind = LIRKind.unknownReference(target().arch.getWordKind());
 634                 uncompressed = new AMD64AddressValue(wordKind, getProviders().getRegisters().getHeapBaseRegister().asValue(wordKind), asAllocatable(address), Scale.fromInt(1 << encoding.getShift()),
 635                                 0);
 636             } else {
 637                 uncompressed = emitUncompress(address, encoding, false);
 638             }
 639             append(new AMD64Move.NullCheckOp(asAddressValue(uncompressed), state));
 640             return;

 641         }
 642         super.emitNullCheck(address, state);
 643     }
 644 
 645     @Override
 646     public LIRInstruction createBenchmarkCounter(String name, String group, Value increment) {
 647         if (BenchmarkCounters.enabled) {
 648             return new AMD64HotSpotCounterOp(name, group, increment, getProviders().getRegisters(), config, getOrInitRescueSlot());
 649         }
 650         throw GraalError.shouldNotReachHere("BenchmarkCounters are not enabled!");
 651     }
 652 
 653     @Override
 654     public LIRInstruction createMultiBenchmarkCounter(String[] names, String[] groups, Value[] increments) {
 655         if (BenchmarkCounters.enabled) {
 656             return new AMD64HotSpotCounterOp(names, groups, increments, getProviders().getRegisters(), config, getOrInitRescueSlot());
 657         }
 658         throw GraalError.shouldNotReachHere("BenchmarkCounters are not enabled!");
 659     }
 660 
 661     @Override
 662     public void emitPrefetchAllocate(Value address) {
< prev index next >