MCPcopy Create free account
hub / github.com/ReadyTalk/avian / queueImmediately

Method queueImmediately

classpath/java/util/regex/PikeVM.java:147–164  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 1

matchesMethod · 0.95

Calls 2

isScheduledMethod · 0.95
copyOfMethod · 0.45

Tested by

no test coverage detected