Mercurial > hg > truffle
annotate graal/com.oracle.max.graal.hotspot/src/com/oracle/graal/hotspot/snippets/IntrinsifyArrayCopyPhase.java @ 5060:4ed4295ce15f
Update import statements.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Thu, 08 Mar 2012 19:11:12 +0100 |
parents | ed559a528128 |
children |
rev | line source |
---|---|
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1 /* |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
4 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
8 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
14 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
18 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
21 * questions. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
22 */ |
5060
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
23 package com.oracle.graal.hotspot.snippets; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
24 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
25 import java.lang.reflect.*; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
26 |
4412
ccbdd90bf356
Add new arraycopy intrinsics : Object (when no storecheck required), Float and Double
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4199
diff
changeset
|
27 import com.oracle.max.cri.ci.*; |
4199
aaac4894175c
Renamed cri packages from sun to oracle.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4142
diff
changeset
|
28 import com.oracle.max.cri.ri.*; |
5060
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
29 import com.oracle.graal.compiler.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
30 import com.oracle.graal.compiler.phases.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
31 import com.oracle.graal.compiler.util.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
32 import com.oracle.graal.cri.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
33 import com.oracle.graal.debug.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
34 import com.oracle.graal.graph.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
35 import com.oracle.graal.nodes.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
36 import com.oracle.graal.nodes.java.*; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
37 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
38 public class IntrinsifyArrayCopyPhase extends Phase { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
39 private final GraalRuntime runtime; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
40 private RiResolvedMethod arrayCopy; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
41 private RiResolvedMethod byteArrayCopy; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
42 private RiResolvedMethod shortArrayCopy; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
43 private RiResolvedMethod charArrayCopy; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
44 private RiResolvedMethod intArrayCopy; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
45 private RiResolvedMethod longArrayCopy; |
4412
ccbdd90bf356
Add new arraycopy intrinsics : Object (when no storecheck required), Float and Double
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4199
diff
changeset
|
46 private RiResolvedMethod floatArrayCopy; |
ccbdd90bf356
Add new arraycopy intrinsics : Object (when no storecheck required), Float and Double
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4199
diff
changeset
|
47 private RiResolvedMethod doubleArrayCopy; |
ccbdd90bf356
Add new arraycopy intrinsics : Object (when no storecheck required), Float and Double
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4199
diff
changeset
|
48 private RiResolvedMethod objectArrayCopy; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
49 |
4142
bc8527f3071c
Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3733
diff
changeset
|
50 public IntrinsifyArrayCopyPhase(GraalRuntime runtime) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
51 this.runtime = runtime; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
52 try { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
53 byteArrayCopy = getArrayCopySnippet(runtime, byte.class); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
54 charArrayCopy = getArrayCopySnippet(runtime, char.class); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
55 shortArrayCopy = getArrayCopySnippet(runtime, short.class); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
56 intArrayCopy = getArrayCopySnippet(runtime, int.class); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
57 longArrayCopy = getArrayCopySnippet(runtime, long.class); |
4412
ccbdd90bf356
Add new arraycopy intrinsics : Object (when no storecheck required), Float and Double
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4199
diff
changeset
|
58 floatArrayCopy = getArrayCopySnippet(runtime, float.class); |
ccbdd90bf356
Add new arraycopy intrinsics : Object (when no storecheck required), Float and Double
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4199
diff
changeset
|
59 doubleArrayCopy = getArrayCopySnippet(runtime, double.class); |
ccbdd90bf356
Add new arraycopy intrinsics : Object (when no storecheck required), Float and Double
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4199
diff
changeset
|
60 objectArrayCopy = getArrayCopySnippet(runtime, Object.class); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
61 arrayCopy = runtime.getRiMethod(System.class.getDeclaredMethod("arraycopy", Object.class, int.class, Object.class, int.class, int.class)); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
62 } catch (SecurityException e) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
63 e.printStackTrace(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
64 } catch (NoSuchMethodException e) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
65 e.printStackTrace(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
66 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
67 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
68 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
69 private static RiResolvedMethod getArrayCopySnippet(RiRuntime runtime, Class<?> componentClass) throws NoSuchMethodException { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
70 Class<?> arrayClass = Array.newInstance(componentClass, 0).getClass(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
71 return runtime.getRiMethod(ArrayCopySnippets.class.getDeclaredMethod("arraycopy", arrayClass, int.class, arrayClass, int.class, int.class)); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
72 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
73 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
74 @Override |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
75 protected void run(StructuredGraph graph) { |
4420
97e0fb1f4906
Make Array copy intrinsifier active again, fix format string in canonicalizer
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4412
diff
changeset
|
76 boolean hits = false; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
77 for (MethodCallTargetNode methodCallTarget : graph.getNodes(MethodCallTargetNode.class)) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
78 RiResolvedMethod targetMethod = methodCallTarget.targetMethod(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
79 RiResolvedMethod snippetMethod = null; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
80 if (targetMethod == arrayCopy) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
81 ValueNode src = methodCallTarget.arguments().get(0); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
82 ValueNode dest = methodCallTarget.arguments().get(2); |
5056
2f2c6347fce4
comments cleanup/retagging
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4589
diff
changeset
|
83 assert src != null && dest != null; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
84 RiResolvedType srcDeclaredType = src.declaredType(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
85 RiResolvedType destDeclaredType = dest.declaredType(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
86 if (srcDeclaredType != null |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
87 && srcDeclaredType.isArrayClass() |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
88 && destDeclaredType != null |
4412
ccbdd90bf356
Add new arraycopy intrinsics : Object (when no storecheck required), Float and Double
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4199
diff
changeset
|
89 && destDeclaredType.isArrayClass()) { |
ccbdd90bf356
Add new arraycopy intrinsics : Object (when no storecheck required), Float and Double
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4199
diff
changeset
|
90 CiKind componentKind = srcDeclaredType.componentType().kind(false); |
ccbdd90bf356
Add new arraycopy intrinsics : Object (when no storecheck required), Float and Double
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4199
diff
changeset
|
91 if (srcDeclaredType.componentType() == destDeclaredType.componentType()) { |
ccbdd90bf356
Add new arraycopy intrinsics : Object (when no storecheck required), Float and Double
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4199
diff
changeset
|
92 if (componentKind == CiKind.Int) { |
ccbdd90bf356
Add new arraycopy intrinsics : Object (when no storecheck required), Float and Double
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4199
diff
changeset
|
93 snippetMethod = intArrayCopy; |
ccbdd90bf356
Add new arraycopy intrinsics : Object (when no storecheck required), Float and Double
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4199
diff
changeset
|
94 } else if (componentKind == CiKind.Char) { |
ccbdd90bf356
Add new arraycopy intrinsics : Object (when no storecheck required), Float and Double
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4199
diff
changeset
|
95 snippetMethod = charArrayCopy; |
ccbdd90bf356
Add new arraycopy intrinsics : Object (when no storecheck required), Float and Double
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4199
diff
changeset
|
96 } else if (componentKind == CiKind.Long) { |
ccbdd90bf356
Add new arraycopy intrinsics : Object (when no storecheck required), Float and Double
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4199
diff
changeset
|
97 snippetMethod = longArrayCopy; |
ccbdd90bf356
Add new arraycopy intrinsics : Object (when no storecheck required), Float and Double
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4199
diff
changeset
|
98 } else if (componentKind == CiKind.Byte) { |
ccbdd90bf356
Add new arraycopy intrinsics : Object (when no storecheck required), Float and Double
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4199
diff
changeset
|
99 snippetMethod = byteArrayCopy; |
ccbdd90bf356
Add new arraycopy intrinsics : Object (when no storecheck required), Float and Double
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4199
diff
changeset
|
100 } else if (componentKind == CiKind.Short) { |
ccbdd90bf356
Add new arraycopy intrinsics : Object (when no storecheck required), Float and Double
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4199
diff
changeset
|
101 snippetMethod = shortArrayCopy; |
ccbdd90bf356
Add new arraycopy intrinsics : Object (when no storecheck required), Float and Double
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4199
diff
changeset
|
102 } else if (componentKind == CiKind.Float) { |
ccbdd90bf356
Add new arraycopy intrinsics : Object (when no storecheck required), Float and Double
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4199
diff
changeset
|
103 snippetMethod = floatArrayCopy; |
ccbdd90bf356
Add new arraycopy intrinsics : Object (when no storecheck required), Float and Double
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4199
diff
changeset
|
104 } else if (componentKind == CiKind.Double) { |
ccbdd90bf356
Add new arraycopy intrinsics : Object (when no storecheck required), Float and Double
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4199
diff
changeset
|
105 snippetMethod = doubleArrayCopy; |
ccbdd90bf356
Add new arraycopy intrinsics : Object (when no storecheck required), Float and Double
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4199
diff
changeset
|
106 } else if (componentKind == CiKind.Object) { |
ccbdd90bf356
Add new arraycopy intrinsics : Object (when no storecheck required), Float and Double
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4199
diff
changeset
|
107 snippetMethod = objectArrayCopy; |
ccbdd90bf356
Add new arraycopy intrinsics : Object (when no storecheck required), Float and Double
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4199
diff
changeset
|
108 } |
ccbdd90bf356
Add new arraycopy intrinsics : Object (when no storecheck required), Float and Double
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4199
diff
changeset
|
109 } else if (componentKind == CiKind.Object |
ccbdd90bf356
Add new arraycopy intrinsics : Object (when no storecheck required), Float and Double
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4199
diff
changeset
|
110 && srcDeclaredType.componentType().isSubtypeOf(destDeclaredType.componentType())) { |
ccbdd90bf356
Add new arraycopy intrinsics : Object (when no storecheck required), Float and Double
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4199
diff
changeset
|
111 snippetMethod = objectArrayCopy; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
112 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
113 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
114 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
115 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
116 if (snippetMethod != null) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
117 StructuredGraph snippetGraph = (StructuredGraph) snippetMethod.compilerStorage().get(Graph.class); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
118 assert snippetGraph != null : "ArrayCopySnippets should be installed"; |
4420
97e0fb1f4906
Make Array copy intrinsifier active again, fix format string in canonicalizer
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4412
diff
changeset
|
119 hits = true; |
4423
e8ce691d7923
Move Array copy, Unsafe and System snippets to hotspot specific project since they are hotspot specific.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4420
diff
changeset
|
120 Debug.log("%s > Intinsify (%s)", Debug.currentScope(), snippetMethod.signature().argumentTypeAt(0, snippetMethod.holder()).componentType()); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
121 InliningUtil.inline(methodCallTarget.invoke(), snippetGraph, false); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
122 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
123 } |
4589
c148bec9398a
Fixed computation of exact type information in PhiStampPhase.
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4423
diff
changeset
|
124 if (GraalOptions.OptCanonicalizer && hits) { |
4420
97e0fb1f4906
Make Array copy intrinsifier active again, fix format string in canonicalizer
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4412
diff
changeset
|
125 new CanonicalizerPhase(null, runtime, null).apply(graph); |
97e0fb1f4906
Make Array copy intrinsifier active again, fix format string in canonicalizer
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4412
diff
changeset
|
126 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
127 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
128 } |