Mercurial > hg > graal-compiler
annotate graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/NewArrayStub.java @ 9872:4391fd907278
use StubForeignCallNode within stubs, instead of ForeignCallNode
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Wed, 05 Jun 2013 11:34:55 +0200 |
parents | b4f12c603be5 |
children | 03c781923573 |
rev | line source |
---|---|
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
1 /* |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
4 * |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
8 * |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
14 * |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
18 * |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
21 * questions. |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
22 */ |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
23 package com.oracle.graal.hotspot.stubs; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
24 |
9338
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9015
diff
changeset
|
25 import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; |
9513
659bb6cf930c
rename: HotSpotSnippetUtils -> HotSpotReplacementsUtil
Doug Simon <doug.simon@oracle.com>
parents:
9418
diff
changeset
|
26 import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.*; |
8415
2361bf148c06
rename packages: *snippets* -> *replacements*
Doug Simon <doug.simon@oracle.com>
parents:
7868
diff
changeset
|
27 import static com.oracle.graal.hotspot.replacements.NewObjectSnippets.*; |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
28 import static com.oracle.graal.hotspot.stubs.NewInstanceStub.*; |
9671
0b3d19e4e2a2
used static import for methods in StubUtil
Doug Simon <doug.simon@oracle.com>
parents:
9618
diff
changeset
|
29 import static com.oracle.graal.hotspot.stubs.StubUtil.*; |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
30 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
31 import com.oracle.graal.api.code.*; |
9338
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9015
diff
changeset
|
32 import com.oracle.graal.api.meta.*; |
9671
0b3d19e4e2a2
used static import for methods in StubUtil
Doug Simon <doug.simon@oracle.com>
parents:
9618
diff
changeset
|
33 import com.oracle.graal.graph.Node.ConstantNodeParameter; |
0b3d19e4e2a2
used static import for methods in StubUtil
Doug Simon <doug.simon@oracle.com>
parents:
9618
diff
changeset
|
34 import com.oracle.graal.graph.Node.NodeIntrinsic; |
8627
75db7afee829
implemented lazy installation of replacements (GRAAL-137)
Doug Simon <doug.simon@oracle.com>
parents:
8415
diff
changeset
|
35 import com.oracle.graal.hotspot.*; |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
36 import com.oracle.graal.hotspot.meta.*; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
37 import com.oracle.graal.hotspot.nodes.*; |
8415
2361bf148c06
rename packages: *snippets* -> *replacements*
Doug Simon <doug.simon@oracle.com>
parents:
7868
diff
changeset
|
38 import com.oracle.graal.hotspot.replacements.*; |
8637
ce5750014c3d
moved Replacements and MacroSubstitution from the graal.api.replacements project to graal.nodes project and reversed the dependency between these two projects (the latter now/again depends on the former)
Doug Simon <doug.simon@oracle.com>
parents:
8627
diff
changeset
|
39 import com.oracle.graal.nodes.spi.*; |
8415
2361bf148c06
rename packages: *snippets* -> *replacements*
Doug Simon <doug.simon@oracle.com>
parents:
7868
diff
changeset
|
40 import com.oracle.graal.replacements.*; |
9671
0b3d19e4e2a2
used static import for methods in StubUtil
Doug Simon <doug.simon@oracle.com>
parents:
9618
diff
changeset
|
41 import com.oracle.graal.replacements.Snippet.ConstantParameter; |
0b3d19e4e2a2
used static import for methods in StubUtil
Doug Simon <doug.simon@oracle.com>
parents:
9618
diff
changeset
|
42 import com.oracle.graal.replacements.Snippet.Fold; |
9015
92d2bedb5dfc
Change of Snippet template and instantiation process
Christian Wimmer <christian.wimmer@oracle.com>
parents:
8637
diff
changeset
|
43 import com.oracle.graal.replacements.SnippetTemplate.Arguments; |
92d2bedb5dfc
Change of Snippet template and instantiation process
Christian Wimmer <christian.wimmer@oracle.com>
parents:
8637
diff
changeset
|
44 import com.oracle.graal.replacements.SnippetTemplate.SnippetInfo; |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7275
diff
changeset
|
45 import com.oracle.graal.word.*; |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
46 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
47 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7356
diff
changeset
|
48 * Stub implementing the fast path for TLAB refill during instance class allocation. This stub is |
9418
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9417
diff
changeset
|
49 * called via {@link NewArrayStubCall} from the {@linkplain NewObjectSnippets inline} allocation |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9417
diff
changeset
|
50 * code when TLAB allocation fails. If this stub fails to refill the TLAB or allocate the object, it |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9417
diff
changeset
|
51 * calls out to the HotSpot C++ runtime to complete the allocation. |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
52 */ |
9617
c1ef2bf6848e
removed the requirement that a compiled stub is implemented by a snippet
Doug Simon <doug.simon@oracle.com>
parents:
9576
diff
changeset
|
53 public class NewArrayStub extends SnippetStub { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
54 |
9740
c4b1aa93b9af
rename: HotSpotRuntimeCallTarget -> HotSpotForeignCallLinkage
Doug Simon <doug.simon@oracle.com>
parents:
9737
diff
changeset
|
55 public NewArrayStub(final HotSpotRuntime runtime, Replacements replacements, TargetDescription target, HotSpotForeignCallLinkage linkage) { |
9417
ffa27c3058e9
minor simplifications for writing compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9352
diff
changeset
|
56 super(runtime, replacements, target, linkage); |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
57 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
58 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
59 @Override |
9015
92d2bedb5dfc
Change of Snippet template and instantiation process
Christian Wimmer <christian.wimmer@oracle.com>
parents:
8637
diff
changeset
|
60 protected Arguments makeArguments(SnippetInfo stub) { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
61 HotSpotResolvedObjectType intArrayType = (HotSpotResolvedObjectType) runtime.lookupJavaType(int[].class); |
9015
92d2bedb5dfc
Change of Snippet template and instantiation process
Christian Wimmer <christian.wimmer@oracle.com>
parents:
8637
diff
changeset
|
62 |
9338
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9015
diff
changeset
|
63 // RuntimeStub cannot (currently) support oops or metadata embedded in the code so we |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9015
diff
changeset
|
64 // convert the hub (i.e., Klass*) for int[] to be a naked word. This should be safe since |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9015
diff
changeset
|
65 // the int[] class will never be unloaded. |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9015
diff
changeset
|
66 Constant intArrayHub = intArrayType.klass(); |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9015
diff
changeset
|
67 intArrayHub = Constant.forIntegerKind(graalRuntime().getTarget().wordKind, intArrayHub.asLong(), null); |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9015
diff
changeset
|
68 |
9015
92d2bedb5dfc
Change of Snippet template and instantiation process
Christian Wimmer <christian.wimmer@oracle.com>
parents:
8637
diff
changeset
|
69 Arguments args = new Arguments(stub); |
92d2bedb5dfc
Change of Snippet template and instantiation process
Christian Wimmer <christian.wimmer@oracle.com>
parents:
8637
diff
changeset
|
70 args.add("hub", null); |
92d2bedb5dfc
Change of Snippet template and instantiation process
Christian Wimmer <christian.wimmer@oracle.com>
parents:
8637
diff
changeset
|
71 args.add("length", null); |
9338
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9015
diff
changeset
|
72 args.addConst("intArrayHub", intArrayHub); |
9015
92d2bedb5dfc
Change of Snippet template and instantiation process
Christian Wimmer <christian.wimmer@oracle.com>
parents:
8637
diff
changeset
|
73 return args; |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
74 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
75 |
9567
a8b4f26d8485
removed Stub.log(...) methods
Doug Simon <doug.simon@oracle.com>
parents:
9557
diff
changeset
|
76 @Fold |
a8b4f26d8485
removed Stub.log(...) methods
Doug Simon <doug.simon@oracle.com>
parents:
9557
diff
changeset
|
77 private static boolean logging() { |
a8b4f26d8485
removed Stub.log(...) methods
Doug Simon <doug.simon@oracle.com>
parents:
9557
diff
changeset
|
78 return Boolean.getBoolean("graal.logNewArrayStub"); |
a8b4f26d8485
removed Stub.log(...) methods
Doug Simon <doug.simon@oracle.com>
parents:
9557
diff
changeset
|
79 } |
a8b4f26d8485
removed Stub.log(...) methods
Doug Simon <doug.simon@oracle.com>
parents:
9557
diff
changeset
|
80 |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
81 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7356
diff
changeset
|
82 * Re-attempts allocation after an initial TLAB allocation failed or was skipped (e.g., due to |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7356
diff
changeset
|
83 * -XX:-UseTLAB). |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7356
diff
changeset
|
84 * |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
85 * @param hub the hub of the object to be allocated |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
86 * @param length the length of the array |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
87 * @param intArrayHub the hub for {@code int[].class} |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
88 */ |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
89 @Snippet |
9567
a8b4f26d8485
removed Stub.log(...) methods
Doug Simon <doug.simon@oracle.com>
parents:
9557
diff
changeset
|
90 private static Object newArray(Word hub, int length, @ConstantParameter Word intArrayHub) { |
9793
b4f12c603be5
added support for the runtime to specify for each foreign call whether it is re-executable and what memory locations it kills
Doug Simon <doug.simon@oracle.com>
parents:
9746
diff
changeset
|
91 int layoutHelper = hub.readInt(layoutHelperOffset(), LocationIdentity.FINAL_LOCATION); |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
92 int log2ElementSize = (layoutHelper >> layoutHelperLog2ElementSizeShift()) & layoutHelperLog2ElementSizeMask(); |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
93 int headerSize = (layoutHelper >> layoutHelperHeaderSizeShift()) & layoutHelperHeaderSizeMask(); |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
94 int elementKind = (layoutHelper >> layoutHelperElementTypeShift()) & layoutHelperElementTypeMask(); |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
95 int sizeInBytes = computeArrayAllocationSize(length, wordSize(), headerSize, log2ElementSize); |
9567
a8b4f26d8485
removed Stub.log(...) methods
Doug Simon <doug.simon@oracle.com>
parents:
9557
diff
changeset
|
96 if (logging()) { |
9671
0b3d19e4e2a2
used static import for methods in StubUtil
Doug Simon <doug.simon@oracle.com>
parents:
9618
diff
changeset
|
97 printf("newArray: element kind %d\n", elementKind); |
0b3d19e4e2a2
used static import for methods in StubUtil
Doug Simon <doug.simon@oracle.com>
parents:
9618
diff
changeset
|
98 printf("newArray: array length %d\n", length); |
0b3d19e4e2a2
used static import for methods in StubUtil
Doug Simon <doug.simon@oracle.com>
parents:
9618
diff
changeset
|
99 printf("newArray: array size %d\n", sizeInBytes); |
0b3d19e4e2a2
used static import for methods in StubUtil
Doug Simon <doug.simon@oracle.com>
parents:
9618
diff
changeset
|
100 printf("newArray: hub=%p\n", hub.rawValue()); |
9567
a8b4f26d8485
removed Stub.log(...) methods
Doug Simon <doug.simon@oracle.com>
parents:
9557
diff
changeset
|
101 } |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
102 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
103 // check that array length is small enough for fast path. |
7254
9e155cd2bb2f
enable tlab stub for array allocation
Lukas Stadler <lukas.stadler@jku.at>
parents:
7253
diff
changeset
|
104 if (length <= MAX_ARRAY_FAST_PATH_ALLOCATION_LENGTH) { |
9567
a8b4f26d8485
removed Stub.log(...) methods
Doug Simon <doug.simon@oracle.com>
parents:
9557
diff
changeset
|
105 Word memory = refillAllocate(intArrayHub, sizeInBytes, logging()); |
7701
47467b2c3fc5
Use equal() and notEqual() instead of == and != to compare words
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7556
diff
changeset
|
106 if (memory.notEqual(0)) { |
9567
a8b4f26d8485
removed Stub.log(...) methods
Doug Simon <doug.simon@oracle.com>
parents:
9557
diff
changeset
|
107 if (logging()) { |
9671
0b3d19e4e2a2
used static import for methods in StubUtil
Doug Simon <doug.simon@oracle.com>
parents:
9618
diff
changeset
|
108 printf("newArray: allocated new array at %p\n", memory.rawValue()); |
9567
a8b4f26d8485
removed Stub.log(...) methods
Doug Simon <doug.simon@oracle.com>
parents:
9557
diff
changeset
|
109 } |
9688
0d0645267c32
simplify NewObjectSnippets
Lukas Stadler <lukas.stadler@jku.at>
parents:
9671
diff
changeset
|
110 return verifyObject(formatArray(hub, sizeInBytes, length, headerSize, memory, Word.unsigned(arrayPrototypeMarkWord()), true)); |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
111 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
112 } |
9567
a8b4f26d8485
removed Stub.log(...) methods
Doug Simon <doug.simon@oracle.com>
parents:
9557
diff
changeset
|
113 if (logging()) { |
9671
0b3d19e4e2a2
used static import for methods in StubUtil
Doug Simon <doug.simon@oracle.com>
parents:
9618
diff
changeset
|
114 printf("newArray: calling new_array_c\n"); |
9567
a8b4f26d8485
removed Stub.log(...) methods
Doug Simon <doug.simon@oracle.com>
parents:
9557
diff
changeset
|
115 } |
9338
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9015
diff
changeset
|
116 |
9352
d4684b468e93
made NewInstanceStub a RuntimeStub that directly calls the C runtime (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9351
diff
changeset
|
117 newArrayC(NEW_ARRAY_C, thread(), hub, length); |
9671
0b3d19e4e2a2
used static import for methods in StubUtil
Doug Simon <doug.simon@oracle.com>
parents:
9618
diff
changeset
|
118 handlePendingException(true); |
0b3d19e4e2a2
used static import for methods in StubUtil
Doug Simon <doug.simon@oracle.com>
parents:
9618
diff
changeset
|
119 return verifyObject(getAndClearObjectResult(thread())); |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
120 } |
9351
4bf3af9abdfb
generalized support for C runtime calls
Doug Simon <doug.simon@oracle.com>
parents:
9340
diff
changeset
|
121 |
9737
34c892fdfb6d
moved responsibility for determining if a foreign call has a side effect to the runtime
Doug Simon <doug.simon@oracle.com>
parents:
9736
diff
changeset
|
122 public static final ForeignCallDescriptor NEW_ARRAY_C = descriptorFor(NewArrayStub.class, "newArrayC"); |
9351
4bf3af9abdfb
generalized support for C runtime calls
Doug Simon <doug.simon@oracle.com>
parents:
9340
diff
changeset
|
123 |
9872
4391fd907278
use StubForeignCallNode within stubs, instead of ForeignCallNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
9793
diff
changeset
|
124 @NodeIntrinsic(StubForeignCallNode.class) |
9735
2e4f035186cf
rename: Descriptor -> ForeignCallDescriptor
Doug Simon <doug.simon@oracle.com>
parents:
9688
diff
changeset
|
125 public static native void newArrayC(@ConstantNodeParameter ForeignCallDescriptor newArrayC, Word thread, Word hub, int length); |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
126 } |