src/share/classes/java/lang/invoke/BoundMethodHandle.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File jdk Cdiff src/share/classes/java/lang/invoke/BoundMethodHandle.java

src/share/classes/java/lang/invoke/BoundMethodHandle.java

Print this page
rev 9091 : [mq]: 8027827.catchException.ver03
rev 9092 : [mq]: 8027827.caching

*** 859,864 **** --- 859,878 ---- /** * All subclasses must provide such a value describing their type signature. */ static final SpeciesData SPECIES_DATA = SpeciesData.EMPTY; + + private static final SpeciesData[] SPECIES_DATA_CACHE = new SpeciesData[5]; + private static SpeciesData checkCache(int size, String types) { + int idx = size - 1; + SpeciesData data = SPECIES_DATA_CACHE[idx]; + if (data != null) return data; + SPECIES_DATA_CACHE[idx] = data = getSpeciesData(types); + return data; + } + static SpeciesData speciesData_L() { return checkCache(1, "L"); } + static SpeciesData speciesData_LL() { return checkCache(2, "LL"); } + static SpeciesData speciesData_LLL() { return checkCache(3, "LLL"); } + static SpeciesData speciesData_LLLL() { return checkCache(4, "LLLL"); } + static SpeciesData speciesData_LLLLL() { return checkCache(5, "LLLLL"); } }
src/share/classes/java/lang/invoke/BoundMethodHandle.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File