Mercurial > people > rkennke > jdk9-shenandoah-final > nashorn
changeset 831:fa068c865e46
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 | 03b2757e2eba |
children | 7bb20a02bad0 |
files | src/jdk/nashorn/internal/codegen/CompilationEnvironment.java |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/jdk/nashorn/internal/codegen/CompilationEnvironment.java Thu Mar 27 11:45:54 2014 +0100 +++ b/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); }