< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64CCall.java

Print this page




  43     @Use({REG, STACK}) protected Value[] parameters;
  44     @Use({REG}) protected Value functionPtr;
  45     @Use({REG}) protected Value numberOfFloatingPointArguments;
  46 
  47     public AMD64CCall(Value result, Value functionPtr, Value numberOfFloatingPointArguments, Value[] parameters) {
  48         super(TYPE);
  49         this.result = result;
  50         this.functionPtr = functionPtr;
  51         this.parameters = parameters;
  52         this.numberOfFloatingPointArguments = numberOfFloatingPointArguments;
  53     }
  54 
  55     @Override
  56     public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) {
  57         directCall(masm);
  58     }
  59 
  60     private void directCall(AMD64MacroAssembler masm) {
  61         Register reg = ValueUtil.asRegister(functionPtr);
  62         masm.call(reg);
  63         masm.ensureUniquePC();
  64     }
  65 
  66     @Override
  67     public boolean destroysCallerSavedRegisters() {
  68         return true;
  69     }
  70 
  71 }


  43     @Use({REG, STACK}) protected Value[] parameters;
  44     @Use({REG}) protected Value functionPtr;
  45     @Use({REG}) protected Value numberOfFloatingPointArguments;
  46 
  47     public AMD64CCall(Value result, Value functionPtr, Value numberOfFloatingPointArguments, Value[] parameters) {
  48         super(TYPE);
  49         this.result = result;
  50         this.functionPtr = functionPtr;
  51         this.parameters = parameters;
  52         this.numberOfFloatingPointArguments = numberOfFloatingPointArguments;
  53     }
  54 
  55     @Override
  56     public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) {
  57         directCall(masm);
  58     }
  59 
  60     private void directCall(AMD64MacroAssembler masm) {
  61         Register reg = ValueUtil.asRegister(functionPtr);
  62         masm.call(reg);
  63         masm.nop(8);
  64     }
  65 
  66     @Override
  67     public boolean destroysCallerSavedRegisters() {
  68         return true;
  69     }
  70 
  71 }
< prev index next >