Mercurial > hg > truffle
changeset 15924:48b85f37e03b
BciBlockMapping: allocate smaller array if possible
author | Bernhard Urban <bernhard.urban@jku.at> |
---|---|
date | Tue, 27 May 2014 13:04:29 +0200 |
parents | d0c7bd38e700 |
children | 674d4065e9fb |
files | graal/com.oracle.graal.java/src/com/oracle/graal/java/BciBlockMapping.java |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/BciBlockMapping.java Tue May 27 12:15:31 2014 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/BciBlockMapping.java Tue May 27 13:04:29 2014 +0200 @@ -280,9 +280,10 @@ this.method = method; exceptionHandlers = method.getExceptionHandlers(); stream = new BytecodeStream(method.getCode()); - this.blockMap = new BciBlock[method.getCodeSize()]; + int codeSize = method.getCodeSize(); + this.blockMap = new BciBlock[codeSize]; this.blocks = new ArrayList<>(); - this.loopHeaders = new BciBlock[64]; + this.loopHeaders = new BciBlock[codeSize < 64 ? codeSize : 64]; } /**