Mercurial > hg > truffle
annotate truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/CompilerDirectives.java @ 21991:169f5c55704c
added throwsControlFlowException element to @TruffleBoundary
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 13 Jul 2015 16:31:44 +0200 |
parents | 9c8c0937da41 |
children | 130e5f69d1a6 |
rev | line source |
---|---|
9244
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1 /* |
19309
c386ace07981
Truffle: move unsafe access methods out of CompilerDirectives
Andreas Woess <andreas.woess@oracle.com>
parents:
19013
diff
changeset
|
2 * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. |
9244
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
4 * |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
11279
494b818b527c
Adding "Classpath" exception to the classes in the com.oracle.truffle.api and the com.oracle.truffle.api.dsl package.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
11269
diff
changeset
|
7 * published by the Free Software Foundation. Oracle designates this |
494b818b527c
Adding "Classpath" exception to the classes in the com.oracle.truffle.api and the com.oracle.truffle.api.dsl package.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
11269
diff
changeset
|
8 * particular file as subject to the "Classpath" exception as provided |
494b818b527c
Adding "Classpath" exception to the classes in the com.oracle.truffle.api and the com.oracle.truffle.api.dsl package.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
11269
diff
changeset
|
9 * by Oracle in the LICENSE file that accompanied this code. |
9244
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
10 * |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
11 * This code is distributed in the hope that it will be useful, but WITHOUT |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
14 * version 2 for more details (a copy is included in the LICENSE file that |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
15 * accompanied this code). |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
16 * |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
17 * You should have received a copy of the GNU General Public License version |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
18 * 2 along with this work; if not, write to the Free Software Foundation, |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
20 * |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
22 * or visit www.oracle.com if you need additional information or have any |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
23 * questions. |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
24 */ |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
25 package com.oracle.truffle.api; |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
26 |
9313
6369d37b37d1
Added annotation CompilerDirectives.CompilationFinal for fields that should be considered final during compilation, but are not final while executing in the Truffle interpreter.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9283
diff
changeset
|
27 import java.lang.annotation.*; |
9244
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
28 import java.util.concurrent.*; |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
29 |
21991
169f5c55704c
added throwsControlFlowException element to @TruffleBoundary
Doug Simon <doug.simon@oracle.com>
parents:
21951
diff
changeset
|
30 import com.oracle.truffle.api.nodes.*; |
169f5c55704c
added throwsControlFlowException element to @TruffleBoundary
Doug Simon <doug.simon@oracle.com>
parents:
21951
diff
changeset
|
31 |
9244
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
32 /** |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
33 * Directives that influence the optimizations of the Truffle compiler. All of the operations have |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
34 * no effect when executed in the Truffle interpreter. |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
35 */ |
11898
f753092f608d
Adjustments to unsafe access and unsafe cast compiler directives in Truffle API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
11897
diff
changeset
|
36 public final class CompilerDirectives { |
9244
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
37 |
9319
1188b7c42196
Changed the behavior of CompilerDirectives.injectBranchProbability and added javadoc to document the new behavior. Introduced probability constants. Removed CompilerDirectives.slowpath().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9313
diff
changeset
|
38 public static final double LIKELY_PROBABILITY = 0.75; |
1188b7c42196
Changed the behavior of CompilerDirectives.injectBranchProbability and added javadoc to document the new behavior. Introduced probability constants. Removed CompilerDirectives.slowpath().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9313
diff
changeset
|
39 public static final double UNLIKELY_PROBABILITY = 1.0 - LIKELY_PROBABILITY; |
1188b7c42196
Changed the behavior of CompilerDirectives.injectBranchProbability and added javadoc to document the new behavior. Introduced probability constants. Removed CompilerDirectives.slowpath().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9313
diff
changeset
|
40 |
1188b7c42196
Changed the behavior of CompilerDirectives.injectBranchProbability and added javadoc to document the new behavior. Introduced probability constants. Removed CompilerDirectives.slowpath().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9313
diff
changeset
|
41 public static final double SLOWPATH_PROBABILITY = 0.0001; |
1188b7c42196
Changed the behavior of CompilerDirectives.injectBranchProbability and added javadoc to document the new behavior. Introduced probability constants. Removed CompilerDirectives.slowpath().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9313
diff
changeset
|
42 public static final double FASTPATH_PROBABILITY = 1.0 - SLOWPATH_PROBABILITY; |
9244
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
43 |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
44 /** |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
45 * Directive for the compiler to discontinue compilation at this code position and instead |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
46 * insert a transfer to the interpreter. |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
47 */ |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
48 public static void transferToInterpreter() { |
16535
ada0a7729b6f
Truffle: introduce debug option to print the stack trace when transferring to the interpreter
Andreas Woess <andreas.woess@jku.at>
parents:
15230
diff
changeset
|
49 if (inInterpreter()) { |
ada0a7729b6f
Truffle: introduce debug option to print the stack trace when transferring to the interpreter
Andreas Woess <andreas.woess@jku.at>
parents:
15230
diff
changeset
|
50 Truffle.getRuntime().notifyTransferToInterpreter(); |
ada0a7729b6f
Truffle: introduce debug option to print the stack trace when transferring to the interpreter
Andreas Woess <andreas.woess@jku.at>
parents:
15230
diff
changeset
|
51 } |
9244
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
52 } |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
53 |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
54 /** |
12770
3e013f4512de
temporary addition of CompilerDirectives.transferToInterpreterAndInvalidate()
Michael Haupt <michael.haupt@oracle.com>
parents:
12408
diff
changeset
|
55 * Directive for the compiler to discontinue compilation at this code position and instead |
3e013f4512de
temporary addition of CompilerDirectives.transferToInterpreterAndInvalidate()
Michael Haupt <michael.haupt@oracle.com>
parents:
12408
diff
changeset
|
56 * insert a transfer to the interpreter, invalidating the currently executing machine code. |
3e013f4512de
temporary addition of CompilerDirectives.transferToInterpreterAndInvalidate()
Michael Haupt <michael.haupt@oracle.com>
parents:
12408
diff
changeset
|
57 */ |
3e013f4512de
temporary addition of CompilerDirectives.transferToInterpreterAndInvalidate()
Michael Haupt <michael.haupt@oracle.com>
parents:
12408
diff
changeset
|
58 public static void transferToInterpreterAndInvalidate() { |
16535
ada0a7729b6f
Truffle: introduce debug option to print the stack trace when transferring to the interpreter
Andreas Woess <andreas.woess@jku.at>
parents:
15230
diff
changeset
|
59 if (inInterpreter()) { |
ada0a7729b6f
Truffle: introduce debug option to print the stack trace when transferring to the interpreter
Andreas Woess <andreas.woess@jku.at>
parents:
15230
diff
changeset
|
60 Truffle.getRuntime().notifyTransferToInterpreter(); |
ada0a7729b6f
Truffle: introduce debug option to print the stack trace when transferring to the interpreter
Andreas Woess <andreas.woess@jku.at>
parents:
15230
diff
changeset
|
61 } |
12770
3e013f4512de
temporary addition of CompilerDirectives.transferToInterpreterAndInvalidate()
Michael Haupt <michael.haupt@oracle.com>
parents:
12408
diff
changeset
|
62 } |
3e013f4512de
temporary addition of CompilerDirectives.transferToInterpreterAndInvalidate()
Michael Haupt <michael.haupt@oracle.com>
parents:
12408
diff
changeset
|
63 |
3e013f4512de
temporary addition of CompilerDirectives.transferToInterpreterAndInvalidate()
Michael Haupt <michael.haupt@oracle.com>
parents:
12408
diff
changeset
|
64 /** |
11269
f00c85ee46a2
Truffle: add CompilerDirectives.inInterpreter()
Andreas Woess <andreas.woess@jku.at>
parents:
10687
diff
changeset
|
65 * Returns a boolean value indicating whether the method is executed in the interpreter. |
14880
73546bd550f0
CompilerDirectives: add optional nonNull parameter to unsafeCast
Andreas Woess <andreas.woess@jku.at>
parents:
13956
diff
changeset
|
66 * |
11269
f00c85ee46a2
Truffle: add CompilerDirectives.inInterpreter()
Andreas Woess <andreas.woess@jku.at>
parents:
10687
diff
changeset
|
67 * @return {@code true} when executed in the interpreter, {@code false} in compiled code. |
f00c85ee46a2
Truffle: add CompilerDirectives.inInterpreter()
Andreas Woess <andreas.woess@jku.at>
parents:
10687
diff
changeset
|
68 */ |
f00c85ee46a2
Truffle: add CompilerDirectives.inInterpreter()
Andreas Woess <andreas.woess@jku.at>
parents:
10687
diff
changeset
|
69 public static boolean inInterpreter() { |
f00c85ee46a2
Truffle: add CompilerDirectives.inInterpreter()
Andreas Woess <andreas.woess@jku.at>
parents:
10687
diff
changeset
|
70 return true; |
f00c85ee46a2
Truffle: add CompilerDirectives.inInterpreter()
Andreas Woess <andreas.woess@jku.at>
parents:
10687
diff
changeset
|
71 } |
f00c85ee46a2
Truffle: add CompilerDirectives.inInterpreter()
Andreas Woess <andreas.woess@jku.at>
parents:
10687
diff
changeset
|
72 |
f00c85ee46a2
Truffle: add CompilerDirectives.inInterpreter()
Andreas Woess <andreas.woess@jku.at>
parents:
10687
diff
changeset
|
73 /** |
15230
df724f63f776
Truffle API: Introduce new compiler directive inCompiledCode() as the negation of inInterpreter().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
15064
diff
changeset
|
74 * Returns a boolean value indicating whether the method is executed in the compiled code. |
df724f63f776
Truffle API: Introduce new compiler directive inCompiledCode() as the negation of inInterpreter().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
15064
diff
changeset
|
75 * |
df724f63f776
Truffle API: Introduce new compiler directive inCompiledCode() as the negation of inInterpreter().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
15064
diff
changeset
|
76 * @return {@code false} when executed in the interpreter, {@code true} in compiled code. |
df724f63f776
Truffle API: Introduce new compiler directive inCompiledCode() as the negation of inInterpreter().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
15064
diff
changeset
|
77 */ |
df724f63f776
Truffle API: Introduce new compiler directive inCompiledCode() as the negation of inInterpreter().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
15064
diff
changeset
|
78 public static boolean inCompiledCode() { |
df724f63f776
Truffle API: Introduce new compiler directive inCompiledCode() as the negation of inInterpreter().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
15064
diff
changeset
|
79 return false; |
df724f63f776
Truffle API: Introduce new compiler directive inCompiledCode() as the negation of inInterpreter().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
15064
diff
changeset
|
80 } |
df724f63f776
Truffle API: Introduce new compiler directive inCompiledCode() as the negation of inInterpreter().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
15064
diff
changeset
|
81 |
df724f63f776
Truffle API: Introduce new compiler directive inCompiledCode() as the negation of inInterpreter().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
15064
diff
changeset
|
82 /** |
17444
2834b4432586
Truffle: introduce CompilerDirectives.isCompilationConstant.
Christian Humer <christian.humer@gmail.com>
parents:
16535
diff
changeset
|
83 * Returns a boolean indicating whether or not a given value is seen as constant in optimized |
2834b4432586
Truffle: introduce CompilerDirectives.isCompilationConstant.
Christian Humer <christian.humer@gmail.com>
parents:
16535
diff
changeset
|
84 * code. If this method is called in the interpreter this method will always return |
19521
9c4168877444
Create CompilerAsserts tests. Add graph builder context on bailout. Consolidate CompilerAsserts Truffle API class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
19309
diff
changeset
|
85 * <code>true</code>. |
17444
2834b4432586
Truffle: introduce CompilerDirectives.isCompilationConstant.
Christian Humer <christian.humer@gmail.com>
parents:
16535
diff
changeset
|
86 * |
18309
d079b2af3a15
Truffle: more explicit warning about isCompilationConstant.
Chris Seaton <chris.seaton@oracle.com>
parents:
18219
diff
changeset
|
87 * Note that optimizations that a compiler will apply to code that is conditional on |
d079b2af3a15
Truffle: more explicit warning about isCompilationConstant.
Chris Seaton <chris.seaton@oracle.com>
parents:
18219
diff
changeset
|
88 * <code>isCompilationConstant</code> may be limited. For this reason |
d079b2af3a15
Truffle: more explicit warning about isCompilationConstant.
Chris Seaton <chris.seaton@oracle.com>
parents:
18219
diff
changeset
|
89 * <code>isCompilationConstant</code> is not recommended for use to select between alternate |
d079b2af3a15
Truffle: more explicit warning about isCompilationConstant.
Chris Seaton <chris.seaton@oracle.com>
parents:
18219
diff
changeset
|
90 * implementations of functionality depending on whether a value is constant. Instead, it is |
19521
9c4168877444
Create CompilerAsserts tests. Add graph builder context on bailout. Consolidate CompilerAsserts Truffle API class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
19309
diff
changeset
|
91 * intended for use as a diagnostic mechanism. |
18309
d079b2af3a15
Truffle: more explicit warning about isCompilationConstant.
Chris Seaton <chris.seaton@oracle.com>
parents:
18219
diff
changeset
|
92 * |
17444
2834b4432586
Truffle: introduce CompilerDirectives.isCompilationConstant.
Christian Humer <christian.humer@gmail.com>
parents:
16535
diff
changeset
|
93 * @param value |
2834b4432586
Truffle: introduce CompilerDirectives.isCompilationConstant.
Christian Humer <christian.humer@gmail.com>
parents:
16535
diff
changeset
|
94 * @return {@code true} when given value is seen as compilation constant, {@code false} if not |
2834b4432586
Truffle: introduce CompilerDirectives.isCompilationConstant.
Christian Humer <christian.humer@gmail.com>
parents:
16535
diff
changeset
|
95 * compilation constant. |
2834b4432586
Truffle: introduce CompilerDirectives.isCompilationConstant.
Christian Humer <christian.humer@gmail.com>
parents:
16535
diff
changeset
|
96 */ |
2834b4432586
Truffle: introduce CompilerDirectives.isCompilationConstant.
Christian Humer <christian.humer@gmail.com>
parents:
16535
diff
changeset
|
97 public static boolean isCompilationConstant(Object value) { |
19521
9c4168877444
Create CompilerAsserts tests. Add graph builder context on bailout. Consolidate CompilerAsserts Truffle API class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
19309
diff
changeset
|
98 return CompilerDirectives.inInterpreter(); |
17444
2834b4432586
Truffle: introduce CompilerDirectives.isCompilationConstant.
Christian Humer <christian.humer@gmail.com>
parents:
16535
diff
changeset
|
99 } |
2834b4432586
Truffle: introduce CompilerDirectives.isCompilationConstant.
Christian Humer <christian.humer@gmail.com>
parents:
16535
diff
changeset
|
100 |
2834b4432586
Truffle: introduce CompilerDirectives.isCompilationConstant.
Christian Humer <christian.humer@gmail.com>
parents:
16535
diff
changeset
|
101 /** |
9244
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
102 * Directive for the compiler that the given runnable should only be executed in the interpreter |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
103 * and ignored in the compiled code. |
14880
73546bd550f0
CompilerDirectives: add optional nonNull parameter to unsafeCast
Andreas Woess <andreas.woess@jku.at>
parents:
13956
diff
changeset
|
104 * |
9244
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
105 * @param runnable the closure that should only be executed in the interpreter |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
106 */ |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
107 public static void interpreterOnly(Runnable runnable) { |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
108 runnable.run(); |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
109 } |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
110 |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
111 /** |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
112 * Directive for the compiler that the given callable should only be executed in the |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
113 * interpreter. |
14880
73546bd550f0
CompilerDirectives: add optional nonNull parameter to unsafeCast
Andreas Woess <andreas.woess@jku.at>
parents:
13956
diff
changeset
|
114 * |
9244
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
115 * @param callable the closure that should only be executed in the interpreter |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
116 * @return the result of executing the closure in the interpreter and null in the compiled code |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
117 * @throws Exception If the closure throws an exception when executed in the interpreter. |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
118 */ |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
119 public static <T> T interpreterOnly(Callable<T> callable) throws Exception { |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
120 return callable.call(); |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
121 } |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
122 |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
123 /** |
9319
1188b7c42196
Changed the behavior of CompilerDirectives.injectBranchProbability and added javadoc to document the new behavior. Introduced probability constants. Removed CompilerDirectives.slowpath().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9313
diff
changeset
|
124 * Injects a probability for the given condition into the probability information of the |
1188b7c42196
Changed the behavior of CompilerDirectives.injectBranchProbability and added javadoc to document the new behavior. Introduced probability constants. Removed CompilerDirectives.slowpath().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9313
diff
changeset
|
125 * immediately succeeding branch instruction for the condition. The probability must be a value |
1188b7c42196
Changed the behavior of CompilerDirectives.injectBranchProbability and added javadoc to document the new behavior. Introduced probability constants. Removed CompilerDirectives.slowpath().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9313
diff
changeset
|
126 * between 0.0 and 1.0 (inclusive). The condition should not be a combined condition. |
14880
73546bd550f0
CompilerDirectives: add optional nonNull parameter to unsafeCast
Andreas Woess <andreas.woess@jku.at>
parents:
13956
diff
changeset
|
127 * |
9319
1188b7c42196
Changed the behavior of CompilerDirectives.injectBranchProbability and added javadoc to document the new behavior. Introduced probability constants. Removed CompilerDirectives.slowpath().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9313
diff
changeset
|
128 * Example usage immediately before an if statement (it specifies that the likelihood for a to |
1188b7c42196
Changed the behavior of CompilerDirectives.injectBranchProbability and added javadoc to document the new behavior. Introduced probability constants. Removed CompilerDirectives.slowpath().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9313
diff
changeset
|
129 * be greater than b is 90%): |
14880
73546bd550f0
CompilerDirectives: add optional nonNull parameter to unsafeCast
Andreas Woess <andreas.woess@jku.at>
parents:
13956
diff
changeset
|
130 * |
9319
1188b7c42196
Changed the behavior of CompilerDirectives.injectBranchProbability and added javadoc to document the new behavior. Introduced probability constants. Removed CompilerDirectives.slowpath().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9313
diff
changeset
|
131 * <code> |
14906 | 132 * if (injectBranchProbability(0.9, a > b)) { |
9319
1188b7c42196
Changed the behavior of CompilerDirectives.injectBranchProbability and added javadoc to document the new behavior. Introduced probability constants. Removed CompilerDirectives.slowpath().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9313
diff
changeset
|
133 * // ... |
1188b7c42196
Changed the behavior of CompilerDirectives.injectBranchProbability and added javadoc to document the new behavior. Introduced probability constants. Removed CompilerDirectives.slowpath().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9313
diff
changeset
|
134 * } |
1188b7c42196
Changed the behavior of CompilerDirectives.injectBranchProbability and added javadoc to document the new behavior. Introduced probability constants. Removed CompilerDirectives.slowpath().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9313
diff
changeset
|
135 * </code> |
14880
73546bd550f0
CompilerDirectives: add optional nonNull parameter to unsafeCast
Andreas Woess <andreas.woess@jku.at>
parents:
13956
diff
changeset
|
136 * |
9319
1188b7c42196
Changed the behavior of CompilerDirectives.injectBranchProbability and added javadoc to document the new behavior. Introduced probability constants. Removed CompilerDirectives.slowpath().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9313
diff
changeset
|
137 * Example usage for a combined condition (it specifies that the likelihood for a to be greater |
1188b7c42196
Changed the behavior of CompilerDirectives.injectBranchProbability and added javadoc to document the new behavior. Introduced probability constants. Removed CompilerDirectives.slowpath().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9313
diff
changeset
|
138 * than b is 90% and under the assumption that this is true, the likelihood for a being 0 is |
1188b7c42196
Changed the behavior of CompilerDirectives.injectBranchProbability and added javadoc to document the new behavior. Introduced probability constants. Removed CompilerDirectives.slowpath().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9313
diff
changeset
|
139 * 10%): |
14880
73546bd550f0
CompilerDirectives: add optional nonNull parameter to unsafeCast
Andreas Woess <andreas.woess@jku.at>
parents:
13956
diff
changeset
|
140 * |
9319
1188b7c42196
Changed the behavior of CompilerDirectives.injectBranchProbability and added javadoc to document the new behavior. Introduced probability constants. Removed CompilerDirectives.slowpath().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9313
diff
changeset
|
141 * <code> |
14906 | 142 * if (injectBranchProbability(0.9, a > b) && injectBranchProbability(0.1, a == 0)) { |
9319
1188b7c42196
Changed the behavior of CompilerDirectives.injectBranchProbability and added javadoc to document the new behavior. Introduced probability constants. Removed CompilerDirectives.slowpath().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9313
diff
changeset
|
143 * // ... |
1188b7c42196
Changed the behavior of CompilerDirectives.injectBranchProbability and added javadoc to document the new behavior. Introduced probability constants. Removed CompilerDirectives.slowpath().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9313
diff
changeset
|
144 * } |
1188b7c42196
Changed the behavior of CompilerDirectives.injectBranchProbability and added javadoc to document the new behavior. Introduced probability constants. Removed CompilerDirectives.slowpath().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9313
diff
changeset
|
145 * </code> |
14880
73546bd550f0
CompilerDirectives: add optional nonNull parameter to unsafeCast
Andreas Woess <andreas.woess@jku.at>
parents:
13956
diff
changeset
|
146 * |
9319
1188b7c42196
Changed the behavior of CompilerDirectives.injectBranchProbability and added javadoc to document the new behavior. Introduced probability constants. Removed CompilerDirectives.slowpath().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9313
diff
changeset
|
147 * There are predefined constants for commonly used probabilities (see |
1188b7c42196
Changed the behavior of CompilerDirectives.injectBranchProbability and added javadoc to document the new behavior. Introduced probability constants. Removed CompilerDirectives.slowpath().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9313
diff
changeset
|
148 * {@link #LIKELY_PROBABILITY} , {@link #UNLIKELY_PROBABILITY}, {@link #SLOWPATH_PROBABILITY}, |
1188b7c42196
Changed the behavior of CompilerDirectives.injectBranchProbability and added javadoc to document the new behavior. Introduced probability constants. Removed CompilerDirectives.slowpath().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9313
diff
changeset
|
149 * {@link #FASTPATH_PROBABILITY} ). |
14880
73546bd550f0
CompilerDirectives: add optional nonNull parameter to unsafeCast
Andreas Woess <andreas.woess@jku.at>
parents:
13956
diff
changeset
|
150 * |
9244
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
151 * @param probability the probability value between 0.0 and 1.0 that should be injected |
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
152 */ |
9319
1188b7c42196
Changed the behavior of CompilerDirectives.injectBranchProbability and added javadoc to document the new behavior. Introduced probability constants. Removed CompilerDirectives.slowpath().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9313
diff
changeset
|
153 public static boolean injectBranchProbability(double probability, boolean condition) { |
9244
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
154 assert probability >= 0.0 && probability <= 1.0; |
9319
1188b7c42196
Changed the behavior of CompilerDirectives.injectBranchProbability and added javadoc to document the new behavior. Introduced probability constants. Removed CompilerDirectives.slowpath().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9313
diff
changeset
|
155 return condition; |
9244
8f540423a5be
Added two new classes to the Truffle API: CompilerDirectives and CompilerAsserts.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
156 } |
9282
f5e58a1eca55
Added method CompilerDirectives.bailout to the Truffle API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9244
diff
changeset
|
157 |
f5e58a1eca55
Added method CompilerDirectives.bailout to the Truffle API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9244
diff
changeset
|
158 /** |
f5e58a1eca55
Added method CompilerDirectives.bailout to the Truffle API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9244
diff
changeset
|
159 * Bails out of a compilation (e.g., for guest language features that should never be compiled). |
14880
73546bd550f0
CompilerDirectives: add optional nonNull parameter to unsafeCast
Andreas Woess <andreas.woess@jku.at>
parents:
13956
diff
changeset
|
160 * |
9282
f5e58a1eca55
Added method CompilerDirectives.bailout to the Truffle API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9244
diff
changeset
|
161 * @param reason the reason for the bailout |
f5e58a1eca55
Added method CompilerDirectives.bailout to the Truffle API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9244
diff
changeset
|
162 */ |
f5e58a1eca55
Added method CompilerDirectives.bailout to the Truffle API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9244
diff
changeset
|
163 public static void bailout(String reason) { |
f5e58a1eca55
Added method CompilerDirectives.bailout to the Truffle API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9244
diff
changeset
|
164 } |
9313
6369d37b37d1
Added annotation CompilerDirectives.CompilationFinal for fields that should be considered final during compilation, but are not final while executing in the Truffle interpreter.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9283
diff
changeset
|
165 |
6369d37b37d1
Added annotation CompilerDirectives.CompilationFinal for fields that should be considered final during compilation, but are not final while executing in the Truffle interpreter.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9283
diff
changeset
|
166 /** |
6369d37b37d1
Added annotation CompilerDirectives.CompilationFinal for fields that should be considered final during compilation, but are not final while executing in the Truffle interpreter.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9283
diff
changeset
|
167 * Marks fields that should be considered final for a Truffle compilation although they are not |
6369d37b37d1
Added annotation CompilerDirectives.CompilationFinal for fields that should be considered final during compilation, but are not final while executing in the Truffle interpreter.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9283
diff
changeset
|
168 * final while executing in the interpreter. |
6369d37b37d1
Added annotation CompilerDirectives.CompilationFinal for fields that should be considered final during compilation, but are not final while executing in the Truffle interpreter.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9283
diff
changeset
|
169 */ |
6369d37b37d1
Added annotation CompilerDirectives.CompilationFinal for fields that should be considered final during compilation, but are not final while executing in the Truffle interpreter.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9283
diff
changeset
|
170 @Retention(RetentionPolicy.RUNTIME) |
6369d37b37d1
Added annotation CompilerDirectives.CompilationFinal for fields that should be considered final during compilation, but are not final while executing in the Truffle interpreter.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9283
diff
changeset
|
171 @Target({ElementType.FIELD}) |
6369d37b37d1
Added annotation CompilerDirectives.CompilationFinal for fields that should be considered final during compilation, but are not final while executing in the Truffle interpreter.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9283
diff
changeset
|
172 public @interface CompilationFinal { |
6369d37b37d1
Added annotation CompilerDirectives.CompilationFinal for fields that should be considered final during compilation, but are not final while executing in the Truffle interpreter.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9283
diff
changeset
|
173 } |
9349
0fccad3ce40d
Introduce CompilerDirectives.Unsafe. Mark Frame.getArguments method as unsafe.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9319
diff
changeset
|
174 |
0fccad3ce40d
Introduce CompilerDirectives.Unsafe. Mark Frame.getArguments method as unsafe.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9319
diff
changeset
|
175 /** |
18130
b4e38f4ca414
Truffle: rename @SlowPath to @TruffleBoundary.
Christian Humer <christian.humer@gmail.com>
parents:
17444
diff
changeset
|
176 * Marks a method that it is considered as a boundary for Truffle partial evaluation. |
10687
d2055a110396
Introduce CompilerDirectives.SlowPath annotation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
10650
diff
changeset
|
177 */ |
d2055a110396
Introduce CompilerDirectives.SlowPath annotation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
10650
diff
changeset
|
178 @Retention(RetentionPolicy.RUNTIME) |
19013
f7375de5eaa0
Truffle: allow @TruffleBoundary on constructors
Andreas Woess <andreas.woess@jku.at>
parents:
18906
diff
changeset
|
179 @Target({ElementType.METHOD, ElementType.CONSTRUCTOR}) |
18130
b4e38f4ca414
Truffle: rename @SlowPath to @TruffleBoundary.
Christian Humer <christian.humer@gmail.com>
parents:
17444
diff
changeset
|
180 public @interface TruffleBoundary { |
21991
169f5c55704c
added throwsControlFlowException element to @TruffleBoundary
Doug Simon <doug.simon@oracle.com>
parents:
21951
diff
changeset
|
181 /** |
169f5c55704c
added throwsControlFlowException element to @TruffleBoundary
Doug Simon <doug.simon@oracle.com>
parents:
21951
diff
changeset
|
182 * Determines whether this method throws a {@link ControlFlowException}. |
169f5c55704c
added throwsControlFlowException element to @TruffleBoundary
Doug Simon <doug.simon@oracle.com>
parents:
21951
diff
changeset
|
183 */ |
169f5c55704c
added throwsControlFlowException element to @TruffleBoundary
Doug Simon <doug.simon@oracle.com>
parents:
21951
diff
changeset
|
184 boolean throwsControlFlowException() default false; |
10687
d2055a110396
Introduce CompilerDirectives.SlowPath annotation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
10650
diff
changeset
|
185 } |
11495
3662471dcfaa
Introduce CompilerDirectives.ValueType annotation in Truffle API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
11322
diff
changeset
|
186 |
3662471dcfaa
Introduce CompilerDirectives.ValueType annotation in Truffle API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
11322
diff
changeset
|
187 /** |
3662471dcfaa
Introduce CompilerDirectives.ValueType annotation in Truffle API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
11322
diff
changeset
|
188 * Marks classes as value types. Reference comparisons (==) between instances of those classes |
3662471dcfaa
Introduce CompilerDirectives.ValueType annotation in Truffle API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
11322
diff
changeset
|
189 * have undefined semantics and can either return true or false. |
3662471dcfaa
Introduce CompilerDirectives.ValueType annotation in Truffle API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
11322
diff
changeset
|
190 */ |
3662471dcfaa
Introduce CompilerDirectives.ValueType annotation in Truffle API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
11322
diff
changeset
|
191 @Retention(RetentionPolicy.RUNTIME) |
3662471dcfaa
Introduce CompilerDirectives.ValueType annotation in Truffle API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
11322
diff
changeset
|
192 @Target({ElementType.TYPE}) |
3662471dcfaa
Introduce CompilerDirectives.ValueType annotation in Truffle API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
11322
diff
changeset
|
193 public @interface ValueType { |
3662471dcfaa
Introduce CompilerDirectives.ValueType annotation in Truffle API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
11322
diff
changeset
|
194 } |
15064
f675818d9ad0
new getStackTrace and getCurrentFrame functionality in TruffleRuntime
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14991
diff
changeset
|
195 |
f675818d9ad0
new getStackTrace and getCurrentFrame functionality in TruffleRuntime
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14991
diff
changeset
|
196 /** |
f675818d9ad0
new getStackTrace and getCurrentFrame functionality in TruffleRuntime
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14991
diff
changeset
|
197 * Ensures that the given object is not virtual, i.e., not removed by Escape Analysis at the |
f675818d9ad0
new getStackTrace and getCurrentFrame functionality in TruffleRuntime
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14991
diff
changeset
|
198 * point of this call. |
f675818d9ad0
new getStackTrace and getCurrentFrame functionality in TruffleRuntime
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14991
diff
changeset
|
199 * |
f675818d9ad0
new getStackTrace and getCurrentFrame functionality in TruffleRuntime
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14991
diff
changeset
|
200 * @param obj the object to exclude from Escape Analysis |
f675818d9ad0
new getStackTrace and getCurrentFrame functionality in TruffleRuntime
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14991
diff
changeset
|
201 */ |
f675818d9ad0
new getStackTrace and getCurrentFrame functionality in TruffleRuntime
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14991
diff
changeset
|
202 public static void materialize(Object obj) { |
f675818d9ad0
new getStackTrace and getCurrentFrame functionality in TruffleRuntime
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14991
diff
changeset
|
203 } |
9283
159ac409c27a
Fix new line at end of file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9282
diff
changeset
|
204 } |