Mercurial > hg > truffle
annotate graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotNmethodTest.java @ 13525:7cbd4f2194aa
mx: omit weird logic to copy bootstrap jdk, just do cp -R
author | Bernhard Urban <bernhard.urban@jku.at> |
---|---|
date | Tue, 07 Jan 2014 21:46:56 +0100 |
parents | 23ccaa863eda |
children | 64dcb92ee75a |
rev | line source |
---|---|
9023
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1 /* |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2013, 2013, Oracle and/or its affiliates. All rights reserved. |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
4 * |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
8 * |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
14 * |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
18 * |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
21 * questions. |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
22 */ |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
23 package com.oracle.graal.hotspot.test; |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
24 |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
25 import org.junit.*; |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
26 |
9025
ff5a32117e02
Implement fast invocation of installed code (direct tail call to the target machine code address).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9023
diff
changeset
|
27 import com.oracle.graal.api.code.*; |
9023
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
28 import com.oracle.graal.api.meta.*; |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
29 import com.oracle.graal.compiler.test.*; |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
30 import com.oracle.graal.hotspot.meta.*; |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
31 import com.oracle.graal.nodes.*; |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
32 |
9668
fe9a18fbb15e
added subclasses for HotSpotInstalledCode: HotSpotNmethod and HotSpotRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9026
diff
changeset
|
33 public class HotSpotNmethodTest extends GraalCompilerTest { |
9023
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
34 |
9026
22851e342f0e
Make calling the installed code from compiled code possible.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9025
diff
changeset
|
35 private static final int ITERATION_COUNT = 100000; |
22851e342f0e
Make calling the installed code from compiled code possible.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9025
diff
changeset
|
36 |
9023
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
37 @Test |
9026
22851e342f0e
Make calling the installed code from compiled code possible.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9025
diff
changeset
|
38 public void testInstallCodeInvalidation() { |
11959
23ccaa863eda
made CodeCacheProvider independent of MetaAccessProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
10478
diff
changeset
|
39 final ResolvedJavaMethod testJavaMethod = getMetaAccess().lookupJavaMethod(getMethod("foo")); |
9023
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
40 final StructuredGraph graph = parse("otherFoo"); |
9668
fe9a18fbb15e
added subclasses for HotSpotInstalledCode: HotSpotNmethod and HotSpotRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9026
diff
changeset
|
41 final HotSpotNmethod nmethod = (HotSpotNmethod) getCode(testJavaMethod, graph); |
fe9a18fbb15e
added subclasses for HotSpotInstalledCode: HotSpotNmethod and HotSpotRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9026
diff
changeset
|
42 Assert.assertTrue(nmethod.isValid()); |
9025
ff5a32117e02
Implement fast invocation of installed code (direct tail call to the target machine code address).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9023
diff
changeset
|
43 Object result; |
ff5a32117e02
Implement fast invocation of installed code (direct tail call to the target machine code address).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9023
diff
changeset
|
44 try { |
10478
dd3333e4f182
Improve HotSpotNMethodTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9668
diff
changeset
|
45 result = nmethod.execute(null, "b", "c"); |
9025
ff5a32117e02
Implement fast invocation of installed code (direct tail call to the target machine code address).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9023
diff
changeset
|
46 assertEquals(43, result); |
ff5a32117e02
Implement fast invocation of installed code (direct tail call to the target machine code address).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9023
diff
changeset
|
47 } catch (InvalidInstalledCodeException e) { |
ff5a32117e02
Implement fast invocation of installed code (direct tail call to the target machine code address).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9023
diff
changeset
|
48 Assert.fail("Code was invalidated"); |
ff5a32117e02
Implement fast invocation of installed code (direct tail call to the target machine code address).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9023
diff
changeset
|
49 } |
9668
fe9a18fbb15e
added subclasses for HotSpotInstalledCode: HotSpotNmethod and HotSpotRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9026
diff
changeset
|
50 Assert.assertTrue(nmethod.isValid()); |
fe9a18fbb15e
added subclasses for HotSpotInstalledCode: HotSpotNmethod and HotSpotRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9026
diff
changeset
|
51 nmethod.invalidate(); |
fe9a18fbb15e
added subclasses for HotSpotInstalledCode: HotSpotNmethod and HotSpotRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9026
diff
changeset
|
52 Assert.assertFalse(nmethod.isValid()); |
9025
ff5a32117e02
Implement fast invocation of installed code (direct tail call to the target machine code address).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9023
diff
changeset
|
53 try { |
9668
fe9a18fbb15e
added subclasses for HotSpotInstalledCode: HotSpotNmethod and HotSpotRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9026
diff
changeset
|
54 result = nmethod.execute(null, null, null); |
9025
ff5a32117e02
Implement fast invocation of installed code (direct tail call to the target machine code address).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9023
diff
changeset
|
55 Assert.fail("Code was not invalidated"); |
ff5a32117e02
Implement fast invocation of installed code (direct tail call to the target machine code address).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9023
diff
changeset
|
56 } catch (InvalidInstalledCodeException e) { |
ff5a32117e02
Implement fast invocation of installed code (direct tail call to the target machine code address).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9023
diff
changeset
|
57 } |
9668
fe9a18fbb15e
added subclasses for HotSpotInstalledCode: HotSpotNmethod and HotSpotRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9026
diff
changeset
|
58 Assert.assertFalse(nmethod.isValid()); |
9023
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
59 } |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
60 |
9026
22851e342f0e
Make calling the installed code from compiled code possible.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9025
diff
changeset
|
61 @Test |
10478
dd3333e4f182
Improve HotSpotNMethodTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9668
diff
changeset
|
62 public void testInstallCodeInvalidationWhileRunning() { |
11959
23ccaa863eda
made CodeCacheProvider independent of MetaAccessProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
10478
diff
changeset
|
63 final ResolvedJavaMethod testJavaMethod = getMetaAccess().lookupJavaMethod(getMethod("foo")); |
10478
dd3333e4f182
Improve HotSpotNMethodTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9668
diff
changeset
|
64 final StructuredGraph graph = parse("otherFoo"); |
dd3333e4f182
Improve HotSpotNMethodTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9668
diff
changeset
|
65 final HotSpotNmethod nmethod = (HotSpotNmethod) getCode(testJavaMethod, graph); |
dd3333e4f182
Improve HotSpotNMethodTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9668
diff
changeset
|
66 Object result; |
dd3333e4f182
Improve HotSpotNMethodTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9668
diff
changeset
|
67 try { |
dd3333e4f182
Improve HotSpotNMethodTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9668
diff
changeset
|
68 result = nmethod.execute(nmethod, null, null); |
dd3333e4f182
Improve HotSpotNMethodTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9668
diff
changeset
|
69 assertEquals(43, result); |
dd3333e4f182
Improve HotSpotNMethodTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9668
diff
changeset
|
70 } catch (InvalidInstalledCodeException e) { |
dd3333e4f182
Improve HotSpotNMethodTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9668
diff
changeset
|
71 Assert.fail("Code was invalidated"); |
dd3333e4f182
Improve HotSpotNMethodTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9668
diff
changeset
|
72 } |
dd3333e4f182
Improve HotSpotNMethodTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9668
diff
changeset
|
73 Assert.assertFalse(nmethod.isValid()); |
dd3333e4f182
Improve HotSpotNMethodTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9668
diff
changeset
|
74 } |
dd3333e4f182
Improve HotSpotNMethodTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9668
diff
changeset
|
75 |
dd3333e4f182
Improve HotSpotNMethodTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9668
diff
changeset
|
76 @Test |
9026
22851e342f0e
Make calling the installed code from compiled code possible.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9025
diff
changeset
|
77 public void testInstalledCodeCalledFromCompiledCode() { |
11959
23ccaa863eda
made CodeCacheProvider independent of MetaAccessProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
10478
diff
changeset
|
78 final ResolvedJavaMethod testJavaMethod = getMetaAccess().lookupJavaMethod(getMethod("foo")); |
9026
22851e342f0e
Make calling the installed code from compiled code possible.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9025
diff
changeset
|
79 final StructuredGraph graph = parse("otherFoo"); |
9668
fe9a18fbb15e
added subclasses for HotSpotInstalledCode: HotSpotNmethod and HotSpotRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9026
diff
changeset
|
80 final HotSpotNmethod nmethod = (HotSpotNmethod) getCode(testJavaMethod, graph); |
fe9a18fbb15e
added subclasses for HotSpotInstalledCode: HotSpotNmethod and HotSpotRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9026
diff
changeset
|
81 Assert.assertTrue(nmethod.isValid()); |
9026
22851e342f0e
Make calling the installed code from compiled code possible.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9025
diff
changeset
|
82 try { |
22851e342f0e
Make calling the installed code from compiled code possible.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9025
diff
changeset
|
83 for (int i = 0; i < ITERATION_COUNT; ++i) { |
10478
dd3333e4f182
Improve HotSpotNMethodTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9668
diff
changeset
|
84 nmethod.execute(null, "b", "c"); |
9026
22851e342f0e
Make calling the installed code from compiled code possible.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9025
diff
changeset
|
85 } |
22851e342f0e
Make calling the installed code from compiled code possible.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9025
diff
changeset
|
86 } catch (InvalidInstalledCodeException e) { |
22851e342f0e
Make calling the installed code from compiled code possible.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9025
diff
changeset
|
87 Assert.fail("Code was invalidated"); |
22851e342f0e
Make calling the installed code from compiled code possible.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9025
diff
changeset
|
88 } |
22851e342f0e
Make calling the installed code from compiled code possible.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9025
diff
changeset
|
89 } |
22851e342f0e
Make calling the installed code from compiled code possible.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9025
diff
changeset
|
90 |
9023
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
91 @SuppressWarnings("unused") |
10478
dd3333e4f182
Improve HotSpotNMethodTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9668
diff
changeset
|
92 public static Object foo(HotSpotNmethod method, Object a2, Object a3) { |
9023
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
93 return 42; |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
94 } |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
95 |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
96 @SuppressWarnings("unused") |
10478
dd3333e4f182
Improve HotSpotNMethodTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9668
diff
changeset
|
97 public static Object otherFoo(HotSpotNmethod method, Object a2, Object a3) { |
dd3333e4f182
Improve HotSpotNMethodTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9668
diff
changeset
|
98 if (method != null) { |
dd3333e4f182
Improve HotSpotNMethodTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9668
diff
changeset
|
99 method.invalidate(); |
dd3333e4f182
Improve HotSpotNMethodTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9668
diff
changeset
|
100 } |
9023
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
101 return 43; |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
102 } |
f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
103 } |