Mercurial > hg > truffle
annotate graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotNmethodTest.java @ 19001:5a79fa76b489
Run eclipse format.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Wed, 28 Jan 2015 04:05:07 +0100 |
parents | 7cefdad149ad |
children | 8ab925a6f724 |
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 |
9668
fe9a18fbb15e
added subclasses for HotSpotInstalledCode: HotSpotNmethod and HotSpotRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9026
diff
changeset
|
32 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
|
33 |
9026
22851e342f0e
Make calling the installed code from compiled code possible.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9025
diff
changeset
|
34 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
|
35 |
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
|
36 @Test |
9026
22851e342f0e
Make calling the installed code from compiled code possible.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9025
diff
changeset
|
37 public void testInstallCodeInvalidation() { |
18120
86ec7f6f71b3
refactored GraalCompilerTest API to be in terms of ResolvedJavaMethod instead of Method
Doug Simon <doug.simon@oracle.com>
parents:
16714
diff
changeset
|
38 final ResolvedJavaMethod testJavaMethod = getResolvedJavaMethod("foo"); |
18127
7cefdad149ad
enable a GraalCompilerTest to override how a method is parsed to produce a graph as well as being able to interpose on the method that is parsed/compiled
Doug Simon <doug.simon@oracle.com>
parents:
18120
diff
changeset
|
39 final HotSpotNmethod nmethod = (HotSpotNmethod) getCode(testJavaMethod, parseEager("otherFoo")); |
9668
fe9a18fbb15e
added subclasses for HotSpotInstalledCode: HotSpotNmethod and HotSpotRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9026
diff
changeset
|
40 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
|
41 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
|
42 try { |
14991
64dcb92ee75a
Truffle: Change signature for Truffle calls from (PackedFrame, Arguments) to (Object[]).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
11959
diff
changeset
|
43 result = nmethod.executeVarargs(null, "b", "c"); |
15622
7b09605b29c5
renamed GraalTest.assertEquals* to assertDeepEquals to avoid confusion with JUnit API methods
Doug Simon <doug.simon@oracle.com>
parents:
14991
diff
changeset
|
44 assertDeepEquals(43, result); |
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
|
45 } 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
|
46 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
|
47 } |
9668
fe9a18fbb15e
added subclasses for HotSpotInstalledCode: HotSpotNmethod and HotSpotRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9026
diff
changeset
|
48 Assert.assertTrue(nmethod.isValid()); |
fe9a18fbb15e
added subclasses for HotSpotInstalledCode: HotSpotNmethod and HotSpotRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9026
diff
changeset
|
49 nmethod.invalidate(); |
fe9a18fbb15e
added subclasses for HotSpotInstalledCode: HotSpotNmethod and HotSpotRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9026
diff
changeset
|
50 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
|
51 try { |
14991
64dcb92ee75a
Truffle: Change signature for Truffle calls from (PackedFrame, Arguments) to (Object[]).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
11959
diff
changeset
|
52 result = nmethod.executeVarargs(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
|
53 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
|
54 } 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
|
55 } |
9668
fe9a18fbb15e
added subclasses for HotSpotInstalledCode: HotSpotNmethod and HotSpotRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9026
diff
changeset
|
56 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
|
57 } |
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
|
58 |
9026
22851e342f0e
Make calling the installed code from compiled code possible.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9025
diff
changeset
|
59 @Test |
10478
dd3333e4f182
Improve HotSpotNMethodTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9668
diff
changeset
|
60 public void testInstallCodeInvalidationWhileRunning() { |
18120
86ec7f6f71b3
refactored GraalCompilerTest API to be in terms of ResolvedJavaMethod instead of Method
Doug Simon <doug.simon@oracle.com>
parents:
16714
diff
changeset
|
61 final ResolvedJavaMethod testJavaMethod = getResolvedJavaMethod("foo"); |
18127
7cefdad149ad
enable a GraalCompilerTest to override how a method is parsed to produce a graph as well as being able to interpose on the method that is parsed/compiled
Doug Simon <doug.simon@oracle.com>
parents:
18120
diff
changeset
|
62 final HotSpotNmethod nmethod = (HotSpotNmethod) getCode(testJavaMethod, parseEager("otherFoo")); |
10478
dd3333e4f182
Improve HotSpotNMethodTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9668
diff
changeset
|
63 Object result; |
dd3333e4f182
Improve HotSpotNMethodTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9668
diff
changeset
|
64 try { |
14991
64dcb92ee75a
Truffle: Change signature for Truffle calls from (PackedFrame, Arguments) to (Object[]).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
11959
diff
changeset
|
65 result = nmethod.executeVarargs(nmethod, null, null); |
15622
7b09605b29c5
renamed GraalTest.assertEquals* to assertDeepEquals to avoid confusion with JUnit API methods
Doug Simon <doug.simon@oracle.com>
parents:
14991
diff
changeset
|
66 assertDeepEquals(43, result); |
10478
dd3333e4f182
Improve HotSpotNMethodTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9668
diff
changeset
|
67 } catch (InvalidInstalledCodeException e) { |
dd3333e4f182
Improve HotSpotNMethodTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9668
diff
changeset
|
68 Assert.fail("Code was invalidated"); |
dd3333e4f182
Improve HotSpotNMethodTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9668
diff
changeset
|
69 } |
dd3333e4f182
Improve HotSpotNMethodTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9668
diff
changeset
|
70 Assert.assertFalse(nmethod.isValid()); |
dd3333e4f182
Improve HotSpotNMethodTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9668
diff
changeset
|
71 } |
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 @Test |
9026
22851e342f0e
Make calling the installed code from compiled code possible.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9025
diff
changeset
|
74 public void testInstalledCodeCalledFromCompiledCode() { |
18120
86ec7f6f71b3
refactored GraalCompilerTest API to be in terms of ResolvedJavaMethod instead of Method
Doug Simon <doug.simon@oracle.com>
parents:
16714
diff
changeset
|
75 final ResolvedJavaMethod testJavaMethod = getResolvedJavaMethod("foo"); |
18127
7cefdad149ad
enable a GraalCompilerTest to override how a method is parsed to produce a graph as well as being able to interpose on the method that is parsed/compiled
Doug Simon <doug.simon@oracle.com>
parents:
18120
diff
changeset
|
76 final HotSpotNmethod nmethod = (HotSpotNmethod) getCode(testJavaMethod, parseEager("otherFoo")); |
9668
fe9a18fbb15e
added subclasses for HotSpotInstalledCode: HotSpotNmethod and HotSpotRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9026
diff
changeset
|
77 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
|
78 try { |
22851e342f0e
Make calling the installed code from compiled code possible.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9025
diff
changeset
|
79 for (int i = 0; i < ITERATION_COUNT; ++i) { |
14991
64dcb92ee75a
Truffle: Change signature for Truffle calls from (PackedFrame, Arguments) to (Object[]).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
11959
diff
changeset
|
80 nmethod.executeVarargs(null, "b", "c"); |
9026
22851e342f0e
Make calling the installed code from compiled code possible.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9025
diff
changeset
|
81 } |
22851e342f0e
Make calling the installed code from compiled code possible.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9025
diff
changeset
|
82 } catch (InvalidInstalledCodeException e) { |
22851e342f0e
Make calling the installed code from compiled code possible.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9025
diff
changeset
|
83 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
|
84 } |
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 |
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
|
87 @SuppressWarnings("unused") |
10478
dd3333e4f182
Improve HotSpotNMethodTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9668
diff
changeset
|
88 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
|
89 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
|
90 } |
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 |
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
|
92 @SuppressWarnings("unused") |
10478
dd3333e4f182
Improve HotSpotNMethodTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9668
diff
changeset
|
93 public static Object otherFoo(HotSpotNmethod method, Object a2, Object a3) { |
dd3333e4f182
Improve HotSpotNMethodTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9668
diff
changeset
|
94 if (method != null) { |
dd3333e4f182
Improve HotSpotNMethodTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9668
diff
changeset
|
95 method.invalidate(); |
dd3333e4f182
Improve HotSpotNMethodTest.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9668
diff
changeset
|
96 } |
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
|
97 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
|
98 } |
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
|
99 } |