Schedules the instruction at nextPC to be executed immediately. For non-matching steps (SPLIT, SAVE_STATE, etc) we need to schedule the corresponding program counter(s) to be handled right after this opcode, before advancing to the next character. To achieve this, we insert the
(int currentPC, int nextPC,
boolean copyThreadState)
| 145 | * same {@code nextPC} already) |
| 146 | */ |
| 147 | public boolean queueImmediately(int currentPC, int nextPC, |
| 148 | boolean copyThreadState) { |
| 149 | if (isScheduled(nextPC)) { |
| 150 | return false; |
| 151 | } |
| 152 | int[] offsets = this.offsets[currentPC]; |
| 153 | if (copyThreadState) { |
| 154 | offsets = java.util.Arrays.copyOf(offsets, offsetsCount); |
| 155 | } |
| 156 | if (currentPC == tail) { |
| 157 | tail = nextPC; |
| 158 | } else { |
| 159 | next[nextPC] = next[currentPC]; |
| 160 | } |
| 161 | this.offsets[nextPC] = offsets; |
| 162 | next[currentPC] = nextPC + 1; |
| 163 | return true; |
| 164 | } |
| 165 | |
| 166 | /** |
| 167 | * Schedules the instruction at {@code nextPC} to be executed in the next |
no test coverage detected