From 553b1a9e0f00efc92ca04cc7453aaee87267cb28 Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 19 Feb 1999 13:11:25 +0000 Subject: [PATCH] fix for double, ong constants git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@284 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/bytecode/GrowableConstantPool.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/jode/jode/bytecode/GrowableConstantPool.java b/jode/jode/bytecode/GrowableConstantPool.java index 743bfe8..922745a 100644 --- a/jode/jode/bytecode/GrowableConstantPool.java +++ b/jode/jode/bytecode/GrowableConstantPool.java @@ -31,10 +31,10 @@ public class GrowableConstantPool extends ConstantPool { public GrowableConstantPool () { count = 1; - tags = new int[1]; - indices1 = new int[1]; - indices2 = new int[1]; - constants = new Object[1]; + tags = new int[128]; + indices1 = new int[128]; + indices2 = new int[128]; + constants = new Object[128]; } public final void grow(int wantedSize) { @@ -55,13 +55,13 @@ public class GrowableConstantPool extends ConstantPool { } } - public int putConstant(int tag, Object constant) { + int putConstant(int tag, Object constant) { String key = tag+"C"+constant; Integer index = (Integer) entryToIndex.get(key); if (index != null) return index.intValue(); int newIndex = count; - grow(count+1); + grow(count+(tag == DOUBLE || tag == LONG ? 2 : 1)); tags[newIndex] = tag; constants[newIndex] = constant; entryToIndex.put(key, new Integer(newIndex)); @@ -71,7 +71,7 @@ public class GrowableConstantPool extends ConstantPool { return newIndex; } - public int putIndexed(int tag, int index1, int index2) { + int putIndexed(int tag, int index1, int index2) { String key = tag+"I"+index1+","+index2; Integer index = (Integer) entryToIndex.get(key); if (index != null)