Mercurial > hg > graal-jvmci-8
changeset 23770:c968119ee980
improved documentation of BytecodePosition API
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 29 Sep 2016 12:04:27 +0200 |
parents | fec796c53d53 |
children | a123fd9add6b |
files | jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/BytecodePosition.java |
diffstat | 1 files changed, 3 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- 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));