Mercurial > hg > truffle
comparison src/share/vm/c1/c1_Canonicalizer.cpp @ 1295:3cf667df43ef
6919934: JSR 292 needs to support x86 C1
Summary: This implements JSR 292 support for C1 x86.
Reviewed-by: never, jrose, kvn
author | twisti |
---|---|
date | Tue, 09 Mar 2010 20:16:19 +0100 |
parents | a61af66fc99e |
children | c18cbe5936b8 |
comparison
equal
deleted
inserted
replaced
1293:51db1e4b379d | 1295:3cf667df43ef |
---|---|
1 /* | 1 /* |
2 * Copyright 1999-2006 Sun Microsystems, Inc. All Rights Reserved. | 2 * Copyright 1999-2010 Sun Microsystems, Inc. All Rights Reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
220 assert(length->type()->as_IntConstant() != NULL, "array length must be integer"); | 220 assert(length->type()->as_IntConstant() != NULL, "array length must be integer"); |
221 set_constant(length->type()->as_IntConstant()->value()); | 221 set_constant(length->type()->as_IntConstant()->value()); |
222 } | 222 } |
223 } else { | 223 } else { |
224 LoadField* lf = x->array()->as_LoadField(); | 224 LoadField* lf = x->array()->as_LoadField(); |
225 if (lf != NULL && lf->field()->is_constant()) { | 225 if (lf != NULL) { |
226 ciObject* c = lf->field()->constant_value().as_object(); | 226 ciField* field = lf->field(); |
227 if (c->is_array()) { | 227 if (field->is_constant() && field->is_static()) { |
228 ciArray* array = (ciArray*) c; | 228 // final static field |
229 set_constant(array->length()); | 229 ciObject* c = field->constant_value().as_object(); |
230 if (c->is_array()) { | |
231 ciArray* array = (ciArray*) c; | |
232 set_constant(array->length()); | |
233 } | |
230 } | 234 } |
231 } | 235 } |
232 } | 236 } |
233 } | 237 } |
234 | 238 |