# HG changeset patch # User Doug Simon # Date 1475143467 -7200 # Node ID c968119ee980925ac9827ee26b47c21341c499ab # Parent fec796c53d535cfe895cd3d07c8bb08a47045786 improved documentation of BytecodePosition API diff -r fec796c53d53 -r c968119ee980 jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/BytecodePosition.java --- a/jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/BytecodePosition.java Thu Sep 29 10:01:23 2016 +0200 +++ b/jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/BytecodePosition.java Thu Sep 29 12:04:27 2016 +0200 @@ -43,18 +43,15 @@ * * @param caller the parent position * @param method the method - * @param bci a BCI within the method + * @param bci a BCI such that {@code method.codeSize() == 0 || bci < method.getCodeSize()}. That + * is, if code size is 0 then allow any value, otherwise the bci must be less than + * the code size. */ public BytecodePosition(BytecodePosition caller, ResolvedJavaMethod method, int bci) { assert method != null; this.caller = caller; this.method = method; this.bci = bci; - /* - * Make sure the bci is within range of the bytecodes. If the code size is 0 then allow any - * value, otherwise the bci must be less than the code size. Any negative value is also - * allowed to represent special bytecode states. - */ int codeSize = method.getCodeSize(); if (codeSize != 0 && bci >= codeSize) { throw new IllegalArgumentException(String.format("bci %d is out of range for %s %d bytes", bci, method.format("%H.%n(%p)"), codeSize));