17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23 package org.graalvm.compiler.code;
24
25 import static java.util.Collections.emptyList;
26 import static java.util.Collections.unmodifiableList;
27 import static jdk.vm.ci.meta.MetaUtil.identityHashCodeString;
28
29 import java.util.ArrayList;
30 import java.util.Arrays;
31 import java.util.Collection;
32 import java.util.Collections;
33 import java.util.List;
34 import java.util.Objects;
35
36 import org.graalvm.compiler.graph.NodeSourcePosition;
37
38 import jdk.vm.ci.code.DebugInfo;
39 import jdk.vm.ci.code.StackSlot;
40 import jdk.vm.ci.code.site.Call;
41 import jdk.vm.ci.code.site.ConstantReference;
42 import jdk.vm.ci.code.site.DataPatch;
43 import jdk.vm.ci.code.site.DataSectionReference;
44 import jdk.vm.ci.code.site.ExceptionHandler;
45 import jdk.vm.ci.code.site.Infopoint;
46 import jdk.vm.ci.code.site.InfopointReason;
47 import jdk.vm.ci.code.site.Mark;
48 import jdk.vm.ci.code.site.Reference;
49 import jdk.vm.ci.code.site.Site;
50 import jdk.vm.ci.meta.Assumptions.Assumption;
51 import jdk.vm.ci.meta.InvokeTarget;
52 import jdk.vm.ci.meta.ResolvedJavaField;
53 import jdk.vm.ci.meta.ResolvedJavaMethod;
54
55 /**
56 * Represents the output from compiling a method, including the compiled machine code, associated
346
347 /**
348 * Gets the methods whose bytecodes were used as input to the compilation.
349 *
350 * The caller must not modify the contents of the returned array.
351 *
352 * @return {@code null} if the compilation did not record method dependencies otherwise the
353 * methods whose bytecodes were used as input to the compilation with the first element
354 * being the root method of the compilation
355 */
356 public ResolvedJavaMethod[] getMethods() {
357 return methods;
358 }
359
360 /**
361 * Sets the fields that were referenced from the bytecodes that were used as input to the
362 * compilation.
363 *
364 * @param accessedFields the collected set of fields accessed during compilation
365 */
366 public void setFields(Collection<ResolvedJavaField> accessedFields) {
367 assert accessedFields != null;
368 fields = accessedFields.toArray(new ResolvedJavaField[accessedFields.size()]);
369 }
370
371 /**
372 * Gets the fields that were referenced from bytecodes that were used as input to the
373 * compilation.
374 *
375 * The caller must not modify the contents of the returned array.
376 *
377 * @return {@code null} if the compilation did not record fields dependencies otherwise the
378 * fields that were accessed from bytecodes were used as input to the compilation.
379 */
380 public ResolvedJavaField[] getFields() {
381 return fields;
382 }
383
384 public void setBytecodeSize(int bytecodeSize) {
385 checkOpen();
386 this.bytecodeSize = bytecodeSize;
387 }
388
389 public int getBytecodeSize() {
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23 package org.graalvm.compiler.code;
24
25 import static java.util.Collections.emptyList;
26 import static java.util.Collections.unmodifiableList;
27 import static jdk.vm.ci.meta.MetaUtil.identityHashCodeString;
28
29 import java.util.ArrayList;
30 import java.util.Arrays;
31 import java.util.Collection;
32 import java.util.Collections;
33 import java.util.List;
34 import java.util.Objects;
35
36 import org.graalvm.compiler.graph.NodeSourcePosition;
37 import org.graalvm.util.EconomicSet;
38
39 import jdk.vm.ci.code.DebugInfo;
40 import jdk.vm.ci.code.StackSlot;
41 import jdk.vm.ci.code.site.Call;
42 import jdk.vm.ci.code.site.ConstantReference;
43 import jdk.vm.ci.code.site.DataPatch;
44 import jdk.vm.ci.code.site.DataSectionReference;
45 import jdk.vm.ci.code.site.ExceptionHandler;
46 import jdk.vm.ci.code.site.Infopoint;
47 import jdk.vm.ci.code.site.InfopointReason;
48 import jdk.vm.ci.code.site.Mark;
49 import jdk.vm.ci.code.site.Reference;
50 import jdk.vm.ci.code.site.Site;
51 import jdk.vm.ci.meta.Assumptions.Assumption;
52 import jdk.vm.ci.meta.InvokeTarget;
53 import jdk.vm.ci.meta.ResolvedJavaField;
54 import jdk.vm.ci.meta.ResolvedJavaMethod;
55
56 /**
57 * Represents the output from compiling a method, including the compiled machine code, associated
347
348 /**
349 * Gets the methods whose bytecodes were used as input to the compilation.
350 *
351 * The caller must not modify the contents of the returned array.
352 *
353 * @return {@code null} if the compilation did not record method dependencies otherwise the
354 * methods whose bytecodes were used as input to the compilation with the first element
355 * being the root method of the compilation
356 */
357 public ResolvedJavaMethod[] getMethods() {
358 return methods;
359 }
360
361 /**
362 * Sets the fields that were referenced from the bytecodes that were used as input to the
363 * compilation.
364 *
365 * @param accessedFields the collected set of fields accessed during compilation
366 */
367 public void setFields(EconomicSet<ResolvedJavaField> accessedFields) {
368 if (accessedFields != null) {
369 fields = accessedFields.toArray(new ResolvedJavaField[accessedFields.size()]);
370 }
371 }
372
373 /**
374 * Gets the fields that were referenced from bytecodes that were used as input to the
375 * compilation.
376 *
377 * The caller must not modify the contents of the returned array.
378 *
379 * @return {@code null} if the compilation did not record fields dependencies otherwise the
380 * fields that were accessed from bytecodes were used as input to the compilation.
381 */
382 public ResolvedJavaField[] getFields() {
383 return fields;
384 }
385
386 public void setBytecodeSize(int bytecodeSize) {
387 checkOpen();
388 this.bytecodeSize = bytecodeSize;
389 }
390
391 public int getBytecodeSize() {
|