1.1 --- a/src/share/vm/c1/c1_Canonicalizer.cpp Mon Mar 08 04:46:30 2010 -0800 1.2 +++ b/src/share/vm/c1/c1_Canonicalizer.cpp Tue Mar 09 20:16:19 2010 +0100 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright 1999-2006 Sun Microsystems, Inc. All Rights Reserved. 1.6 + * Copyright 1999-2010 Sun Microsystems, Inc. All Rights Reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -222,11 +222,15 @@ 1.11 } 1.12 } else { 1.13 LoadField* lf = x->array()->as_LoadField(); 1.14 - if (lf != NULL && lf->field()->is_constant()) { 1.15 - ciObject* c = lf->field()->constant_value().as_object(); 1.16 - if (c->is_array()) { 1.17 - ciArray* array = (ciArray*) c; 1.18 - set_constant(array->length()); 1.19 + if (lf != NULL) { 1.20 + ciField* field = lf->field(); 1.21 + if (field->is_constant() && field->is_static()) { 1.22 + // final static field 1.23 + ciObject* c = field->constant_value().as_object(); 1.24 + if (c->is_array()) { 1.25 + ciArray* array = (ciArray*) c; 1.26 + set_constant(array->length()); 1.27 + } 1.28 } 1.29 } 1.30 }