changeset 24732:e7d905b01c08

8038416: Access to undefined scoped variables deoptimized too much Reviewed-by: jlaskey, lagergren
author attila
date Thu, 27 Mar 2014 14:09:40 +0100
parents ab0c8fc915ae
children 1e825be55fd1
files nashorn/src/jdk/nashorn/internal/codegen/CompilationEnvironment.java
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/nashorn/src/jdk/nashorn/internal/codegen/CompilationEnvironment.java	Thu Mar 27 11:45:54 2014 +0100
+++ b/nashorn/src/jdk/nashorn/internal/codegen/CompilationEnvironment.java	Thu Mar 27 14:09:40 2014 +0100
@@ -420,8 +420,9 @@
         final Property property = find.getProperty();
         final Class<?> propertyClass = property.getCurrentType();
         if (propertyClass == null) {
-            // propertyClass == null means its Undefined, which is object
-            return Type.OBJECT;
+            // propertyClass == null means its value is Undefined. It is probably not initialized yet, so we won't make
+            // a type assumption yet.
+            return null;
         } else if (propertyClass.isPrimitive()) {
             return Type.typeFor(propertyClass);
         }