Mercurial > hg > graal-jvmci-8
annotate src/share/vm/jvmci/jvmciRuntime.cpp @ 24234:ea6f94ab283b default tip
Added tag jvmci-0.36 for changeset 8128b98d4736
author | Gilles Duboscq <gilles.m.duboscq@oracle.com> |
---|---|
date | Mon, 18 Sep 2017 18:49:45 +0200 |
parents | 190f5f33b7d3 |
children |
rev | line source |
---|---|
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
1 /* |
23322
f8178417d018
Expose SharedRuntime::throw_and_post_jvmti_exception to JVMCI compilers.
Roland Schatz <roland.schatz@oracle.com>
parents:
23319
diff
changeset
|
2 * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
4 * |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
7 * published by the Free Software Foundation. |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
8 * |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
13 * accompanied this code). |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
14 * |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
18 * |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
21 * questions. |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
22 */ |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
23 |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
24 #include "precompiled.hpp" |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
25 #include "asm/codeBuffer.hpp" |
22517
0915f5bfdfaa
Adopt some jvmci-9 source changes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22515
diff
changeset
|
26 #include "code/codeCache.hpp" |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
27 #include "compiler/compileBroker.hpp" |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
28 #include "compiler/disassembler.hpp" |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
29 #include "jvmci/jvmciRuntime.hpp" |
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
30 #include "jvmci/jvmciCompilerToVM.hpp" |
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
31 #include "jvmci/jvmciCompiler.hpp" |
22548
02fc27dc1da7
Rename jvmciJavaAccess.* to jvmciJavaClasses.*
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22547
diff
changeset
|
32 #include "jvmci/jvmciJavaClasses.hpp" |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
33 #include "jvmci/jvmciEnv.hpp" |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
34 #include "memory/oopFactory.hpp" |
22517
0915f5bfdfaa
Adopt some jvmci-9 source changes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22515
diff
changeset
|
35 #include "oops/oop.inline.hpp" |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
36 #include "prims/jvm.h" |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
37 #include "runtime/biasedLocking.hpp" |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
38 #include "runtime/interfaceSupport.hpp" |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
39 #include "runtime/reflection.hpp" |
22517
0915f5bfdfaa
Adopt some jvmci-9 source changes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22515
diff
changeset
|
40 #include "runtime/sharedRuntime.hpp" |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
41 #include "utilities/debug.hpp" |
21519
cecb4e39521c
Use files in lib/graal/options to define Graal options (-G:...) instead of generating code for them
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21516
diff
changeset
|
42 #include "utilities/defaultStream.hpp" |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
43 |
21587
59c3f921e454
fixes for windows build (size_t conversion, missing precompiled.hpp, missing strtof, strtoll in Windows SDK)
Christian Wirth <christian.wirth@oracle.com>
parents:
21564
diff
changeset
|
44 #if defined(_MSC_VER) |
59c3f921e454
fixes for windows build (size_t conversion, missing precompiled.hpp, missing strtof, strtoll in Windows SDK)
Christian Wirth <christian.wirth@oracle.com>
parents:
21564
diff
changeset
|
45 #define strtoll _strtoi64 |
59c3f921e454
fixes for windows build (size_t conversion, missing precompiled.hpp, missing strtof, strtoll in Windows SDK)
Christian Wirth <christian.wirth@oracle.com>
parents:
21564
diff
changeset
|
46 #endif |
59c3f921e454
fixes for windows build (size_t conversion, missing precompiled.hpp, missing strtof, strtoll in Windows SDK)
Christian Wirth <christian.wirth@oracle.com>
parents:
21564
diff
changeset
|
47 |
59c3f921e454
fixes for windows build (size_t conversion, missing precompiled.hpp, missing strtof, strtoll in Windows SDK)
Christian Wirth <christian.wirth@oracle.com>
parents:
21564
diff
changeset
|
48 jobject JVMCIRuntime::_HotSpotJVMCIRuntime_instance = NULL; |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
49 bool JVMCIRuntime::_HotSpotJVMCIRuntime_initialized = false; |
22575
569c82ebb96e
Replace JVMCICompileWithC1Only with package based controls
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22574
diff
changeset
|
50 int JVMCIRuntime::_trivial_prefixes_count = 0; |
569c82ebb96e
Replace JVMCICompileWithC1Only with package based controls
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22574
diff
changeset
|
51 char** JVMCIRuntime::_trivial_prefixes = NULL; |
23379
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
52 JVMCIRuntime::CompLevelAdjustment JVMCIRuntime::_comp_level_adjustment = JVMCIRuntime::none; |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
53 bool JVMCIRuntime::_shutdown_called = false; |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
54 |
23408
f84a5ac3be22
make JVMCI JDK immutable and sharable among different JVMCI clients
Doug Simon <doug.simon@oracle.com>
parents:
23404
diff
changeset
|
55 BasicType JVMCIRuntime::kindToBasicType(Handle kind, TRAPS) { |
f84a5ac3be22
make JVMCI JDK immutable and sharable among different JVMCI clients
Doug Simon <doug.simon@oracle.com>
parents:
23404
diff
changeset
|
56 if (kind.is_null()) { |
f84a5ac3be22
make JVMCI JDK immutable and sharable among different JVMCI clients
Doug Simon <doug.simon@oracle.com>
parents:
23404
diff
changeset
|
57 THROW_(vmSymbols::java_lang_NullPointerException(), T_ILLEGAL); |
f84a5ac3be22
make JVMCI JDK immutable and sharable among different JVMCI clients
Doug Simon <doug.simon@oracle.com>
parents:
23404
diff
changeset
|
58 } |
f84a5ac3be22
make JVMCI JDK immutable and sharable among different JVMCI clients
Doug Simon <doug.simon@oracle.com>
parents:
23404
diff
changeset
|
59 jchar ch = JavaKind::typeChar(kind); |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
60 switch(ch) { |
23393
1d4ce2d19e52
clean up and minimize JVMCI (JDK-8156835)
Doug Simon <doug.simon@oracle.com>
parents:
23392
diff
changeset
|
61 case 'Z': return T_BOOLEAN; |
1d4ce2d19e52
clean up and minimize JVMCI (JDK-8156835)
Doug Simon <doug.simon@oracle.com>
parents:
23392
diff
changeset
|
62 case 'B': return T_BYTE; |
1d4ce2d19e52
clean up and minimize JVMCI (JDK-8156835)
Doug Simon <doug.simon@oracle.com>
parents:
23392
diff
changeset
|
63 case 'S': return T_SHORT; |
1d4ce2d19e52
clean up and minimize JVMCI (JDK-8156835)
Doug Simon <doug.simon@oracle.com>
parents:
23392
diff
changeset
|
64 case 'C': return T_CHAR; |
1d4ce2d19e52
clean up and minimize JVMCI (JDK-8156835)
Doug Simon <doug.simon@oracle.com>
parents:
23392
diff
changeset
|
65 case 'I': return T_INT; |
1d4ce2d19e52
clean up and minimize JVMCI (JDK-8156835)
Doug Simon <doug.simon@oracle.com>
parents:
23392
diff
changeset
|
66 case 'F': return T_FLOAT; |
1d4ce2d19e52
clean up and minimize JVMCI (JDK-8156835)
Doug Simon <doug.simon@oracle.com>
parents:
23392
diff
changeset
|
67 case 'J': return T_LONG; |
1d4ce2d19e52
clean up and minimize JVMCI (JDK-8156835)
Doug Simon <doug.simon@oracle.com>
parents:
23392
diff
changeset
|
68 case 'D': return T_DOUBLE; |
1d4ce2d19e52
clean up and minimize JVMCI (JDK-8156835)
Doug Simon <doug.simon@oracle.com>
parents:
23392
diff
changeset
|
69 case 'A': return T_OBJECT; |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
70 case '-': return T_ILLEGAL; |
22722
0229a2ca608b
Make kindToBasicType trapping.
Roland Schatz <roland.schatz@oracle.com>
parents:
22711
diff
changeset
|
71 default: |
0229a2ca608b
Make kindToBasicType trapping.
Roland Schatz <roland.schatz@oracle.com>
parents:
22711
diff
changeset
|
72 JVMCI_ERROR_(T_ILLEGAL, "unexpected Kind: %c", ch); |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
73 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
74 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
75 |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
76 // Simple helper to see if the caller of a runtime stub which |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
77 // entered the VM has been deoptimized |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
78 |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
79 static bool caller_is_deopted() { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
80 JavaThread* thread = JavaThread::current(); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
81 RegisterMap reg_map(thread, false); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
82 frame runtime_frame = thread->last_frame(); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
83 frame caller_frame = runtime_frame.sender(®_map); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
84 assert(caller_frame.is_compiled_frame(), "must be compiled"); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
85 return caller_frame.is_deoptimized_frame(); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
86 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
87 |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
88 // Stress deoptimization |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
89 static void deopt_caller() { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
90 if ( !caller_is_deopted()) { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
91 JavaThread* thread = JavaThread::current(); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
92 RegisterMap reg_map(thread, false); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
93 frame runtime_frame = thread->last_frame(); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
94 frame caller_frame = runtime_frame.sender(®_map); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
95 Deoptimization::deoptimize_frame(thread, caller_frame.id(), Deoptimization::Reason_constraint); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
96 assert(caller_is_deopted(), "Must be deoptimized"); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
97 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
98 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
99 |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
100 JRT_BLOCK_ENTRY(void, JVMCIRuntime::new_instance(JavaThread* thread, Klass* klass)) |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
101 JRT_BLOCK; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
102 assert(klass->is_klass(), "not a class"); |
23408
f84a5ac3be22
make JVMCI JDK immutable and sharable among different JVMCI clients
Doug Simon <doug.simon@oracle.com>
parents:
23404
diff
changeset
|
103 Handle holder(THREAD, klass->klass_holder()); // keep the klass alive |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
104 instanceKlassHandle h(thread, klass); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
105 h->check_valid_for_instantiation(true, CHECK); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
106 // make sure klass is initialized |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
107 h->initialize(CHECK); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
108 // allocate instance and return via TLS |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
109 oop obj = h->allocate_instance(CHECK); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
110 thread->set_vm_result(obj); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
111 JRT_BLOCK_END; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
112 |
22447
ecbf949a9dcd
replace JVMCIDeferredInitBarriers with ReduceInitialCardMarks
Doug Simon <doug.simon@oracle.com>
parents:
22438
diff
changeset
|
113 if (ReduceInitialCardMarks) { |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
114 new_store_pre_barrier(thread); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
115 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
116 JRT_END |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
117 |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
118 JRT_BLOCK_ENTRY(void, JVMCIRuntime::new_array(JavaThread* thread, Klass* array_klass, jint length)) |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
119 JRT_BLOCK; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
120 // Note: no handle for klass needed since they are not used |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
121 // anymore after new_objArray() and no GC can happen before. |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
122 // (This may have to change if this code changes!) |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
123 assert(array_klass->is_klass(), "not a class"); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
124 oop obj; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
125 if (array_klass->oop_is_typeArray()) { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
126 BasicType elt_type = TypeArrayKlass::cast(array_klass)->element_type(); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
127 obj = oopFactory::new_typeArray(elt_type, length, CHECK); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
128 } else { |
23408
f84a5ac3be22
make JVMCI JDK immutable and sharable among different JVMCI clients
Doug Simon <doug.simon@oracle.com>
parents:
23404
diff
changeset
|
129 Handle holder(THREAD, array_klass->klass_holder()); // keep the klass alive |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
130 Klass* elem_klass = ObjArrayKlass::cast(array_klass)->element_klass(); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
131 obj = oopFactory::new_objArray(elem_klass, length, CHECK); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
132 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
133 thread->set_vm_result(obj); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
134 // This is pretty rare but this runtime patch is stressful to deoptimization |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
135 // if we deoptimize here so force a deopt to stress the path. |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
136 if (DeoptimizeALot) { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
137 static int deopts = 0; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
138 // Alternate between deoptimizing and raising an error (which will also cause a deopt) |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
139 if (deopts++ % 2 == 0) { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
140 ResourceMark rm(THREAD); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
141 THROW(vmSymbols::java_lang_OutOfMemoryError()); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
142 } else { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
143 deopt_caller(); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
144 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
145 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
146 JRT_BLOCK_END; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
147 |
22447
ecbf949a9dcd
replace JVMCIDeferredInitBarriers with ReduceInitialCardMarks
Doug Simon <doug.simon@oracle.com>
parents:
22438
diff
changeset
|
148 if (ReduceInitialCardMarks) { |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
149 new_store_pre_barrier(thread); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
150 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
151 JRT_END |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
152 |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
153 void JVMCIRuntime::new_store_pre_barrier(JavaThread* thread) { |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
154 // After any safepoint, just before going back to compiled code, |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
155 // we inform the GC that we will be doing initializing writes to |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
156 // this object in the future without emitting card-marks, so |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
157 // GC may take any compensating steps. |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
158 // NOTE: Keep this code consistent with GraphKit::store_barrier. |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
159 |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
160 oop new_obj = thread->vm_result(); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
161 if (new_obj == NULL) return; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
162 |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
163 assert(Universe::heap()->can_elide_tlab_store_barriers(), |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
164 "compiler must check this first"); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
165 // GC may decide to give back a safer copy of new_obj. |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
166 new_obj = Universe::heap()->new_store_pre_barrier(thread, new_obj); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
167 thread->set_vm_result(new_obj); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
168 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
169 |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
170 JRT_ENTRY(void, JVMCIRuntime::new_multi_array(JavaThread* thread, Klass* klass, int rank, jint* dims)) |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
171 assert(klass->is_klass(), "not a class"); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
172 assert(rank >= 1, "rank must be nonzero"); |
23408
f84a5ac3be22
make JVMCI JDK immutable and sharable among different JVMCI clients
Doug Simon <doug.simon@oracle.com>
parents:
23404
diff
changeset
|
173 Handle holder(THREAD, klass->klass_holder()); // keep the klass alive |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
174 oop obj = ArrayKlass::cast(klass)->multi_allocate(rank, dims, CHECK); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
175 thread->set_vm_result(obj); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
176 JRT_END |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
177 |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
178 JRT_ENTRY(void, JVMCIRuntime::dynamic_new_array(JavaThread* thread, oopDesc* element_mirror, jint length)) |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
179 oop obj = Reflection::reflect_new_array(element_mirror, length, CHECK); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
180 thread->set_vm_result(obj); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
181 JRT_END |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
182 |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
183 JRT_ENTRY(void, JVMCIRuntime::dynamic_new_instance(JavaThread* thread, oopDesc* type_mirror)) |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
184 instanceKlassHandle klass(THREAD, java_lang_Class::as_Klass(type_mirror)); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
185 |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
186 if (klass == NULL) { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
187 ResourceMark rm(THREAD); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
188 THROW(vmSymbols::java_lang_InstantiationException()); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
189 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
190 |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
191 // Create new instance (the receiver) |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
192 klass->check_valid_for_instantiation(false, CHECK); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
193 |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
194 // Make sure klass gets initialized |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
195 klass->initialize(CHECK); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
196 |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
197 oop obj = klass->allocate_instance(CHECK); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
198 thread->set_vm_result(obj); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
199 JRT_END |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
200 |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
201 extern void vm_exit(int code); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
202 |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
203 // Enter this method from compiled code handler below. This is where we transition |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
204 // to VM mode. This is done as a helper routine so that the method called directly |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
205 // from compiled code does not have to transition to VM. This allows the entry |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
206 // method to see if the nmethod that we have just looked up a handler for has |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
207 // been deoptimized while we were in the vm. This simplifies the assembly code |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
208 // cpu directories. |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
209 // |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
210 // We are entering here from exception stub (via the entry method below) |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
211 // If there is a compiled exception handler in this method, we will continue there; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
212 // otherwise we will unwind the stack and continue at the caller of top frame method |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
213 // Note: we enter in Java using a special JRT wrapper. This wrapper allows us to |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
214 // control the area where we can allow a safepoint. After we exit the safepoint area we can |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
215 // check to see if the handler we are going to return is now in a nmethod that has |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
216 // been deoptimized. If that is the case we return the deopt blob |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
217 // unpack_with_exception entry instead. This makes life for the exception blob easier |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
218 // because making that same check and diverting is painful from assembly language. |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
219 JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* thread, oopDesc* ex, address pc, nmethod*& nm)) |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
220 // Reset method handle flag. |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
221 thread->set_is_method_handle_return(false); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
222 |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
223 Handle exception(thread, ex); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
224 nm = CodeCache::find_nmethod(pc); |
22517
0915f5bfdfaa
Adopt some jvmci-9 source changes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22515
diff
changeset
|
225 assert(nm != NULL, "this is not a compiled method"); |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
226 // Adjust the pc as needed/ |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
227 if (nm->is_deopt_pc(pc)) { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
228 RegisterMap map(thread, false); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
229 frame exception_frame = thread->last_frame().sender(&map); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
230 // if the frame isn't deopted then pc must not correspond to the caller of last_frame |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
231 assert(exception_frame.is_deoptimized_frame(), "must be deopted"); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
232 pc = exception_frame.pc(); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
233 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
234 #ifdef ASSERT |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
235 assert(exception.not_null(), "NULL exceptions should be handled by throw_exception"); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
236 assert(exception->is_oop(), "just checking"); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
237 // Check that exception is a subclass of Throwable, otherwise we have a VerifyError |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
238 if (!(exception->is_a(SystemDictionary::Throwable_klass()))) { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
239 if (ExitVMOnVerifyError) vm_exit(-1); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
240 ShouldNotReachHere(); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
241 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
242 #endif |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
243 |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
244 // Check the stack guard pages and reenable them if necessary and there is |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
245 // enough space on the stack to do so. Use fast exceptions only if the guard |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
246 // pages are enabled. |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
247 bool guard_pages_enabled = thread->stack_yellow_zone_enabled(); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
248 if (!guard_pages_enabled) guard_pages_enabled = thread->reguard_stack(); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
249 |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
250 if (JvmtiExport::can_post_on_exceptions()) { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
251 // To ensure correct notification of exception catches and throws |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
252 // we have to deoptimize here. If we attempted to notify the |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
253 // catches and throws during this exception lookup it's possible |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
254 // we could deoptimize on the way out of the VM and end back in |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
255 // the interpreter at the throw site. This would result in double |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
256 // notifications since the interpreter would also notify about |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
257 // these same catches and throws as it unwound the frame. |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
258 |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
259 RegisterMap reg_map(thread); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
260 frame stub_frame = thread->last_frame(); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
261 frame caller_frame = stub_frame.sender(®_map); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
262 |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
263 // We don't really want to deoptimize the nmethod itself since we |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
264 // can actually continue in the exception handler ourselves but I |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
265 // don't see an easy way to have the desired effect. |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
266 Deoptimization::deoptimize_frame(thread, caller_frame.id(), Deoptimization::Reason_constraint); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
267 assert(caller_is_deopted(), "Must be deoptimized"); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
268 |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
269 return SharedRuntime::deopt_blob()->unpack_with_exception_in_tls(); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
270 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
271 |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
272 // ExceptionCache is used only for exceptions at call sites and not for implicit exceptions |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
273 if (guard_pages_enabled) { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
274 address fast_continuation = nm->handler_for_exception_and_pc(exception, pc); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
275 if (fast_continuation != NULL) { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
276 // Set flag if return address is a method handle call site. |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
277 thread->set_is_method_handle_return(nm->is_method_handle_return(pc)); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
278 return fast_continuation; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
279 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
280 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
281 |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
282 // If the stack guard pages are enabled, check whether there is a handler in |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
283 // the current method. Otherwise (guard pages disabled), force an unwind and |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
284 // skip the exception cache update (i.e., just leave continuation==NULL). |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
285 address continuation = NULL; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
286 if (guard_pages_enabled) { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
287 |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
288 // New exception handling mechanism can support inlined methods |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
289 // with exception handlers since the mappings are from PC to PC |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
290 |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
291 // debugging support |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
292 // tracing |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
293 if (TraceExceptions) { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
294 ttyLocker ttyl; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
295 ResourceMark rm; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
296 tty->print_cr("Exception <%s> (" INTPTR_FORMAT ") thrown in compiled method <%s> at PC " INTPTR_FORMAT " for thread " INTPTR_FORMAT "", |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
297 exception->print_value_string(), p2i((address)exception()), nm->method()->print_value_string(), p2i(pc), p2i(thread)); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
298 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
299 // for AbortVMOnException flag |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
300 NOT_PRODUCT(Exceptions::debug_check_abort(exception)); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
301 |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
302 // Clear out the exception oop and pc since looking up an |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
303 // exception handler can cause class loading, which might throw an |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
304 // exception and those fields are expected to be clear during |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
305 // normal bytecode execution. |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
306 thread->clear_exception_oop_and_pc(); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
307 |
23745
a074ae16281d
backport of JDK-8164480
Doug Simon <doug.simon@oracle.com>
parents:
23709
diff
changeset
|
308 bool recursive_exception = false; |
a074ae16281d
backport of JDK-8164480
Doug Simon <doug.simon@oracle.com>
parents:
23709
diff
changeset
|
309 continuation = SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, false, false, recursive_exception); |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
310 // If an exception was thrown during exception dispatch, the exception oop may have changed |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
311 thread->set_exception_oop(exception()); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
312 thread->set_exception_pc(pc); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
313 |
23745
a074ae16281d
backport of JDK-8164480
Doug Simon <doug.simon@oracle.com>
parents:
23709
diff
changeset
|
314 // The exception cache is used only for non-implicit exceptions |
a074ae16281d
backport of JDK-8164480
Doug Simon <doug.simon@oracle.com>
parents:
23709
diff
changeset
|
315 // Update the exception cache only when another exception did |
a074ae16281d
backport of JDK-8164480
Doug Simon <doug.simon@oracle.com>
parents:
23709
diff
changeset
|
316 // occur during the computation of the compiled exception handler |
a074ae16281d
backport of JDK-8164480
Doug Simon <doug.simon@oracle.com>
parents:
23709
diff
changeset
|
317 // (e.g., when loading the class of the catch type). |
a074ae16281d
backport of JDK-8164480
Doug Simon <doug.simon@oracle.com>
parents:
23709
diff
changeset
|
318 // Checking for exception oop equality is not |
a074ae16281d
backport of JDK-8164480
Doug Simon <doug.simon@oracle.com>
parents:
23709
diff
changeset
|
319 // sufficient because some exceptions are pre-allocated and reused. |
a074ae16281d
backport of JDK-8164480
Doug Simon <doug.simon@oracle.com>
parents:
23709
diff
changeset
|
320 if (continuation != NULL && !recursive_exception && !SharedRuntime::deopt_blob()->contains(continuation)) { |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
321 nm->add_handler_for_exception_and_pc(exception, pc, continuation); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
322 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
323 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
324 |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
325 // Set flag if return address is a method handle call site. |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
326 thread->set_is_method_handle_return(nm->is_method_handle_return(pc)); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
327 |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
328 if (TraceExceptions) { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
329 ttyLocker ttyl; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
330 ResourceMark rm; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
331 tty->print_cr("Thread " PTR_FORMAT " continuing at PC " PTR_FORMAT " for exception thrown at PC " PTR_FORMAT, |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
332 p2i(thread), p2i(continuation), p2i(pc)); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
333 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
334 |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
335 return continuation; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
336 JRT_END |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
337 |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
338 // Enter this method from compiled code only if there is a Java exception handler |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
339 // in the method handling the exception. |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
340 // We are entering here from exception stub. We don't do a normal VM transition here. |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
341 // We do it in a helper. This is so we can check to see if the nmethod we have just |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
342 // searched for an exception handler has been deoptimized in the meantime. |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
343 address JVMCIRuntime::exception_handler_for_pc(JavaThread* thread) { |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
344 oop exception = thread->exception_oop(); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
345 address pc = thread->exception_pc(); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
346 // Still in Java mode |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
347 DEBUG_ONLY(ResetNoHandleMark rnhm); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
348 nmethod* nm = NULL; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
349 address continuation = NULL; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
350 { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
351 // Enter VM mode by calling the helper |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
352 ResetNoHandleMark rnhm; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
353 continuation = exception_handler_for_pc_helper(thread, exception, pc, nm); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
354 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
355 // Back in JAVA, use no oops DON'T safepoint |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
356 |
22517
0915f5bfdfaa
Adopt some jvmci-9 source changes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22515
diff
changeset
|
357 // Now check to see if the compiled method we were called from is now deoptimized. |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
358 // If so we must return to the deopt blob and deoptimize the nmethod |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
359 if (nm != NULL && caller_is_deopted()) { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
360 continuation = SharedRuntime::deopt_blob()->unpack_with_exception_in_tls(); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
361 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
362 |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
363 assert(continuation != NULL, "no handler found"); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
364 return continuation; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
365 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
366 |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
367 JRT_ENTRY_NO_ASYNC(void, JVMCIRuntime::monitorenter(JavaThread* thread, oopDesc* obj, BasicLock* lock)) |
22544
b87d1bf3cd9a
renamed TraceJVMCI option to JVMCITraceLevel and ensured all tracing controlled by this option uses the TRACE_jvmci_* macros
Doug Simon <doug.simon@oracle.com>
parents:
22543
diff
changeset
|
368 IF_TRACE_jvmci_3 { |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
369 char type[O_BUFLEN]; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
370 obj->klass()->name()->as_C_string(type, O_BUFLEN); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
371 markOop mark = obj->mark(); |
22544
b87d1bf3cd9a
renamed TraceJVMCI option to JVMCITraceLevel and ensured all tracing controlled by this option uses the TRACE_jvmci_* macros
Doug Simon <doug.simon@oracle.com>
parents:
22543
diff
changeset
|
372 TRACE_jvmci_3("%s: entered locking slow case with obj=" INTPTR_FORMAT ", type=%s, mark=" INTPTR_FORMAT ", lock=" INTPTR_FORMAT, thread->name(), p2i(obj), type, p2i(mark), p2i(lock)); |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
373 tty->flush(); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
374 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
375 if (PrintBiasedLockingStatistics) { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
376 Atomic::inc(BiasedLocking::slow_path_entry_count_addr()); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
377 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
378 Handle h_obj(thread, obj); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
379 assert(h_obj()->is_oop(), "must be NULL or an object"); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
380 if (UseBiasedLocking) { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
381 // Retry fast entry if bias is revoked to avoid unnecessary inflation |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
382 ObjectSynchronizer::fast_enter(h_obj, lock, true, CHECK); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
383 } else { |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
384 if (JVMCIUseFastLocking) { |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
385 // When using fast locking, the compiled code has already tried the fast case |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
386 ObjectSynchronizer::slow_enter(h_obj, lock, THREAD); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
387 } else { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
388 ObjectSynchronizer::fast_enter(h_obj, lock, false, THREAD); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
389 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
390 } |
22544
b87d1bf3cd9a
renamed TraceJVMCI option to JVMCITraceLevel and ensured all tracing controlled by this option uses the TRACE_jvmci_* macros
Doug Simon <doug.simon@oracle.com>
parents:
22543
diff
changeset
|
391 TRACE_jvmci_3("%s: exiting locking slow with obj=" INTPTR_FORMAT, thread->name(), p2i(obj)); |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
392 JRT_END |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
393 |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
394 JRT_LEAF(void, JVMCIRuntime::monitorexit(JavaThread* thread, oopDesc* obj, BasicLock* lock)) |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
395 assert(thread == JavaThread::current(), "threads must correspond"); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
396 assert(thread->last_Java_sp(), "last_Java_sp must be set"); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
397 // monitorexit is non-blocking (leaf routine) => no exceptions can be thrown |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
398 EXCEPTION_MARK; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
399 |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
400 #ifdef DEBUG |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
401 if (!obj->is_oop()) { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
402 ResetNoHandleMark rhm; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
403 nmethod* method = thread->last_frame().cb()->as_nmethod_or_null(); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
404 if (method != NULL) { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
405 tty->print_cr("ERROR in monitorexit in method %s wrong obj " INTPTR_FORMAT, method->name(), p2i(obj)); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
406 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
407 thread->print_stack_on(tty); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
408 assert(false, "invalid lock object pointer dected"); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
409 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
410 #endif |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
411 |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
412 if (JVMCIUseFastLocking) { |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
413 // When using fast locking, the compiled code has already tried the fast case |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
414 ObjectSynchronizer::slow_exit(obj, lock, THREAD); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
415 } else { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
416 ObjectSynchronizer::fast_exit(obj, lock, THREAD); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
417 } |
22544
b87d1bf3cd9a
renamed TraceJVMCI option to JVMCITraceLevel and ensured all tracing controlled by this option uses the TRACE_jvmci_* macros
Doug Simon <doug.simon@oracle.com>
parents:
22543
diff
changeset
|
418 IF_TRACE_jvmci_3 { |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
419 char type[O_BUFLEN]; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
420 obj->klass()->name()->as_C_string(type, O_BUFLEN); |
22544
b87d1bf3cd9a
renamed TraceJVMCI option to JVMCITraceLevel and ensured all tracing controlled by this option uses the TRACE_jvmci_* macros
Doug Simon <doug.simon@oracle.com>
parents:
22543
diff
changeset
|
421 TRACE_jvmci_3("%s: exited locking slow case with obj=" INTPTR_FORMAT ", type=%s, mark=" INTPTR_FORMAT ", lock=" INTPTR_FORMAT, thread->name(), p2i(obj), type, p2i(obj->mark()), p2i(lock)); |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
422 tty->flush(); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
423 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
424 JRT_END |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
425 |
23367
041534002323
Use strings instead of Symbol* for exception names (JDK-8155735).
Roland Schatz <roland.schatz@oracle.com>
parents:
23337
diff
changeset
|
426 JRT_ENTRY(void, JVMCIRuntime::throw_and_post_jvmti_exception(JavaThread* thread, const char* exception, const char* message)) |
23372
1c7bac3f1f20
Use CHECK instead of HAS_PENDING_EXCEPTION (JDK-8155735).
Roland Schatz <roland.schatz@oracle.com>
parents:
23371
diff
changeset
|
427 TempNewSymbol symbol = SymbolTable::new_symbol(exception, CHECK); |
1c7bac3f1f20
Use CHECK instead of HAS_PENDING_EXCEPTION (JDK-8155735).
Roland Schatz <roland.schatz@oracle.com>
parents:
23371
diff
changeset
|
428 SharedRuntime::throw_and_post_jvmti_exception(thread, symbol, message); |
23322
f8178417d018
Expose SharedRuntime::throw_and_post_jvmti_exception to JVMCI compilers.
Roland Schatz <roland.schatz@oracle.com>
parents:
23319
diff
changeset
|
429 JRT_END |
f8178417d018
Expose SharedRuntime::throw_and_post_jvmti_exception to JVMCI compilers.
Roland Schatz <roland.schatz@oracle.com>
parents:
23319
diff
changeset
|
430 |
23367
041534002323
Use strings instead of Symbol* for exception names (JDK-8155735).
Roland Schatz <roland.schatz@oracle.com>
parents:
23337
diff
changeset
|
431 JRT_ENTRY(void, JVMCIRuntime::throw_klass_external_name_exception(JavaThread* thread, const char* exception, Klass* klass)) |
23334
e0a15983ab51
Create exception throwing routines for exceptions with complex messages.
Roland Schatz <roland.schatz@oracle.com>
parents:
23329
diff
changeset
|
432 ResourceMark rm(thread); |
23372
1c7bac3f1f20
Use CHECK instead of HAS_PENDING_EXCEPTION (JDK-8155735).
Roland Schatz <roland.schatz@oracle.com>
parents:
23371
diff
changeset
|
433 TempNewSymbol symbol = SymbolTable::new_symbol(exception, CHECK); |
1c7bac3f1f20
Use CHECK instead of HAS_PENDING_EXCEPTION (JDK-8155735).
Roland Schatz <roland.schatz@oracle.com>
parents:
23371
diff
changeset
|
434 SharedRuntime::throw_and_post_jvmti_exception(thread, symbol, klass->external_name()); |
23334
e0a15983ab51
Create exception throwing routines for exceptions with complex messages.
Roland Schatz <roland.schatz@oracle.com>
parents:
23329
diff
changeset
|
435 JRT_END |
e0a15983ab51
Create exception throwing routines for exceptions with complex messages.
Roland Schatz <roland.schatz@oracle.com>
parents:
23329
diff
changeset
|
436 |
23367
041534002323
Use strings instead of Symbol* for exception names (JDK-8155735).
Roland Schatz <roland.schatz@oracle.com>
parents:
23337
diff
changeset
|
437 JRT_ENTRY(void, JVMCIRuntime::throw_class_cast_exception(JavaThread* thread, const char* exception, Klass* caster_klass, Klass* target_klass)) |
23334
e0a15983ab51
Create exception throwing routines for exceptions with complex messages.
Roland Schatz <roland.schatz@oracle.com>
parents:
23329
diff
changeset
|
438 ResourceMark rm(thread); |
23337
62804a7d3877
Remove `desc` argument from JVMCIRuntime::throw_class_cast_exception.
Roland Schatz <roland.schatz@oracle.com>
parents:
23334
diff
changeset
|
439 const char* message = SharedRuntime::generate_class_cast_message(caster_klass->external_name(), target_klass->external_name()); |
23372
1c7bac3f1f20
Use CHECK instead of HAS_PENDING_EXCEPTION (JDK-8155735).
Roland Schatz <roland.schatz@oracle.com>
parents:
23371
diff
changeset
|
440 TempNewSymbol symbol = SymbolTable::new_symbol(exception, CHECK); |
1c7bac3f1f20
Use CHECK instead of HAS_PENDING_EXCEPTION (JDK-8155735).
Roland Schatz <roland.schatz@oracle.com>
parents:
23371
diff
changeset
|
441 SharedRuntime::throw_and_post_jvmti_exception(thread, symbol, message); |
23334
e0a15983ab51
Create exception throwing routines for exceptions with complex messages.
Roland Schatz <roland.schatz@oracle.com>
parents:
23329
diff
changeset
|
442 JRT_END |
e0a15983ab51
Create exception throwing routines for exceptions with complex messages.
Roland Schatz <roland.schatz@oracle.com>
parents:
23329
diff
changeset
|
443 |
22668
da5bdbf4a008
Simplify log_object interface
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22650
diff
changeset
|
444 JRT_LEAF(void, JVMCIRuntime::log_object(JavaThread* thread, oopDesc* obj, bool as_string, bool newline)) |
da5bdbf4a008
Simplify log_object interface
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22650
diff
changeset
|
445 ttyLocker ttyl; |
da5bdbf4a008
Simplify log_object interface
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22650
diff
changeset
|
446 |
da5bdbf4a008
Simplify log_object interface
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22650
diff
changeset
|
447 if (obj == NULL) { |
da5bdbf4a008
Simplify log_object interface
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22650
diff
changeset
|
448 tty->print("NULL"); |
da5bdbf4a008
Simplify log_object interface
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22650
diff
changeset
|
449 } else if (obj->is_oop_or_null(true) && (!as_string || !java_lang_String::is_instance(obj))) { |
da5bdbf4a008
Simplify log_object interface
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22650
diff
changeset
|
450 if (obj->is_oop_or_null(true)) { |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
451 char buf[O_BUFLEN]; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
452 tty->print("%s@" INTPTR_FORMAT, obj->klass()->name()->as_C_string(buf, O_BUFLEN), p2i(obj)); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
453 } else { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
454 tty->print(INTPTR_FORMAT, p2i(obj)); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
455 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
456 } else { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
457 ResourceMark rm; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
458 assert(obj != NULL && java_lang_String::is_instance(obj), "must be"); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
459 char *buf = java_lang_String::as_utf8_string(obj); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
460 tty->print_raw(buf); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
461 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
462 if (newline) { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
463 tty->cr(); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
464 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
465 JRT_END |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
466 |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
467 JRT_LEAF(void, JVMCIRuntime::write_barrier_pre(JavaThread* thread, oopDesc* obj)) |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
468 thread->satb_mark_queue().enqueue(obj); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
469 JRT_END |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
470 |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
471 JRT_LEAF(void, JVMCIRuntime::write_barrier_post(JavaThread* thread, void* card_addr)) |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
472 thread->dirty_card_queue().enqueue(card_addr); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
473 JRT_END |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
474 |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
475 JRT_LEAF(jboolean, JVMCIRuntime::validate_object(JavaThread* thread, oopDesc* parent, oopDesc* child)) |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
476 bool ret = true; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
477 if(!Universe::heap()->is_in_closed_subset(parent)) { |
22507
693e1df2b808
Add spaces around format macros
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22501
diff
changeset
|
478 tty->print_cr("Parent Object " INTPTR_FORMAT " not in heap", p2i(parent)); |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
479 parent->print(); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
480 ret=false; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
481 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
482 if(!Universe::heap()->is_in_closed_subset(child)) { |
22507
693e1df2b808
Add spaces around format macros
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22501
diff
changeset
|
483 tty->print_cr("Child Object " INTPTR_FORMAT " not in heap", p2i(child)); |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
484 child->print(); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
485 ret=false; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
486 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
487 return (jint)ret; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
488 JRT_END |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
489 |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
490 JRT_ENTRY(void, JVMCIRuntime::vm_error(JavaThread* thread, jlong where, jlong format, jlong value)) |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
491 ResourceMark rm; |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
492 const char *error_msg = where == 0L ? "<internal JVMCI error>" : (char*) (address) where; |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
493 char *detail_msg = NULL; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
494 if (format != 0L) { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
495 const char* buf = (char*) (address) format; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
496 size_t detail_msg_length = strlen(buf) * 2; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
497 detail_msg = (char *) NEW_RESOURCE_ARRAY(u_char, detail_msg_length); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
498 jio_snprintf(detail_msg, detail_msg_length, buf, value); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
499 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
500 report_vm_error(__FILE__, __LINE__, error_msg, detail_msg); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
501 JRT_END |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
502 |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
503 JRT_LEAF(oopDesc*, JVMCIRuntime::load_and_clear_exception(JavaThread* thread)) |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
504 oop exception = thread->exception_oop(); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
505 assert(exception != NULL, "npe"); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
506 thread->set_exception_oop(NULL); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
507 thread->set_exception_pc(0); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
508 return exception; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
509 JRT_END |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
510 |
22517
0915f5bfdfaa
Adopt some jvmci-9 source changes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22515
diff
changeset
|
511 PRAGMA_DIAG_PUSH |
0915f5bfdfaa
Adopt some jvmci-9 source changes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22515
diff
changeset
|
512 PRAGMA_FORMAT_NONLITERAL_IGNORED |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
513 JRT_LEAF(void, JVMCIRuntime::log_printf(JavaThread* thread, oopDesc* format, jlong v1, jlong v2, jlong v3)) |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
514 ResourceMark rm; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
515 assert(format != NULL && java_lang_String::is_instance(format), "must be"); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
516 char *buf = java_lang_String::as_utf8_string(format); |
22517
0915f5bfdfaa
Adopt some jvmci-9 source changes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22515
diff
changeset
|
517 tty->print((const char*)buf, v1, v2, v3); |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
518 JRT_END |
22517
0915f5bfdfaa
Adopt some jvmci-9 source changes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22515
diff
changeset
|
519 PRAGMA_DIAG_POP |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
520 |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
521 static void decipher(jlong v, bool ignoreZero) { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
522 if (v != 0 || !ignoreZero) { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
523 void* p = (void *)(address) v; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
524 CodeBlob* cb = CodeCache::find_blob(p); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
525 if (cb) { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
526 if (cb->is_nmethod()) { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
527 char buf[O_BUFLEN]; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
528 tty->print("%s [" INTPTR_FORMAT "+" JLONG_FORMAT "]", cb->as_nmethod_or_null()->method()->name_and_sig_as_C_string(buf, O_BUFLEN), p2i(cb->code_begin()), (jlong)((address)v - cb->code_begin())); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
529 return; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
530 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
531 cb->print_value_on(tty); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
532 return; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
533 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
534 if (Universe::heap()->is_in(p)) { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
535 oop obj = oop(p); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
536 obj->print_value_on(tty); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
537 return; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
538 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
539 tty->print(INTPTR_FORMAT " [long: " JLONG_FORMAT ", double %lf, char %c]",p2i((void *)v), (jlong)v, (jdouble)v, (char)v); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
540 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
541 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
542 |
22517
0915f5bfdfaa
Adopt some jvmci-9 source changes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22515
diff
changeset
|
543 PRAGMA_DIAG_PUSH |
0915f5bfdfaa
Adopt some jvmci-9 source changes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22515
diff
changeset
|
544 PRAGMA_FORMAT_NONLITERAL_IGNORED |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
545 JRT_LEAF(void, JVMCIRuntime::vm_message(jboolean vmError, jlong format, jlong v1, jlong v2, jlong v3)) |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
546 ResourceMark rm; |
22517
0915f5bfdfaa
Adopt some jvmci-9 source changes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22515
diff
changeset
|
547 const char *buf = (const char*) (address) format; |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
548 if (vmError) { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
549 if (buf != NULL) { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
550 fatal(err_msg(buf, v1, v2, v3)); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
551 } else { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
552 fatal("<anonymous error>"); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
553 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
554 } else if (buf != NULL) { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
555 tty->print(buf, v1, v2, v3); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
556 } else { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
557 assert(v2 == 0, "v2 != 0"); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
558 assert(v3 == 0, "v3 != 0"); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
559 decipher(v1, false); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
560 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
561 JRT_END |
22517
0915f5bfdfaa
Adopt some jvmci-9 source changes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22515
diff
changeset
|
562 PRAGMA_DIAG_POP |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
563 |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
564 JRT_LEAF(void, JVMCIRuntime::log_primitive(JavaThread* thread, jchar typeChar, jlong value, jboolean newline)) |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
565 union { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
566 jlong l; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
567 jdouble d; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
568 jfloat f; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
569 } uu; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
570 uu.l = value; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
571 switch (typeChar) { |
23393
1d4ce2d19e52
clean up and minimize JVMCI (JDK-8156835)
Doug Simon <doug.simon@oracle.com>
parents:
23392
diff
changeset
|
572 case 'Z': tty->print(value == 0 ? "false" : "true"); break; |
1d4ce2d19e52
clean up and minimize JVMCI (JDK-8156835)
Doug Simon <doug.simon@oracle.com>
parents:
23392
diff
changeset
|
573 case 'B': tty->print("%d", (jbyte) value); break; |
1d4ce2d19e52
clean up and minimize JVMCI (JDK-8156835)
Doug Simon <doug.simon@oracle.com>
parents:
23392
diff
changeset
|
574 case 'C': tty->print("%c", (jchar) value); break; |
1d4ce2d19e52
clean up and minimize JVMCI (JDK-8156835)
Doug Simon <doug.simon@oracle.com>
parents:
23392
diff
changeset
|
575 case 'S': tty->print("%d", (jshort) value); break; |
1d4ce2d19e52
clean up and minimize JVMCI (JDK-8156835)
Doug Simon <doug.simon@oracle.com>
parents:
23392
diff
changeset
|
576 case 'I': tty->print("%d", (jint) value); break; |
1d4ce2d19e52
clean up and minimize JVMCI (JDK-8156835)
Doug Simon <doug.simon@oracle.com>
parents:
23392
diff
changeset
|
577 case 'F': tty->print("%f", uu.f); break; |
1d4ce2d19e52
clean up and minimize JVMCI (JDK-8156835)
Doug Simon <doug.simon@oracle.com>
parents:
23392
diff
changeset
|
578 case 'J': tty->print(JLONG_FORMAT, value); break; |
1d4ce2d19e52
clean up and minimize JVMCI (JDK-8156835)
Doug Simon <doug.simon@oracle.com>
parents:
23392
diff
changeset
|
579 case 'D': tty->print("%lf", uu.d); break; |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
580 default: assert(false, "unknown typeChar"); break; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
581 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
582 if (newline) { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
583 tty->cr(); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
584 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
585 JRT_END |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
586 |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
587 JRT_ENTRY(jint, JVMCIRuntime::identity_hash_code(JavaThread* thread, oopDesc* obj)) |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
588 return (jint) obj->identity_hash(); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
589 JRT_END |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
590 |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
591 JRT_ENTRY(jboolean, JVMCIRuntime::thread_is_interrupted(JavaThread* thread, oopDesc* receiver, jboolean clear_interrupted)) |
21207
93dc70e47fb0
documented why THREAD_IS_INTERRUPTED foreign call is NOT_LEAF
Doug Simon <doug.simon@oracle.com>
parents:
21123
diff
changeset
|
592 // Ensure that the C++ Thread and OSThread structures aren't freed before we operate. |
93dc70e47fb0
documented why THREAD_IS_INTERRUPTED foreign call is NOT_LEAF
Doug Simon <doug.simon@oracle.com>
parents:
21123
diff
changeset
|
593 // This locking requires thread_in_vm which is why this method cannot be JRT_LEAF. |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
594 Handle receiverHandle(thread, receiver); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
595 MutexLockerEx ml(thread->threadObj() == (void*)receiver ? NULL : Threads_lock); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
596 JavaThread* receiverThread = java_lang_Thread::thread(receiverHandle()); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
597 if (receiverThread == NULL) { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
598 // The other thread may exit during this process, which is ok so return false. |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
599 return JNI_FALSE; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
600 } else { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
601 return (jint) Thread::is_interrupted(receiverThread, clear_interrupted != 0); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
602 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
603 JRT_END |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
604 |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
605 JRT_ENTRY(jint, JVMCIRuntime::test_deoptimize_call_int(JavaThread* thread, int value)) |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
606 deopt_caller(); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
607 return value; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
608 JRT_END |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
609 |
22398
4f6caa445b92
moved JVMCI option parsing back into Java
Doug Simon <doug.simon@oracle.com>
parents:
22054
diff
changeset
|
610 // private static void JVMCIClassLoaderFactory.init(ClassLoader loader) |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
611 JVM_ENTRY(void, JVM_InitJVMCIClassLoader(JNIEnv *env, jclass c, jobject loader_handle)) |
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
612 SystemDictionary::init_jvmci_loader(JNIHandles::resolve(loader_handle)); |
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
613 SystemDictionary::WKID scan = SystemDictionary::FIRST_JVMCI_WKID; |
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
614 SystemDictionary::initialize_wk_klasses_through(SystemDictionary::LAST_JVMCI_WKID, scan, CHECK); |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
615 JVM_END |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
616 |
21527
07b088d61d5d
added HotSpotJVMCIRuntime* classes, replaced references to HotSpotGraalRuntime in VM with HotSpotJVMCIRuntime (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21526
diff
changeset
|
617 // private static JVMCIRuntime JVMCI.initializeRuntime() |
07b088d61d5d
added HotSpotJVMCIRuntime* classes, replaced references to HotSpotGraalRuntime in VM with HotSpotJVMCIRuntime (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21526
diff
changeset
|
618 JVM_ENTRY(jobject, JVM_GetJVMCIRuntime(JNIEnv *env, jclass c)) |
23408
f84a5ac3be22
make JVMCI JDK immutable and sharable among different JVMCI clients
Doug Simon <doug.simon@oracle.com>
parents:
23404
diff
changeset
|
619 if (!EnableJVMCI) { |
f84a5ac3be22
make JVMCI JDK immutable and sharable among different JVMCI clients
Doug Simon <doug.simon@oracle.com>
parents:
23404
diff
changeset
|
620 THROW_MSG_NULL(vmSymbols::java_lang_InternalError(), "JVMCI is not enabled") |
f84a5ac3be22
make JVMCI JDK immutable and sharable among different JVMCI clients
Doug Simon <doug.simon@oracle.com>
parents:
23404
diff
changeset
|
621 } |
22574
5a706439be63
Propagate exceptions up instead of aborting
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22553
diff
changeset
|
622 JVMCIRuntime::initialize_HotSpotJVMCIRuntime(CHECK_NULL); |
5a706439be63
Propagate exceptions up instead of aborting
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22553
diff
changeset
|
623 return JVMCIRuntime::get_HotSpotJVMCIRuntime_jobject(CHECK_NULL); |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
624 JVM_END |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
625 |
23408
f84a5ac3be22
make JVMCI JDK immutable and sharable among different JVMCI clients
Doug Simon <doug.simon@oracle.com>
parents:
23404
diff
changeset
|
626 // private static ClassLoader Services.getJVMCIClassLoader() |
f84a5ac3be22
make JVMCI JDK immutable and sharable among different JVMCI clients
Doug Simon <doug.simon@oracle.com>
parents:
23404
diff
changeset
|
627 JVM_ENTRY(jobject, JVM_GetJVMCIClassLoader(JNIEnv *env, jclass c)) |
f84a5ac3be22
make JVMCI JDK immutable and sharable among different JVMCI clients
Doug Simon <doug.simon@oracle.com>
parents:
23404
diff
changeset
|
628 if (!EnableJVMCI) { |
23692
93be30973b26
don't crash if Services is used but -XX:-EnableJVMCI - just return null
Doug Simon <doug.simon@oracle.com>
parents:
23677
diff
changeset
|
629 // This message must not change - it is used by the Java code to |
93be30973b26
don't crash if Services is used but -XX:-EnableJVMCI - just return null
Doug Simon <doug.simon@oracle.com>
parents:
23677
diff
changeset
|
630 // distinguish an InternalError due to -EnableJVMCI from other |
93be30973b26
don't crash if Services is used but -XX:-EnableJVMCI - just return null
Doug Simon <doug.simon@oracle.com>
parents:
23677
diff
changeset
|
631 // InternalErrors that may be raised below. |
23408
f84a5ac3be22
make JVMCI JDK immutable and sharable among different JVMCI clients
Doug Simon <doug.simon@oracle.com>
parents:
23404
diff
changeset
|
632 THROW_MSG_NULL(vmSymbols::java_lang_InternalError(), "JVMCI is not enabled") |
f84a5ac3be22
make JVMCI JDK immutable and sharable among different JVMCI clients
Doug Simon <doug.simon@oracle.com>
parents:
23404
diff
changeset
|
633 } |
22416
8abc6030cf1c
ensure JVMCI class loader is initialized before attempting to load service provider
Andreas Woess <andreas.woess@oracle.com>
parents:
22401
diff
changeset
|
634 JVMCIRuntime::ensure_jvmci_class_loader_is_initialized(); |
23408
f84a5ac3be22
make JVMCI JDK immutable and sharable among different JVMCI clients
Doug Simon <doug.simon@oracle.com>
parents:
23404
diff
changeset
|
635 return JNIHandles::make_local(THREAD, SystemDictionary::jvmci_loader()); |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
636 JVM_END |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
637 |
22574
5a706439be63
Propagate exceptions up instead of aborting
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22553
diff
changeset
|
638 Handle JVMCIRuntime::callStatic(const char* className, const char* methodName, const char* signature, JavaCallArguments* args, TRAPS) { |
5a706439be63
Propagate exceptions up instead of aborting
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22553
diff
changeset
|
639 TempNewSymbol name = SymbolTable::new_symbol(className, CHECK_(Handle())); |
23751
b1b5c71c04b7
replace use of vm_abort with vm_exit
Doug Simon <doug.simon@oracle.com>
parents:
23745
diff
changeset
|
640 KlassHandle klass = resolve_or_fail(name, CHECK_(Handle())); |
22574
5a706439be63
Propagate exceptions up instead of aborting
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22553
diff
changeset
|
641 TempNewSymbol runtime = SymbolTable::new_symbol(methodName, CHECK_(Handle())); |
5a706439be63
Propagate exceptions up instead of aborting
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22553
diff
changeset
|
642 TempNewSymbol sig = SymbolTable::new_symbol(signature, CHECK_(Handle())); |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
643 JavaValue result(T_OBJECT); |
22398
4f6caa445b92
moved JVMCI option parsing back into Java
Doug Simon <doug.simon@oracle.com>
parents:
22054
diff
changeset
|
644 if (args == NULL) { |
22574
5a706439be63
Propagate exceptions up instead of aborting
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22553
diff
changeset
|
645 JavaCalls::call_static(&result, klass, runtime, sig, CHECK_(Handle())); |
22398
4f6caa445b92
moved JVMCI option parsing back into Java
Doug Simon <doug.simon@oracle.com>
parents:
22054
diff
changeset
|
646 } else { |
22574
5a706439be63
Propagate exceptions up instead of aborting
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22553
diff
changeset
|
647 JavaCalls::call_static(&result, klass, runtime, sig, args, CHECK_(Handle())); |
22398
4f6caa445b92
moved JVMCI option parsing back into Java
Doug Simon <doug.simon@oracle.com>
parents:
22054
diff
changeset
|
648 } |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
649 return Handle((oop)result.get_jobject()); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
650 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
651 |
22574
5a706439be63
Propagate exceptions up instead of aborting
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22553
diff
changeset
|
652 void JVMCIRuntime::initialize_HotSpotJVMCIRuntime(TRAPS) { |
23784
19222d463306
JVMCI re-initialization check is in the wrong location (JDK-8167353)
Doug Simon <doug.simon@oracle.com>
parents:
23751
diff
changeset
|
653 guarantee(!_HotSpotJVMCIRuntime_initialized, "cannot reinitialize HotSpotJVMCIRuntime"); |
19222d463306
JVMCI re-initialization check is in the wrong location (JDK-8167353)
Doug Simon <doug.simon@oracle.com>
parents:
23751
diff
changeset
|
654 JVMCIRuntime::ensure_jvmci_class_loader_is_initialized(); |
19222d463306
JVMCI re-initialization check is in the wrong location (JDK-8167353)
Doug Simon <doug.simon@oracle.com>
parents:
23751
diff
changeset
|
655 // This should only be called in the context of the JVMCI class being initialized |
19222d463306
JVMCI re-initialization check is in the wrong location (JDK-8167353)
Doug Simon <doug.simon@oracle.com>
parents:
23751
diff
changeset
|
656 instanceKlassHandle klass = InstanceKlass::cast(SystemDictionary::JVMCI_klass()); |
19222d463306
JVMCI re-initialization check is in the wrong location (JDK-8167353)
Doug Simon <doug.simon@oracle.com>
parents:
23751
diff
changeset
|
657 guarantee(klass->is_being_initialized() && klass->is_reentrant_initialization(THREAD), |
19222d463306
JVMCI re-initialization check is in the wrong location (JDK-8167353)
Doug Simon <doug.simon@oracle.com>
parents:
23751
diff
changeset
|
658 "HotSpotJVMCIRuntime initialization should only be triggered through JVMCI initialization"); |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
659 |
23784
19222d463306
JVMCI re-initialization check is in the wrong location (JDK-8167353)
Doug Simon <doug.simon@oracle.com>
parents:
23751
diff
changeset
|
660 Handle result = callStatic("jdk/vm/ci/hotspot/HotSpotJVMCIRuntime", |
19222d463306
JVMCI re-initialization check is in the wrong location (JDK-8167353)
Doug Simon <doug.simon@oracle.com>
parents:
23751
diff
changeset
|
661 "runtime", |
19222d463306
JVMCI re-initialization check is in the wrong location (JDK-8167353)
Doug Simon <doug.simon@oracle.com>
parents:
23751
diff
changeset
|
662 "()Ljdk/vm/ci/hotspot/HotSpotJVMCIRuntime;", NULL, CHECK); |
19222d463306
JVMCI re-initialization check is in the wrong location (JDK-8167353)
Doug Simon <doug.simon@oracle.com>
parents:
23751
diff
changeset
|
663 objArrayOop trivial_prefixes = HotSpotJVMCIRuntime::trivialPrefixes(result); |
19222d463306
JVMCI re-initialization check is in the wrong location (JDK-8167353)
Doug Simon <doug.simon@oracle.com>
parents:
23751
diff
changeset
|
664 if (trivial_prefixes != NULL) { |
19222d463306
JVMCI re-initialization check is in the wrong location (JDK-8167353)
Doug Simon <doug.simon@oracle.com>
parents:
23751
diff
changeset
|
665 char** prefixes = NEW_C_HEAP_ARRAY(char*, trivial_prefixes->length(), mtCompiler); |
19222d463306
JVMCI re-initialization check is in the wrong location (JDK-8167353)
Doug Simon <doug.simon@oracle.com>
parents:
23751
diff
changeset
|
666 for (int i = 0; i < trivial_prefixes->length(); i++) { |
19222d463306
JVMCI re-initialization check is in the wrong location (JDK-8167353)
Doug Simon <doug.simon@oracle.com>
parents:
23751
diff
changeset
|
667 oop str = trivial_prefixes->obj_at(i); |
19222d463306
JVMCI re-initialization check is in the wrong location (JDK-8167353)
Doug Simon <doug.simon@oracle.com>
parents:
23751
diff
changeset
|
668 if (str == NULL) { |
19222d463306
JVMCI re-initialization check is in the wrong location (JDK-8167353)
Doug Simon <doug.simon@oracle.com>
parents:
23751
diff
changeset
|
669 THROW(vmSymbols::java_lang_NullPointerException()); |
19222d463306
JVMCI re-initialization check is in the wrong location (JDK-8167353)
Doug Simon <doug.simon@oracle.com>
parents:
23751
diff
changeset
|
670 } else { |
19222d463306
JVMCI re-initialization check is in the wrong location (JDK-8167353)
Doug Simon <doug.simon@oracle.com>
parents:
23751
diff
changeset
|
671 prefixes[i] = strdup(java_lang_String::as_utf8_string(str)); |
22575
569c82ebb96e
Replace JVMCICompileWithC1Only with package based controls
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22574
diff
changeset
|
672 } |
569c82ebb96e
Replace JVMCICompileWithC1Only with package based controls
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22574
diff
changeset
|
673 } |
23784
19222d463306
JVMCI re-initialization check is in the wrong location (JDK-8167353)
Doug Simon <doug.simon@oracle.com>
parents:
23751
diff
changeset
|
674 _trivial_prefixes = prefixes; |
19222d463306
JVMCI re-initialization check is in the wrong location (JDK-8167353)
Doug Simon <doug.simon@oracle.com>
parents:
23751
diff
changeset
|
675 _trivial_prefixes_count = trivial_prefixes->length(); |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
676 } |
23784
19222d463306
JVMCI re-initialization check is in the wrong location (JDK-8167353)
Doug Simon <doug.simon@oracle.com>
parents:
23751
diff
changeset
|
677 int adjustment = HotSpotJVMCIRuntime::compilationLevelAdjustment(result); |
19222d463306
JVMCI re-initialization check is in the wrong location (JDK-8167353)
Doug Simon <doug.simon@oracle.com>
parents:
23751
diff
changeset
|
678 assert(adjustment >= JVMCIRuntime::none && |
19222d463306
JVMCI re-initialization check is in the wrong location (JDK-8167353)
Doug Simon <doug.simon@oracle.com>
parents:
23751
diff
changeset
|
679 adjustment <= JVMCIRuntime::by_full_signature, |
19222d463306
JVMCI re-initialization check is in the wrong location (JDK-8167353)
Doug Simon <doug.simon@oracle.com>
parents:
23751
diff
changeset
|
680 "compilation level adjustment out of bounds"); |
19222d463306
JVMCI re-initialization check is in the wrong location (JDK-8167353)
Doug Simon <doug.simon@oracle.com>
parents:
23751
diff
changeset
|
681 _comp_level_adjustment = (CompLevelAdjustment) adjustment; |
19222d463306
JVMCI re-initialization check is in the wrong location (JDK-8167353)
Doug Simon <doug.simon@oracle.com>
parents:
23751
diff
changeset
|
682 _HotSpotJVMCIRuntime_initialized = true; |
19222d463306
JVMCI re-initialization check is in the wrong location (JDK-8167353)
Doug Simon <doug.simon@oracle.com>
parents:
23751
diff
changeset
|
683 _HotSpotJVMCIRuntime_instance = JNIHandles::make_global(result()); |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
684 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
685 |
22574
5a706439be63
Propagate exceptions up instead of aborting
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22553
diff
changeset
|
686 void JVMCIRuntime::initialize_JVMCI(TRAPS) { |
21527
07b088d61d5d
added HotSpotJVMCIRuntime* classes, replaced references to HotSpotGraalRuntime in VM with HotSpotJVMCIRuntime (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21526
diff
changeset
|
687 if (JNIHandles::resolve(_HotSpotJVMCIRuntime_instance) == NULL) { |
22672
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22668
diff
changeset
|
688 callStatic("jdk/vm/ci/runtime/JVMCI", |
22461
07d9f0909560
Rename callInitializer to callStatic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22454
diff
changeset
|
689 "getRuntime", |
22672
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22668
diff
changeset
|
690 "()Ljdk/vm/ci/runtime/JVMCIRuntime;", NULL, CHECK); |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
691 } |
21527
07b088d61d5d
added HotSpotJVMCIRuntime* classes, replaced references to HotSpotGraalRuntime in VM with HotSpotJVMCIRuntime (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21526
diff
changeset
|
692 assert(_HotSpotJVMCIRuntime_initialized == true, "what?"); |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
693 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
694 |
22454
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
695 void JVMCIRuntime::metadata_do(void f(Metadata*)) { |
22543
97ca867d3622
Fix assertion failure in JVMCIRuntime::metadata_do
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22538
diff
changeset
|
696 // For simplicity, the existence of HotSpotJVMCIMetaAccessContext in |
97ca867d3622
Fix assertion failure in JVMCIRuntime::metadata_do
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22538
diff
changeset
|
697 // the SystemDictionary well known classes should ensure the other |
97ca867d3622
Fix assertion failure in JVMCIRuntime::metadata_do
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22538
diff
changeset
|
698 // classes have already been loaded, so make sure their order in the |
97ca867d3622
Fix assertion failure in JVMCIRuntime::metadata_do
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22538
diff
changeset
|
699 // table enforces that. |
22672
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22668
diff
changeset
|
700 assert(SystemDictionary::WK_KLASS_ENUM_NAME(jdk_vm_ci_hotspot_HotSpotResolvedJavaMethodImpl) < |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22668
diff
changeset
|
701 SystemDictionary::WK_KLASS_ENUM_NAME(jdk_vm_ci_hotspot_HotSpotJVMCIMetaAccessContext), "must be loaded earlier"); |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22668
diff
changeset
|
702 assert(SystemDictionary::WK_KLASS_ENUM_NAME(jdk_vm_ci_hotspot_HotSpotConstantPool) < |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22668
diff
changeset
|
703 SystemDictionary::WK_KLASS_ENUM_NAME(jdk_vm_ci_hotspot_HotSpotJVMCIMetaAccessContext), "must be loaded earlier"); |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22668
diff
changeset
|
704 assert(SystemDictionary::WK_KLASS_ENUM_NAME(jdk_vm_ci_hotspot_HotSpotResolvedObjectTypeImpl) < |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22668
diff
changeset
|
705 SystemDictionary::WK_KLASS_ENUM_NAME(jdk_vm_ci_hotspot_HotSpotJVMCIMetaAccessContext), "must be loaded earlier"); |
22543
97ca867d3622
Fix assertion failure in JVMCIRuntime::metadata_do
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22538
diff
changeset
|
706 |
97ca867d3622
Fix assertion failure in JVMCIRuntime::metadata_do
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22538
diff
changeset
|
707 if (HotSpotJVMCIMetaAccessContext::klass() == NULL || |
97ca867d3622
Fix assertion failure in JVMCIRuntime::metadata_do
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22538
diff
changeset
|
708 !HotSpotJVMCIMetaAccessContext::klass()->is_linked()) { |
97ca867d3622
Fix assertion failure in JVMCIRuntime::metadata_do
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22538
diff
changeset
|
709 // Nothing could be registered yet |
22464
3fb432661d59
make JVMCIRuntime::metadata_do return immediately if HotSpotJVMCIMetaAccessContext has not yet been loaded
Doug Simon <doug.simon@oracle.com>
parents:
22461
diff
changeset
|
710 return; |
3fb432661d59
make JVMCIRuntime::metadata_do return immediately if HotSpotJVMCIMetaAccessContext has not yet been loaded
Doug Simon <doug.simon@oracle.com>
parents:
22461
diff
changeset
|
711 } |
22515
feb4131657bb
JVMCIRuntime::metadata_do shouldn't run until HotSpotJVMCIRuntime is initialized
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22511
diff
changeset
|
712 |
22454
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
713 // WeakReference<HotSpotJVMCIMetaAccessContext>[] |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
714 objArrayOop allContexts = HotSpotJVMCIMetaAccessContext::allContexts(); |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
715 if (allContexts == NULL) { |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
716 return; |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
717 } |
22543
97ca867d3622
Fix assertion failure in JVMCIRuntime::metadata_do
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22538
diff
changeset
|
718 |
97ca867d3622
Fix assertion failure in JVMCIRuntime::metadata_do
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22538
diff
changeset
|
719 // These must be loaded at this point but the linking state doesn't matter. |
97ca867d3622
Fix assertion failure in JVMCIRuntime::metadata_do
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22538
diff
changeset
|
720 assert(SystemDictionary::HotSpotResolvedJavaMethodImpl_klass() != NULL, "must be loaded"); |
97ca867d3622
Fix assertion failure in JVMCIRuntime::metadata_do
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22538
diff
changeset
|
721 assert(SystemDictionary::HotSpotConstantPool_klass() != NULL, "must be loaded"); |
97ca867d3622
Fix assertion failure in JVMCIRuntime::metadata_do
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22538
diff
changeset
|
722 assert(SystemDictionary::HotSpotResolvedObjectTypeImpl_klass() != NULL, "must be loaded"); |
22650
939d5da65929
reduced delta against jvmci-9
Doug Simon <doug.simon@oracle.com>
parents:
22637
diff
changeset
|
723 |
22454
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
724 for (int i = 0; i < allContexts->length(); i++) { |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
725 oop ref = allContexts->obj_at(i); |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
726 if (ref != NULL) { |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
727 oop referent = java_lang_ref_Reference::referent(ref); |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
728 if (referent != NULL) { |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
729 // Chunked Object[] with last element pointing to next chunk |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
730 objArrayOop metadataRoots = HotSpotJVMCIMetaAccessContext::metadataRoots(referent); |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
731 while (metadataRoots != NULL) { |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
732 for (int typeIndex = 0; typeIndex < metadataRoots->length() - 1; typeIndex++) { |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
733 oop reference = metadataRoots->obj_at(typeIndex); |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
734 if (reference == NULL) { |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
735 continue; |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
736 } |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
737 oop metadataRoot = java_lang_ref_Reference::referent(reference); |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
738 if (metadataRoot == NULL) { |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
739 continue; |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
740 } |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
741 if (metadataRoot->is_a(SystemDictionary::HotSpotResolvedJavaMethodImpl_klass())) { |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
742 Method* method = CompilerToVM::asMethod(metadataRoot); |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
743 f(method); |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
744 } else if (metadataRoot->is_a(SystemDictionary::HotSpotConstantPool_klass())) { |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
745 ConstantPool* constantPool = CompilerToVM::asConstantPool(metadataRoot); |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
746 f(constantPool); |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
747 } else if (metadataRoot->is_a(SystemDictionary::HotSpotResolvedObjectTypeImpl_klass())) { |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
748 Klass* klass = CompilerToVM::asKlass(metadataRoot); |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
749 f(klass); |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
750 } else { |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
751 metadataRoot->print(); |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
752 ShouldNotReachHere(); |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
753 } |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
754 } |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
755 metadataRoots = (objArrayOop)metadataRoots->obj_at(metadataRoots->length() - 1); |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
756 assert(metadataRoots == NULL || metadataRoots->is_objArray(), "wrong type"); |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
757 } |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
758 } |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
759 } |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
760 } |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
761 } |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22447
diff
changeset
|
762 |
22650
939d5da65929
reduced delta against jvmci-9
Doug Simon <doug.simon@oracle.com>
parents:
22637
diff
changeset
|
763 // private static void CompilerToVM.registerNatives() |
939d5da65929
reduced delta against jvmci-9
Doug Simon <doug.simon@oracle.com>
parents:
22637
diff
changeset
|
764 JVM_ENTRY(void, JVM_RegisterJVMCINatives(JNIEnv *env, jclass c2vmClass)) |
23408
f84a5ac3be22
make JVMCI JDK immutable and sharable among different JVMCI clients
Doug Simon <doug.simon@oracle.com>
parents:
23404
diff
changeset
|
765 if (!EnableJVMCI) { |
f84a5ac3be22
make JVMCI JDK immutable and sharable among different JVMCI clients
Doug Simon <doug.simon@oracle.com>
parents:
23404
diff
changeset
|
766 THROW_MSG(vmSymbols::java_lang_InternalError(), "JVMCI is not enabled"); |
f84a5ac3be22
make JVMCI JDK immutable and sharable among different JVMCI clients
Doug Simon <doug.simon@oracle.com>
parents:
23404
diff
changeset
|
767 } |
f84a5ac3be22
make JVMCI JDK immutable and sharable among different JVMCI clients
Doug Simon <doug.simon@oracle.com>
parents:
23404
diff
changeset
|
768 |
22650
939d5da65929
reduced delta against jvmci-9
Doug Simon <doug.simon@oracle.com>
parents:
22637
diff
changeset
|
769 #ifdef _LP64 |
939d5da65929
reduced delta against jvmci-9
Doug Simon <doug.simon@oracle.com>
parents:
22637
diff
changeset
|
770 #ifndef TARGET_ARCH_sparc |
939d5da65929
reduced delta against jvmci-9
Doug Simon <doug.simon@oracle.com>
parents:
22637
diff
changeset
|
771 uintptr_t heap_end = (uintptr_t) Universe::heap()->reserved_region().end(); |
939d5da65929
reduced delta against jvmci-9
Doug Simon <doug.simon@oracle.com>
parents:
22637
diff
changeset
|
772 uintptr_t allocation_end = heap_end + ((uintptr_t)16) * 1024 * 1024 * 1024; |
939d5da65929
reduced delta against jvmci-9
Doug Simon <doug.simon@oracle.com>
parents:
22637
diff
changeset
|
773 guarantee(heap_end < allocation_end, "heap end too close to end of address space (might lead to erroneous TLAB allocations)"); |
939d5da65929
reduced delta against jvmci-9
Doug Simon <doug.simon@oracle.com>
parents:
22637
diff
changeset
|
774 #endif // TARGET_ARCH_sparc |
939d5da65929
reduced delta against jvmci-9
Doug Simon <doug.simon@oracle.com>
parents:
22637
diff
changeset
|
775 #else |
939d5da65929
reduced delta against jvmci-9
Doug Simon <doug.simon@oracle.com>
parents:
22637
diff
changeset
|
776 fatal("check TLAB allocation code for address space conflicts"); |
939d5da65929
reduced delta against jvmci-9
Doug Simon <doug.simon@oracle.com>
parents:
22637
diff
changeset
|
777 #endif |
939d5da65929
reduced delta against jvmci-9
Doug Simon <doug.simon@oracle.com>
parents:
22637
diff
changeset
|
778 |
939d5da65929
reduced delta against jvmci-9
Doug Simon <doug.simon@oracle.com>
parents:
22637
diff
changeset
|
779 JVMCIRuntime::ensure_jvmci_class_loader_is_initialized(); |
939d5da65929
reduced delta against jvmci-9
Doug Simon <doug.simon@oracle.com>
parents:
22637
diff
changeset
|
780 |
939d5da65929
reduced delta against jvmci-9
Doug Simon <doug.simon@oracle.com>
parents:
22637
diff
changeset
|
781 { |
939d5da65929
reduced delta against jvmci-9
Doug Simon <doug.simon@oracle.com>
parents:
22637
diff
changeset
|
782 ThreadToNativeFromVM trans(thread); |
939d5da65929
reduced delta against jvmci-9
Doug Simon <doug.simon@oracle.com>
parents:
22637
diff
changeset
|
783 |
939d5da65929
reduced delta against jvmci-9
Doug Simon <doug.simon@oracle.com>
parents:
22637
diff
changeset
|
784 ResourceMark rm; |
939d5da65929
reduced delta against jvmci-9
Doug Simon <doug.simon@oracle.com>
parents:
22637
diff
changeset
|
785 HandleMark hm; |
939d5da65929
reduced delta against jvmci-9
Doug Simon <doug.simon@oracle.com>
parents:
22637
diff
changeset
|
786 |
939d5da65929
reduced delta against jvmci-9
Doug Simon <doug.simon@oracle.com>
parents:
22637
diff
changeset
|
787 // Ensure _non_oop_bits is initialized |
939d5da65929
reduced delta against jvmci-9
Doug Simon <doug.simon@oracle.com>
parents:
22637
diff
changeset
|
788 Universe::non_oop_word(); |
939d5da65929
reduced delta against jvmci-9
Doug Simon <doug.simon@oracle.com>
parents:
22637
diff
changeset
|
789 |
939d5da65929
reduced delta against jvmci-9
Doug Simon <doug.simon@oracle.com>
parents:
22637
diff
changeset
|
790 env->RegisterNatives(c2vmClass, CompilerToVM::methods, CompilerToVM::methods_count()); |
939d5da65929
reduced delta against jvmci-9
Doug Simon <doug.simon@oracle.com>
parents:
22637
diff
changeset
|
791 } |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
792 JVM_END |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
793 |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
794 void JVMCIRuntime::ensure_jvmci_class_loader_is_initialized() { |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
795 // This initialization code is guarded by a static pointer to the Factory class. |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
796 // Once it is non-null, the JVMCI class loader and well known JVMCI classes are |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
797 // guaranteed to have been initialized. By going through the static |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
798 // initializer of Factory, we can rely on class initialization semantics to |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
799 // synchronize threads racing to do the initialization. |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
800 static Klass* _FactoryKlass = NULL; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
801 if (_FactoryKlass == NULL) { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
802 Thread* THREAD = Thread::current(); |
23751
b1b5c71c04b7
replace use of vm_abort with vm_exit
Doug Simon <doug.simon@oracle.com>
parents:
23745
diff
changeset
|
803 TempNewSymbol name = SymbolTable::new_symbol("jdk/vm/ci/services/JVMCIClassLoaderFactory", CHECK_EXIT); |
b1b5c71c04b7
replace use of vm_abort with vm_exit
Doug Simon <doug.simon@oracle.com>
parents:
23745
diff
changeset
|
804 KlassHandle klass = SystemDictionary::resolve_or_fail(name, true, CHECK_EXIT); |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
805 |
22551
71ea8d7db665
removed author tags in comments
Doug Simon <doug.simon@oracle.com>
parents:
22548
diff
changeset
|
806 // We cannot use jvmciJavaClasses for this because we are currently in the |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
807 // process of initializing that mechanism. |
23751
b1b5c71c04b7
replace use of vm_abort with vm_exit
Doug Simon <doug.simon@oracle.com>
parents:
23745
diff
changeset
|
808 TempNewSymbol field_name = SymbolTable::new_symbol("useJVMCIClassLoader", CHECK_EXIT); |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
809 fieldDescriptor field_desc; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
810 if (klass->find_field(field_name, vmSymbols::bool_signature(), &field_desc) == NULL) { |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
811 ResourceMark rm; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
812 fatal(err_msg("Invalid layout of %s at %s", field_name->as_C_string(), klass->external_name())); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
813 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
814 |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
815 InstanceKlass* ik = InstanceKlass::cast(klass()); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
816 address addr = ik->static_field_addr(field_desc.offset() - InstanceMirrorKlass::offset_of_static_fields()); |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
817 *((jboolean *) addr) = (jboolean) UseJVMCIClassLoader; |
23751
b1b5c71c04b7
replace use of vm_abort with vm_exit
Doug Simon <doug.simon@oracle.com>
parents:
23745
diff
changeset
|
818 klass->initialize(CHECK_EXIT); |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
819 _FactoryKlass = klass(); |
21562 | 820 assert(!UseJVMCIClassLoader || SystemDictionary::jvmci_loader() != NULL, "JVMCI classloader should have been initialized"); |
23296
f41d4011035d
reduced delta against jvmci-9
Doug Simon <doug.simon@oracle.com>
parents:
22761
diff
changeset
|
821 |
f41d4011035d
reduced delta against jvmci-9
Doug Simon <doug.simon@oracle.com>
parents:
22761
diff
changeset
|
822 JVMCIJavaClasses::compute_offsets(THREAD); |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
823 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
824 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
825 |
23408
f84a5ac3be22
make JVMCI JDK immutable and sharable among different JVMCI clients
Doug Simon <doug.simon@oracle.com>
parents:
23404
diff
changeset
|
826 void JVMCIRuntime::shutdown(TRAPS) { |
21527
07b088d61d5d
added HotSpotJVMCIRuntime* classes, replaced references to HotSpotGraalRuntime in VM with HotSpotJVMCIRuntime (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21526
diff
changeset
|
827 if (_HotSpotJVMCIRuntime_instance != NULL) { |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
828 _shutdown_called = true; |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
829 HandleMark hm(THREAD); |
23408
f84a5ac3be22
make JVMCI JDK immutable and sharable among different JVMCI clients
Doug Simon <doug.simon@oracle.com>
parents:
23404
diff
changeset
|
830 Handle receiver = get_HotSpotJVMCIRuntime(CHECK); |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
831 JavaValue result(T_VOID); |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
832 JavaCallArguments args; |
21616
4c146c9367b6
recast VM compilation request via JVMCI to be a HotSpot JVMCI event, removing the last direct reference to a Graal class in the VM (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21614
diff
changeset
|
833 args.push_oop(receiver); |
23408
f84a5ac3be22
make JVMCI JDK immutable and sharable among different JVMCI clients
Doug Simon <doug.simon@oracle.com>
parents:
23404
diff
changeset
|
834 JavaCalls::call_special(&result, receiver->klass(), vmSymbols::shutdown_method_name(), vmSymbols::void_method_signature(), &args, CHECK); |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
835 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
836 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
837 |
23385 | 838 void JVMCIRuntime::bootstrap_finished(TRAPS) { |
23383
0226d6bcb0d2
Notify the compiler on completion of a bootstrap (JDK-8156034)
Josef Eisl <josef.eisl@jku.at>
parents:
23379
diff
changeset
|
839 if (_HotSpotJVMCIRuntime_instance != NULL) { |
0226d6bcb0d2
Notify the compiler on completion of a bootstrap (JDK-8156034)
Josef Eisl <josef.eisl@jku.at>
parents:
23379
diff
changeset
|
840 HandleMark hm(THREAD); |
23751
b1b5c71c04b7
replace use of vm_abort with vm_exit
Doug Simon <doug.simon@oracle.com>
parents:
23745
diff
changeset
|
841 Handle receiver = get_HotSpotJVMCIRuntime(CHECK_EXIT); |
23383
0226d6bcb0d2
Notify the compiler on completion of a bootstrap (JDK-8156034)
Josef Eisl <josef.eisl@jku.at>
parents:
23379
diff
changeset
|
842 JavaValue result(T_VOID); |
0226d6bcb0d2
Notify the compiler on completion of a bootstrap (JDK-8156034)
Josef Eisl <josef.eisl@jku.at>
parents:
23379
diff
changeset
|
843 JavaCallArguments args; |
0226d6bcb0d2
Notify the compiler on completion of a bootstrap (JDK-8156034)
Josef Eisl <josef.eisl@jku.at>
parents:
23379
diff
changeset
|
844 args.push_oop(receiver); |
23751
b1b5c71c04b7
replace use of vm_abort with vm_exit
Doug Simon <doug.simon@oracle.com>
parents:
23745
diff
changeset
|
845 JavaCalls::call_special(&result, receiver->klass(), vmSymbols::bootstrapFinished_method_name(), vmSymbols::void_method_signature(), &args, CHECK_EXIT); |
23383
0226d6bcb0d2
Notify the compiler on completion of a bootstrap (JDK-8156034)
Josef Eisl <josef.eisl@jku.at>
parents:
23379
diff
changeset
|
846 } |
0226d6bcb0d2
Notify the compiler on completion of a bootstrap (JDK-8156034)
Josef Eisl <josef.eisl@jku.at>
parents:
23379
diff
changeset
|
847 } |
0226d6bcb0d2
Notify the compiler on completion of a bootstrap (JDK-8156034)
Josef Eisl <josef.eisl@jku.at>
parents:
23379
diff
changeset
|
848 |
22575
569c82ebb96e
Replace JVMCICompileWithC1Only with package based controls
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22574
diff
changeset
|
849 bool JVMCIRuntime::treat_as_trivial(Method* method) { |
22586
cf99b5e5b0b4
Fix race in initialization of trivial prefixes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22585
diff
changeset
|
850 if (_HotSpotJVMCIRuntime_initialized) { |
22609
c42b12eb270a
trivial prefixes shoudl only apply to the compiler itself
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22602
diff
changeset
|
851 oop loader = method->method_holder()->class_loader(); |
24140
d4858e92c9b1
[GR-4077] support Graal.SDK on the boot class path and Truffle on a class path invisible to apps but visible to JVMCI
Doug Simon <doug.simon@oracle.com>
parents:
23979
diff
changeset
|
852 if (SystemDictionary::in_jvmci_loader_hierarchy(loader)) { |
22609
c42b12eb270a
trivial prefixes shoudl only apply to the compiler itself
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22602
diff
changeset
|
853 for (int i = 0; i < _trivial_prefixes_count; i++) { |
c42b12eb270a
trivial prefixes shoudl only apply to the compiler itself
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22602
diff
changeset
|
854 if (method->method_holder()->name()->starts_with(_trivial_prefixes[i])) { |
c42b12eb270a
trivial prefixes shoudl only apply to the compiler itself
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22602
diff
changeset
|
855 return true; |
c42b12eb270a
trivial prefixes shoudl only apply to the compiler itself
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22602
diff
changeset
|
856 } |
22586
cf99b5e5b0b4
Fix race in initialization of trivial prefixes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22585
diff
changeset
|
857 } |
22575
569c82ebb96e
Replace JVMCICompileWithC1Only with package based controls
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22574
diff
changeset
|
858 } |
569c82ebb96e
Replace JVMCICompileWithC1Only with package based controls
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22574
diff
changeset
|
859 } |
569c82ebb96e
Replace JVMCICompileWithC1Only with package based controls
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22574
diff
changeset
|
860 return false; |
569c82ebb96e
Replace JVMCICompileWithC1Only with package based controls
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22574
diff
changeset
|
861 } |
569c82ebb96e
Replace JVMCICompileWithC1Only with package based controls
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22574
diff
changeset
|
862 |
23379
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
863 CompLevel JVMCIRuntime::adjust_comp_level(methodHandle method, bool is_osr, CompLevel level, JavaThread* thread) { |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
864 if (!thread->adjusting_comp_level()) { |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
865 thread->set_adjusting_comp_level(true); |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
866 level = adjust_comp_level_inner(method, is_osr, level, thread); |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
867 thread->set_adjusting_comp_level(false); |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
868 } |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
869 return level; |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
870 } |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
871 |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
872 CompLevel JVMCIRuntime::adjust_comp_level_inner(methodHandle method, bool is_osr, CompLevel level, JavaThread* thread) { |
24229
190f5f33b7d3
hosted use of JVMCI can crash VM under -Xint (JDK-8187315)
Doug Simon <doug.simon@oracle.com>
parents:
24140
diff
changeset
|
873 JVMCICompiler* compiler = JVMCICompiler::instance(false, thread); |
23379
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
874 if (compiler != NULL && compiler->is_bootstrapping()) { |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
875 return level; |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
876 } |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
877 if (!is_HotSpotJVMCIRuntime_initialized() || !_comp_level_adjustment) { |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
878 // JVMCI cannot participate in compilation scheduling until |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
879 // JVMCI is initialized and indicates it wants to participate. |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
880 return level; |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
881 } |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
882 |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
883 #define CHECK_RETURN THREAD); \ |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
884 if (HAS_PENDING_EXCEPTION) { \ |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
885 Handle exception(THREAD, PENDING_EXCEPTION); \ |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
886 CLEAR_PENDING_EXCEPTION; \ |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
887 \ |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
888 java_lang_Throwable::print(exception, tty); \ |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
889 tty->cr(); \ |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
890 java_lang_Throwable::print_stack_trace(exception(), tty); \ |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
891 if (HAS_PENDING_EXCEPTION) { \ |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
892 CLEAR_PENDING_EXCEPTION; \ |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
893 } \ |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
894 return level; \ |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
895 } \ |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
896 (void)(0 |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
897 |
23408
f84a5ac3be22
make JVMCI JDK immutable and sharable among different JVMCI clients
Doug Simon <doug.simon@oracle.com>
parents:
23404
diff
changeset
|
898 |
23379
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
899 Thread* THREAD = thread; |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
900 HandleMark hm; |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
901 Handle receiver = JVMCIRuntime::get_HotSpotJVMCIRuntime(CHECK_RETURN); |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
902 Handle name; |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
903 Handle sig; |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
904 if (_comp_level_adjustment == JVMCIRuntime::by_full_signature) { |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
905 name = java_lang_String::create_from_symbol(method->name(), CHECK_RETURN); |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
906 sig = java_lang_String::create_from_symbol(method->signature(), CHECK_RETURN); |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
907 } else { |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
908 name = Handle(); |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
909 sig = Handle(); |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
910 } |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
911 |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
912 JavaValue result(T_INT); |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
913 JavaCallArguments args; |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
914 args.push_oop(receiver); |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
915 args.push_oop(method->method_holder()->java_mirror()); |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
916 args.push_oop(name()); |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
917 args.push_oop(sig()); |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
918 args.push_int(is_osr); |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
919 args.push_int(level); |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
920 JavaCalls::call_special(&result, receiver->klass(), vmSymbols::adjustCompilationLevel_name(), |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
921 vmSymbols::adjustCompilationLevel_signature(), &args, CHECK_RETURN); |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
922 |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
923 // An uncaught exception was thrown. Generally these |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
924 // should be handled by the Java code in some useful way but if they leak |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
925 // through to here report them instead of dying or silently ignoring them. |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
926 if (HAS_PENDING_EXCEPTION) { |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
927 Handle throwable = PENDING_EXCEPTION; |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
928 CLEAR_PENDING_EXCEPTION; |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
929 |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
930 java_lang_Throwable::print(throwable, tty); |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
931 tty->cr(); |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
932 java_lang_Throwable::print_stack_trace(throwable(), tty); |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
933 return level; |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
934 } |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
935 int comp_level = result.get_jint(); |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
936 if (comp_level < CompLevel_none || comp_level > CompLevel_full_optimization) { |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
937 assert(false, "compilation level out of bounds"); |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
938 return level; |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
939 } |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
940 return (CompLevel) comp_level; |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
941 #undef CHECK_RETURN |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
942 } |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23372
diff
changeset
|
943 |
23751
b1b5c71c04b7
replace use of vm_abort with vm_exit
Doug Simon <doug.simon@oracle.com>
parents:
23745
diff
changeset
|
944 void JVMCIRuntime::exit_on_pending_exception(Handle exception, const char* message) { |
b1b5c71c04b7
replace use of vm_abort with vm_exit
Doug Simon <doug.simon@oracle.com>
parents:
23745
diff
changeset
|
945 JavaThread* THREAD = JavaThread::current(); |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
946 CLEAR_PENDING_EXCEPTION; |
23329
bc5552dc384b
Use VM routines to print stack traces from C++ code.
Roland Schatz <roland.schatz@oracle.com>
parents:
23327
diff
changeset
|
947 |
23751
b1b5c71c04b7
replace use of vm_abort with vm_exit
Doug Simon <doug.simon@oracle.com>
parents:
23745
diff
changeset
|
948 static volatile int report_error = 0; |
b1b5c71c04b7
replace use of vm_abort with vm_exit
Doug Simon <doug.simon@oracle.com>
parents:
23745
diff
changeset
|
949 if (!report_error && Atomic::cmpxchg(1, &report_error, 0) == 0) { |
b1b5c71c04b7
replace use of vm_abort with vm_exit
Doug Simon <doug.simon@oracle.com>
parents:
23745
diff
changeset
|
950 // Only report an error once |
b1b5c71c04b7
replace use of vm_abort with vm_exit
Doug Simon <doug.simon@oracle.com>
parents:
23745
diff
changeset
|
951 tty->print_raw_cr(message); |
b1b5c71c04b7
replace use of vm_abort with vm_exit
Doug Simon <doug.simon@oracle.com>
parents:
23745
diff
changeset
|
952 java_lang_Throwable::print(exception, tty); |
b1b5c71c04b7
replace use of vm_abort with vm_exit
Doug Simon <doug.simon@oracle.com>
parents:
23745
diff
changeset
|
953 tty->cr(); |
b1b5c71c04b7
replace use of vm_abort with vm_exit
Doug Simon <doug.simon@oracle.com>
parents:
23745
diff
changeset
|
954 java_lang_Throwable::print_stack_trace(exception(), tty); |
b1b5c71c04b7
replace use of vm_abort with vm_exit
Doug Simon <doug.simon@oracle.com>
parents:
23745
diff
changeset
|
955 } else { |
b1b5c71c04b7
replace use of vm_abort with vm_exit
Doug Simon <doug.simon@oracle.com>
parents:
23745
diff
changeset
|
956 // Allow error reporting thread to print the stack trace. |
b1b5c71c04b7
replace use of vm_abort with vm_exit
Doug Simon <doug.simon@oracle.com>
parents:
23745
diff
changeset
|
957 os::sleep(THREAD, 200, false); |
b1b5c71c04b7
replace use of vm_abort with vm_exit
Doug Simon <doug.simon@oracle.com>
parents:
23745
diff
changeset
|
958 } |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
959 |
23751
b1b5c71c04b7
replace use of vm_abort with vm_exit
Doug Simon <doug.simon@oracle.com>
parents:
23745
diff
changeset
|
960 before_exit(THREAD); |
b1b5c71c04b7
replace use of vm_abort with vm_exit
Doug Simon <doug.simon@oracle.com>
parents:
23745
diff
changeset
|
961 vm_exit(-1); |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
962 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
963 |
23392
b3a816d3b844
Backed out changeset: a920338dd4d4
Doug Simon <doug.simon@oracle.com>
parents:
23387
diff
changeset
|
964 void JVMCIRuntime::fthrow_error(Thread* thread, const char* file, int line, const char* format, ...) { |
b3a816d3b844
Backed out changeset: a920338dd4d4
Doug Simon <doug.simon@oracle.com>
parents:
23387
diff
changeset
|
965 const int max_msg_size = 1024; |
b3a816d3b844
Backed out changeset: a920338dd4d4
Doug Simon <doug.simon@oracle.com>
parents:
23387
diff
changeset
|
966 va_list ap; |
b3a816d3b844
Backed out changeset: a920338dd4d4
Doug Simon <doug.simon@oracle.com>
parents:
23387
diff
changeset
|
967 va_start(ap, format); |
b3a816d3b844
Backed out changeset: a920338dd4d4
Doug Simon <doug.simon@oracle.com>
parents:
23387
diff
changeset
|
968 char msg[max_msg_size]; |
b3a816d3b844
Backed out changeset: a920338dd4d4
Doug Simon <doug.simon@oracle.com>
parents:
23387
diff
changeset
|
969 vsnprintf(msg, max_msg_size, format, ap); |
b3a816d3b844
Backed out changeset: a920338dd4d4
Doug Simon <doug.simon@oracle.com>
parents:
23387
diff
changeset
|
970 msg[max_msg_size-1] = '\0'; |
b3a816d3b844
Backed out changeset: a920338dd4d4
Doug Simon <doug.simon@oracle.com>
parents:
23387
diff
changeset
|
971 va_end(ap); |
b3a816d3b844
Backed out changeset: a920338dd4d4
Doug Simon <doug.simon@oracle.com>
parents:
23387
diff
changeset
|
972 Handle h_loader = Handle(thread, SystemDictionary::jvmci_loader()); |
b3a816d3b844
Backed out changeset: a920338dd4d4
Doug Simon <doug.simon@oracle.com>
parents:
23387
diff
changeset
|
973 Handle h_protection_domain = Handle(); |
b3a816d3b844
Backed out changeset: a920338dd4d4
Doug Simon <doug.simon@oracle.com>
parents:
23387
diff
changeset
|
974 Exceptions::_throw_msg(thread, file, line, vmSymbols::jdk_vm_ci_common_JVMCIError(), msg, h_loader, h_protection_domain); |
b3a816d3b844
Backed out changeset: a920338dd4d4
Doug Simon <doug.simon@oracle.com>
parents:
23387
diff
changeset
|
975 } |
b3a816d3b844
Backed out changeset: a920338dd4d4
Doug Simon <doug.simon@oracle.com>
parents:
23387
diff
changeset
|
976 |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
977 Klass* JVMCIRuntime::resolve_or_null(Symbol* name, TRAPS) { |
23296
f41d4011035d
reduced delta against jvmci-9
Doug Simon <doug.simon@oracle.com>
parents:
22761
diff
changeset
|
978 assert(!UseJVMCIClassLoader || SystemDictionary::jvmci_loader() != NULL, "JVMCI classloader should have been initialized"); |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
979 return SystemDictionary::resolve_or_null(name, SystemDictionary::jvmci_loader(), Handle(), CHECK_NULL); |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
980 } |
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
981 |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
982 Klass* JVMCIRuntime::resolve_or_fail(Symbol* name, TRAPS) { |
23296
f41d4011035d
reduced delta against jvmci-9
Doug Simon <doug.simon@oracle.com>
parents:
22761
diff
changeset
|
983 assert(!UseJVMCIClassLoader || SystemDictionary::jvmci_loader() != NULL, "JVMCI classloader should have been initialized"); |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
984 return SystemDictionary::resolve_or_fail(name, SystemDictionary::jvmci_loader(), Handle(), true, CHECK_NULL); |
21033
4527d2428f37
Convert graalRuntime.cpp to unix line delimiters
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21031
diff
changeset
|
985 } |