Mercurial > hg > truffle
annotate truffle/com.oracle.truffle.api.test/src/com/oracle/truffle/api/utilities/ExactClassValueProfileTest.java @ 22493:1cb72700c10e
Increase test coverage for ExactClassValueProfile class.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Sat, 12 Dec 2015 13:34:49 +0100 |
parents | b39b603e2a1e |
children |
rev | line source |
---|---|
17039
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
1 /* |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
4 * |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
8 * |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
13 * accompanied this code). |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
14 * |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
18 * |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
21 * questions. |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
22 */ |
22424
fec62e298245
Rename package truffle.api.test to truffle.api to enable package-protected API access for testing.
Christian Humer <christian.humer@oracle.com>
parents:
22157
diff
changeset
|
23 package com.oracle.truffle.api.utilities; |
17039
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
24 |
22157
dc83cc1f94f2
Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22064
diff
changeset
|
25 import static org.hamcrest.CoreMatchers.is; |
dc83cc1f94f2
Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22064
diff
changeset
|
26 import static org.junit.Assert.assertEquals; |
22493
1cb72700c10e
Increase test coverage for ExactClassValueProfile class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
22425
diff
changeset
|
27 import static org.junit.Assert.assertNotNull; |
22157
dc83cc1f94f2
Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22064
diff
changeset
|
28 import static org.junit.Assert.assertNull; |
dc83cc1f94f2
Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22064
diff
changeset
|
29 import static org.junit.Assert.assertThat; |
22425
b39b603e2a1e
Organize imports after rename.
Christian Humer <christian.humer@oracle.com>
parents:
22424
diff
changeset
|
30 |
b39b603e2a1e
Organize imports after rename.
Christian Humer <christian.humer@oracle.com>
parents:
22424
diff
changeset
|
31 import java.lang.reflect.Method; |
b39b603e2a1e
Organize imports after rename.
Christian Humer <christian.humer@oracle.com>
parents:
22424
diff
changeset
|
32 |
22157
dc83cc1f94f2
Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22064
diff
changeset
|
33 import org.junit.Before; |
dc83cc1f94f2
Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22064
diff
changeset
|
34 import org.junit.Test; |
dc83cc1f94f2
Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22064
diff
changeset
|
35 import org.junit.experimental.theories.DataPoint; |
dc83cc1f94f2
Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22064
diff
changeset
|
36 import org.junit.experimental.theories.Theories; |
dc83cc1f94f2
Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22064
diff
changeset
|
37 import org.junit.experimental.theories.Theory; |
dc83cc1f94f2
Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22064
diff
changeset
|
38 import org.junit.runner.RunWith; |
17039
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
39 |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
40 @RunWith(Theories.class) |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
41 public class ExactClassValueProfileTest { |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
42 |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
43 @DataPoint public static final String O1 = new String(); |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
44 @DataPoint public static final String O2 = new String(); |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
45 @DataPoint public static final Object O3 = new Object(); |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
46 @DataPoint public static final Integer O4 = new Integer(1); |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
47 @DataPoint public static final Integer O5 = null; |
22493
1cb72700c10e
Increase test coverage for ExactClassValueProfile class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
22425
diff
changeset
|
48 @DataPoint public static final TestBaseClass O6 = new TestBaseClass(); |
1cb72700c10e
Increase test coverage for ExactClassValueProfile class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
22425
diff
changeset
|
49 @DataPoint public static final TestSubClass O7 = new TestSubClass(); |
17039
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
50 |
22064
02015aac6be9
Removing IdentityValueProfile and ExactClassValueProfile classes from the API
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21951
diff
changeset
|
51 private ValueProfile profile; |
17039
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
52 |
22493
1cb72700c10e
Increase test coverage for ExactClassValueProfile class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
22425
diff
changeset
|
53 private static class TestBaseClass { |
1cb72700c10e
Increase test coverage for ExactClassValueProfile class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
22425
diff
changeset
|
54 } |
1cb72700c10e
Increase test coverage for ExactClassValueProfile class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
22425
diff
changeset
|
55 |
1cb72700c10e
Increase test coverage for ExactClassValueProfile class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
22425
diff
changeset
|
56 private static class TestSubClass extends TestBaseClass { |
1cb72700c10e
Increase test coverage for ExactClassValueProfile class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
22425
diff
changeset
|
57 } |
1cb72700c10e
Increase test coverage for ExactClassValueProfile class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
22425
diff
changeset
|
58 |
17039
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
59 @Before |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
60 public void create() { |
22064
02015aac6be9
Removing IdentityValueProfile and ExactClassValueProfile classes from the API
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21951
diff
changeset
|
61 profile = ValueProfile.createClassProfile(); |
17039
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
62 } |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
63 |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
64 @Test |
22064
02015aac6be9
Removing IdentityValueProfile and ExactClassValueProfile classes from the API
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21951
diff
changeset
|
65 public void testInitial() throws Exception { |
02015aac6be9
Removing IdentityValueProfile and ExactClassValueProfile classes from the API
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21951
diff
changeset
|
66 assertThat(isGeneric(profile), is(false)); |
02015aac6be9
Removing IdentityValueProfile and ExactClassValueProfile classes from the API
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21951
diff
changeset
|
67 assertThat(isUninitialized(profile), is(true)); |
02015aac6be9
Removing IdentityValueProfile and ExactClassValueProfile classes from the API
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21951
diff
changeset
|
68 assertNull(getCachedClass(profile)); |
22493
1cb72700c10e
Increase test coverage for ExactClassValueProfile class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
22425
diff
changeset
|
69 assertNotNull(profile.toString()); |
17039
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
70 } |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
71 |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
72 @Theory |
22064
02015aac6be9
Removing IdentityValueProfile and ExactClassValueProfile classes from the API
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21951
diff
changeset
|
73 public void testProfileOne(Object value) throws Exception { |
17039
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
74 Object result = profile.profile(value); |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
75 |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
76 assertThat(result, is(value)); |
22493
1cb72700c10e
Increase test coverage for ExactClassValueProfile class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
22425
diff
changeset
|
77 assertEquals(expectedClass(value), getCachedClass(profile)); |
22064
02015aac6be9
Removing IdentityValueProfile and ExactClassValueProfile classes from the API
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21951
diff
changeset
|
78 assertThat(isUninitialized(profile), is(false)); |
22493
1cb72700c10e
Increase test coverage for ExactClassValueProfile class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
22425
diff
changeset
|
79 assertNotNull(profile.toString()); |
17039
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
80 } |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
81 |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
82 @Theory |
22064
02015aac6be9
Removing IdentityValueProfile and ExactClassValueProfile classes from the API
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21951
diff
changeset
|
83 public void testProfileTwo(Object value0, Object value1) throws Exception { |
17039
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
84 Object result0 = profile.profile(value0); |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
85 Object result1 = profile.profile(value1); |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
86 |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
87 assertThat(result0, is(value0)); |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
88 assertThat(result1, is(value1)); |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
89 |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
90 Object expectedClass = expectedClass(value0) == expectedClass(value1) ? expectedClass(value0) : Object.class; |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
91 |
22493
1cb72700c10e
Increase test coverage for ExactClassValueProfile class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
22425
diff
changeset
|
92 assertEquals(expectedClass, getCachedClass(profile)); |
22064
02015aac6be9
Removing IdentityValueProfile and ExactClassValueProfile classes from the API
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21951
diff
changeset
|
93 assertThat(isUninitialized(profile), is(false)); |
02015aac6be9
Removing IdentityValueProfile and ExactClassValueProfile classes from the API
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21951
diff
changeset
|
94 assertThat(isGeneric(profile), is(expectedClass == Object.class)); |
22493
1cb72700c10e
Increase test coverage for ExactClassValueProfile class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
22425
diff
changeset
|
95 assertNotNull(profile.toString()); |
17039
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
96 } |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
97 |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
98 @Theory |
22064
02015aac6be9
Removing IdentityValueProfile and ExactClassValueProfile classes from the API
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21951
diff
changeset
|
99 public void testProfileThree(Object value0, Object value1, Object value2) throws Exception { |
17039
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
100 Object result0 = profile.profile(value0); |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
101 Object result1 = profile.profile(value1); |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
102 Object result2 = profile.profile(value2); |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
103 |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
104 assertThat(result0, is(value0)); |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
105 assertThat(result1, is(value1)); |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
106 assertThat(result2, is(value2)); |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
107 |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
108 Object expectedClass = expectedClass(value0) == expectedClass(value1) && expectedClass(value1) == expectedClass(value2) ? expectedClass(value0) : Object.class; |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
109 |
22493
1cb72700c10e
Increase test coverage for ExactClassValueProfile class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
22425
diff
changeset
|
110 assertEquals(expectedClass, getCachedClass(profile)); |
22064
02015aac6be9
Removing IdentityValueProfile and ExactClassValueProfile classes from the API
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21951
diff
changeset
|
111 assertThat(isUninitialized(profile), is(false)); |
02015aac6be9
Removing IdentityValueProfile and ExactClassValueProfile classes from the API
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21951
diff
changeset
|
112 assertThat(isGeneric(profile), is(expectedClass == Object.class)); |
22493
1cb72700c10e
Increase test coverage for ExactClassValueProfile class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
22425
diff
changeset
|
113 assertNotNull(profile.toString()); |
17039
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
114 } |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
115 |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
116 private static Class<?> expectedClass(Object value) { |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
117 return value == null ? Object.class : value.getClass(); |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
118 } |
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
119 |
22064
02015aac6be9
Removing IdentityValueProfile and ExactClassValueProfile classes from the API
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21951
diff
changeset
|
120 private static Object get(String name, ValueProfile profile) throws Exception { |
02015aac6be9
Removing IdentityValueProfile and ExactClassValueProfile classes from the API
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21951
diff
changeset
|
121 final Method m = profile.getClass().getDeclaredMethod(name); |
02015aac6be9
Removing IdentityValueProfile and ExactClassValueProfile classes from the API
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21951
diff
changeset
|
122 m.setAccessible(true); |
02015aac6be9
Removing IdentityValueProfile and ExactClassValueProfile classes from the API
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21951
diff
changeset
|
123 return m.invoke(profile); |
02015aac6be9
Removing IdentityValueProfile and ExactClassValueProfile classes from the API
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21951
diff
changeset
|
124 } |
02015aac6be9
Removing IdentityValueProfile and ExactClassValueProfile classes from the API
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21951
diff
changeset
|
125 |
02015aac6be9
Removing IdentityValueProfile and ExactClassValueProfile classes from the API
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21951
diff
changeset
|
126 private static Object getCachedClass(ValueProfile profile) throws Exception { |
02015aac6be9
Removing IdentityValueProfile and ExactClassValueProfile classes from the API
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21951
diff
changeset
|
127 return get("getCachedClass", profile); |
02015aac6be9
Removing IdentityValueProfile and ExactClassValueProfile classes from the API
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21951
diff
changeset
|
128 } |
02015aac6be9
Removing IdentityValueProfile and ExactClassValueProfile classes from the API
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21951
diff
changeset
|
129 |
02015aac6be9
Removing IdentityValueProfile and ExactClassValueProfile classes from the API
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21951
diff
changeset
|
130 private static boolean isUninitialized(ValueProfile profile) throws Exception { |
02015aac6be9
Removing IdentityValueProfile and ExactClassValueProfile classes from the API
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21951
diff
changeset
|
131 return (Boolean) get("isUninitialized", profile); |
02015aac6be9
Removing IdentityValueProfile and ExactClassValueProfile classes from the API
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21951
diff
changeset
|
132 } |
02015aac6be9
Removing IdentityValueProfile and ExactClassValueProfile classes from the API
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21951
diff
changeset
|
133 |
02015aac6be9
Removing IdentityValueProfile and ExactClassValueProfile classes from the API
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21951
diff
changeset
|
134 private static boolean isGeneric(ValueProfile profile) throws Exception { |
02015aac6be9
Removing IdentityValueProfile and ExactClassValueProfile classes from the API
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21951
diff
changeset
|
135 return (Boolean) get("isGeneric", profile); |
02015aac6be9
Removing IdentityValueProfile and ExactClassValueProfile classes from the API
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21951
diff
changeset
|
136 } |
17039
1e542561783e
Truffle: new value profiles prototype.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
137 } |