- this.immediate = immediate;
- this.immediate.setImmutable();
- if (immediate.length() != dock.getShip().getFleet().getShiftWidth())
- throw new RuntimeException("attempt to create a Shift instruction with a "+immediate.length()+
- "-bit immediate on a Fleet that uses "+dock.getShip().getFleet().getShiftWidth()+
- "-bit shift instructions");
+ this.immediate = new DeferredBitVector() {
+ public BitVector getBitVector() {
+ BitVector ret = arg.getBitVector();
+ if (ret.length() != dock.getShip().getFleet().getShiftWidth())
+ throw new RuntimeException("attempt to create a Shift instruction with a "+ret.length()+
+ "-bit immediate on a Fleet that uses "+dock.getShip().getFleet().getShiftWidth()+
+ "-bit shift instructions");
+ return ret;
+ }
+ };