--- a/nashorn/src/jdk/nashorn/internal/runtime/PropertyMap.java Tue Jun 11 13:09:43 2013 +0530
+++ b/nashorn/src/jdk/nashorn/internal/runtime/PropertyMap.java Tue Jun 11 17:50:10 2013 +0200
@@ -95,7 +95,6 @@
*/
private PropertyMap(final PropertyHashMap properties, final int fieldCount, final int fieldMaximum) {
this.properties = properties;
- this.hashCode = computeHashCode();
this.fieldCount = fieldCount;
this.fieldMaximum = fieldMaximum;
@@ -125,7 +124,6 @@
this.spillLength = propertyMap.spillLength;
this.fieldCount = propertyMap.fieldCount;
this.fieldMaximum = propertyMap.fieldMaximum;
- this.hashCode = computeHashCode();
if (Context.DEBUG) {
count++;
@@ -610,6 +608,9 @@
@Override
public int hashCode() {
+ if (hashCode == 0 && !properties.isEmpty()) {
+ hashCode = computeHashCode();
+ }
return hashCode;
}