src/share/classes/java/lang/invoke/BoundMethodHandle.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
*** old/src/share/classes/java/lang/invoke/BoundMethodHandle.java Wed Feb 26 15:43:13 2014
--- new/src/share/classes/java/lang/invoke/BoundMethodHandle.java Wed Feb 26 15:43:13 2014
*** 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