Mercurial > hg > graal-compiler
annotate graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ArraySubstitutions.java @ 22348:17b96d2fe8d6
[SPARC] Peephole optimization of empty delay slots
author | Stefan Anzinger <stefan.anzinger@oracle.com> |
---|---|
date | Fri, 24 Jul 2015 13:26:44 +0200 |
parents | 0e095e2c24e2 |
children | 05183a084a08 |
rev | line source |
---|---|
10027 | 1 /* |
13971 | 2 * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. |
10027 | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | |
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 | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 * | |
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
20 * or visit www.oracle.com if you need additional information or have any | |
21 * questions. | |
22 */ | |
23 package com.oracle.graal.replacements; | |
24 | |
22054 | 25 import jdk.internal.jvmci.meta.*; |
26 | |
10027 | 27 import com.oracle.graal.nodes.*; |
28 import com.oracle.graal.nodes.java.*; | |
29 | |
21017
66d45b977e44
Add missing //JaCoCo Exclude directives.
Roland Schatz <roland.schatz@oracle.com>
parents:
20841
diff
changeset
|
30 // JaCoCo Exclude |
66d45b977e44
Add missing //JaCoCo Exclude directives.
Roland Schatz <roland.schatz@oracle.com>
parents:
20841
diff
changeset
|
31 |
10027 | 32 /** |
33 * Substitutions for {@link java.lang.reflect.Array} methods. | |
34 */ | |
35 public class ArraySubstitutions { | |
36 | |
13971 | 37 public static int getLength(Object array) { |
38 if (!array.getClass().isArray()) { | |
19775
14e703edb2ab
use GraphBuilderPlugins for method substitutions, intrinsics and snippets (GRAAL-982)
Doug Simon <doug.simon@oracle.com>
parents:
16382
diff
changeset
|
39 DeoptimizeNode.deopt(DeoptimizationAction.None, DeoptimizationReason.RuntimeConstraint); |
13971 | 40 } |
41 return ArrayLengthNode.arrayLength(array); | |
42 } | |
43 | |
10027 | 44 } |