changeset 156:3e4369fb810b

8011219: Regression with recent PropertyMap history changes Reviewed-by: jlaskey, lagergren
author hannesw
date Tue, 02 Apr 2013 13:55:49 +0200
parents a094fc010120
children 5362d96d5915
files src/jdk/nashorn/internal/runtime/PropertyMap.java
diffstat 1 files changed, 8 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk/nashorn/internal/runtime/PropertyMap.java	Sun Mar 31 08:19:11 2013 -0300
+++ b/src/jdk/nashorn/internal/runtime/PropertyMap.java	Tue Apr 02 13:55:49 2013 +0200
@@ -526,13 +526,11 @@
      * @param newMap   {@link PropertyMap} associated with prototype.
      */
     private void addToProtoHistory(final ScriptObject newProto, final PropertyMap newMap) {
-        if (!properties.isEmpty()) {
-            if (protoHistory == null) {
-                protoHistory = new WeakHashMap<>();
-            }
+        if (protoHistory == null) {
+            protoHistory = new WeakHashMap<>();
+        }
 
-            protoHistory.put(newProto, new WeakReference<>(newMap));
-        }
+        protoHistory.put(newProto, new WeakReference<>(newMap));
     }
 
     /**
@@ -542,13 +540,11 @@
      * @param newMap   Modified {@link PropertyMap}.
      */
     private void addToHistory(final Property property, final PropertyMap newMap) {
-        if (!properties.isEmpty()) {
-            if (history == null) {
-                history = new LinkedHashMap<>();
-            }
+        if (history == null) {
+            history = new LinkedHashMap<>();
+        }
 
-            history.put(property, newMap);
-        }
+        history.put(property, newMap);
     }
 
     /**