< prev index next >

test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/amd64/AMD64TestAssembler.java

Print this page




  68 
  69     @Override
  70     public void emitEpilogue() {
  71         recordMark(config.MARKID_DEOPT_HANDLER_ENTRY);
  72         recordCall(new HotSpotForeignCallTarget(config.handleDeoptStub), 5, true, null);
  73         code.emitByte(0xE8); // CALL rel32
  74         code.emitInt(0xDEADDEAD);
  75     }
  76 
  77     @Override
  78     public void emitGrowStack(int size) {
  79         // SUB rsp, size
  80         code.emitByte(0x48);
  81         code.emitByte(0x81);
  82         code.emitByte(0xEC);
  83         code.emitInt(size);
  84     }
  85 
  86     @Override
  87     public Register emitIntArg0() {
  88         return codeCache.getRegisterConfig().getCallingConventionRegisters(HotSpotCallingConventionType.JavaCall, JavaKind.Int)[0];
  89     }
  90 
  91     @Override
  92     public Register emitIntArg1() {
  93         return codeCache.getRegisterConfig().getCallingConventionRegisters(HotSpotCallingConventionType.JavaCall, JavaKind.Int)[1];
  94     }
  95 
  96     private void emitREX(boolean w, int r, int x, int b) {
  97         int wrxb = (w ? 0x08 : 0) | ((r >> 3) << 2) | ((x >> 3) << 1) | (b >> 3);
  98         if (wrxb != 0) {
  99             code.emitByte(0x40 | wrxb);
 100         }
 101     }
 102 
 103     private void emitModRMReg(boolean w, int opcode, int r, int m) {
 104         emitREX(w, r, 0, m);
 105         code.emitByte((byte) opcode);
 106         code.emitByte((byte) 0xC0 | ((r & 0x7) << 3) | (m & 0x7));
 107     }
 108 
 109     private void emitModRMMemory(boolean w, int opcode, int r, int b, int offset) {
 110         emitREX(w, r, 0, b);
 111         code.emitByte((byte) opcode);
 112         code.emitByte((byte) 0x80 | ((r & 0x7) << 3) | (b & 0x7));
 113         code.emitInt(offset);




  68 
  69     @Override
  70     public void emitEpilogue() {
  71         recordMark(config.MARKID_DEOPT_HANDLER_ENTRY);
  72         recordCall(new HotSpotForeignCallTarget(config.handleDeoptStub), 5, true, null);
  73         code.emitByte(0xE8); // CALL rel32
  74         code.emitInt(0xDEADDEAD);
  75     }
  76 
  77     @Override
  78     public void emitGrowStack(int size) {
  79         // SUB rsp, size
  80         code.emitByte(0x48);
  81         code.emitByte(0x81);
  82         code.emitByte(0xEC);
  83         code.emitInt(size);
  84     }
  85 
  86     @Override
  87     public Register emitIntArg0() {
  88         return codeCache.getRegisterConfig().getCallingConventionRegisters(HotSpotCallingConventionType.JavaCall, JavaKind.Int).get(0);
  89     }
  90 
  91     @Override
  92     public Register emitIntArg1() {
  93         return codeCache.getRegisterConfig().getCallingConventionRegisters(HotSpotCallingConventionType.JavaCall, JavaKind.Int).get(1);
  94     }
  95 
  96     private void emitREX(boolean w, int r, int x, int b) {
  97         int wrxb = (w ? 0x08 : 0) | ((r >> 3) << 2) | ((x >> 3) << 1) | (b >> 3);
  98         if (wrxb != 0) {
  99             code.emitByte(0x40 | wrxb);
 100         }
 101     }
 102 
 103     private void emitModRMReg(boolean w, int opcode, int r, int m) {
 104         emitREX(w, r, 0, m);
 105         code.emitByte((byte) opcode);
 106         code.emitByte((byte) 0xC0 | ((r & 0x7) << 3) | (m & 0x7));
 107     }
 108 
 109     private void emitModRMMemory(boolean w, int opcode, int r, int b, int offset) {
 110         emitREX(w, r, 0, b);
 111         code.emitByte((byte) opcode);
 112         code.emitByte((byte) 0x80 | ((r & 0x7) << 3) | (b & 0x7));
 113         code.emitInt(offset);


< prev index next >