114 this.opcode = opcode; 115 this.size = size; 116 117 this.x = x; 118 this.y = y; 119 } 120 121 @Override 122 public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) { 123 if (isRegister(x)) { 124 opcode.emit(masm, size, asRegister(x), y, shouldAnnotate()); 125 } else { 126 assert isStackSlot(x); 127 opcode.emit(masm, size, (AMD64Address) crb.asAddress(x), y, shouldAnnotate()); 128 } 129 } 130 131 protected boolean shouldAnnotate() { 132 return false; 133 } 134 } 135 136 /** 137 * Instruction that has one {@link AllocatableValue} operand and one 32-bit immediate operand 138 * that needs to be patched at runtime. 139 */ 140 public static class VMConstOp extends ConstOp { 141 public static final LIRInstructionClass<VMConstOp> TYPE = LIRInstructionClass.create(VMConstOp.class); 142 143 protected final VMConstant c; 144 145 public VMConstOp(AMD64MIOp opcode, AllocatableValue x, VMConstant c) { 146 super(TYPE, opcode, DWORD, x, 0xDEADDEAD); 147 this.c = c; 148 } 149 150 @Override 151 public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) { 152 crb.recordInlineDataInCode(c); 153 super.emitCode(crb, masm); | 114 this.opcode = opcode; 115 this.size = size; 116 117 this.x = x; 118 this.y = y; 119 } 120 121 @Override 122 public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) { 123 if (isRegister(x)) { 124 opcode.emit(masm, size, asRegister(x), y, shouldAnnotate()); 125 } else { 126 assert isStackSlot(x); 127 opcode.emit(masm, size, (AMD64Address) crb.asAddress(x), y, shouldAnnotate()); 128 } 129 } 130 131 protected boolean shouldAnnotate() { 132 return false; 133 } 134 135 public AMD64MIOp getOpcode() { 136 return opcode; 137 } 138 } 139 140 /** 141 * Instruction that has one {@link AllocatableValue} operand and one 32-bit immediate operand 142 * that needs to be patched at runtime. 143 */ 144 public static class VMConstOp extends ConstOp { 145 public static final LIRInstructionClass<VMConstOp> TYPE = LIRInstructionClass.create(VMConstOp.class); 146 147 protected final VMConstant c; 148 149 public VMConstOp(AMD64MIOp opcode, AllocatableValue x, VMConstant c) { 150 super(TYPE, opcode, DWORD, x, 0xDEADDEAD); 151 this.c = c; 152 } 153 154 @Override 155 public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) { 156 crb.recordInlineDataInCode(c); 157 super.emitCode(crb, masm); |