MCPcopy Create free account
hub / github.com/beanshell/beanshell / put

Method put

src/bsh/org/objectweb/asm/Label.java:160–188  ·  view source on GitHub ↗

Puts a reference to this label in the bytecode of a method. If the position of the label is known, the offset is computed and written directly. Otherwise, a null offset is written and a new forward reference is declared for this label. @param owner the code writer that calls this method. @param out

(
    final CodeWriter owner,
    final ByteVector out,
    final int source,
    final boolean wideOffset)

Source from the content-addressed store, hash-verified

158 */
159
160 void put (
161 final CodeWriter owner,
162 final ByteVector out,
163 final int source,
164 final boolean wideOffset)
165 {
166 if (CodeWriter.CHECK) {
167 if (this.owner == null) {
168 this.owner = owner;
169 } else if (this.owner != owner) {
170 throw new IllegalArgumentException();
171 }
172 }
173 if (resolved) {
174 if (wideOffset) {
175 out.put4(position - source);
176 } else {
177 out.put2(position - source);
178 }
179 } else {
180 if (wideOffset) {
181 addReference(-1 - source, out.length);
182 out.put4(-1);
183 } else {
184 addReference(source, out.length);
185 out.put2(-1);
186 }
187 }
188 }
189
190 /**
191 * Adds a forward reference to this label. This method must be called only for

Callers

nothing calls this directly

Calls 3

addReferenceMethod · 0.95
put4Method · 0.80
put2Method · 0.80

Tested by

no test coverage detected