author | zmajo |
Wed, 15 Jun 2016 14:27:58 +0200 | |
changeset 39421 | a9652c919db8 |
parent 38719 | 133bf85c3f36 |
child 39423 | 0f8dc3693499 |
permissions | -rw-r--r-- |
33160 | 1 |
/* |
35498
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34317
diff
changeset
|
2 |
* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. |
33160 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
22 |
*/ |
|
23 |
||
24 |
#include "precompiled.hpp" |
|
35498
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34317
diff
changeset
|
25 |
#include "classfile/javaClasses.inline.hpp" |
33160 | 26 |
#include "code/codeCache.hpp" |
27 |
#include "code/scopeDesc.hpp" |
|
28 |
#include "interpreter/linkResolver.hpp" |
|
29 |
#include "memory/oopFactory.hpp" |
|
37248 | 30 |
#include "memory/resourceArea.hpp" |
33160 | 31 |
#include "oops/generateOopMap.hpp" |
32 |
#include "oops/fieldStreams.hpp" |
|
33 |
#include "oops/oop.inline.hpp" |
|
34 |
#include "oops/objArrayOop.inline.hpp" |
|
35 |
#include "runtime/fieldDescriptor.hpp" |
|
36 |
#include "runtime/javaCalls.hpp" |
|
37 |
#include "jvmci/jvmciRuntime.hpp" |
|
38 |
#include "compiler/abstractCompiler.hpp" |
|
39 |
#include "compiler/compileBroker.hpp" |
|
40 |
#include "compiler/compilerOracle.hpp" |
|
41 |
#include "compiler/disassembler.hpp" |
|
42 |
#include "compiler/oopMap.hpp" |
|
43 |
#include "jvmci/jvmciCompilerToVM.hpp" |
|
44 |
#include "jvmci/jvmciCompiler.hpp" |
|
45 |
#include "jvmci/jvmciEnv.hpp" |
|
46 |
#include "jvmci/jvmciJavaClasses.hpp" |
|
47 |
#include "jvmci/jvmciCodeInstaller.hpp" |
|
35123
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
48 |
#include "jvmci/vmStructs_jvmci.hpp" |
33160 | 49 |
#include "gc/g1/heapRegion.hpp" |
50 |
#include "runtime/javaCalls.hpp" |
|
51 |
#include "runtime/deoptimization.hpp" |
|
37161
e881f320966e
8150015: Integrate TraceTime with Unified Logging more seamlessly
rehn
parents:
35913
diff
changeset
|
52 |
#include "runtime/timerTrace.hpp" |
33160 | 53 |
#include "runtime/vframe.hpp" |
54 |
#include "runtime/vframe_hp.hpp" |
|
55 |
#include "runtime/vmStructs.hpp" |
|
56 |
||
57 |
||
58 |
// Entry to native method implementation that transitions current thread to '_thread_in_vm'. |
|
59 |
#define C2V_VMENTRY(result_type, name, signature) \ |
|
60 |
JNIEXPORT result_type JNICALL c2v_ ## name signature { \ |
|
61 |
TRACE_jvmci_1("CompilerToVM::" #name); \ |
|
62 |
TRACE_CALL(result_type, jvmci_ ## name signature) \ |
|
63 |
JVMCI_VM_ENTRY_MARK; \ |
|
64 |
||
65 |
#define C2V_END } |
|
66 |
||
33593
60764a78fa5c
8140274: methodHandles and constantPoolHandles should be passed as const references
coleenp
parents:
33160
diff
changeset
|
67 |
oop CompilerToVM::get_jvmci_method(const methodHandle& method, TRAPS) { |
33160 | 68 |
if (method() != NULL) { |
69 |
JavaValue result(T_OBJECT); |
|
70 |
JavaCallArguments args; |
|
71 |
args.push_long((jlong) (address) method()); |
|
72 |
JavaCalls::call_static(&result, SystemDictionary::HotSpotResolvedJavaMethodImpl_klass(), vmSymbols::fromMetaspace_name(), vmSymbols::method_fromMetaspace_signature(), &args, CHECK_NULL); |
|
73 |
||
74 |
return (oop)result.get_jobject(); |
|
75 |
} |
|
76 |
return NULL; |
|
77 |
} |
|
78 |
||
79 |
oop CompilerToVM::get_jvmci_type(KlassHandle klass, TRAPS) { |
|
80 |
if (klass() != NULL) { |
|
81 |
JavaValue result(T_OBJECT); |
|
82 |
JavaCallArguments args; |
|
83 |
args.push_oop(klass->java_mirror()); |
|
84 |
JavaCalls::call_static(&result, SystemDictionary::HotSpotResolvedObjectTypeImpl_klass(), vmSymbols::fromMetaspace_name(), vmSymbols::klass_fromMetaspace_signature(), &args, CHECK_NULL); |
|
85 |
||
86 |
return (oop)result.get_jobject(); |
|
87 |
} |
|
88 |
return NULL; |
|
89 |
} |
|
90 |
||
91 |
extern "C" { |
|
35123
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
92 |
extern VMStructEntry* jvmciHotSpotVMStructs; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
93 |
extern uint64_t jvmciHotSpotVMStructEntryTypeNameOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
94 |
extern uint64_t jvmciHotSpotVMStructEntryFieldNameOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
95 |
extern uint64_t jvmciHotSpotVMStructEntryTypeStringOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
96 |
extern uint64_t jvmciHotSpotVMStructEntryIsStaticOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
97 |
extern uint64_t jvmciHotSpotVMStructEntryOffsetOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
98 |
extern uint64_t jvmciHotSpotVMStructEntryAddressOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
99 |
extern uint64_t jvmciHotSpotVMStructEntryArrayStride; |
33160 | 100 |
|
35123
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
101 |
extern VMTypeEntry* jvmciHotSpotVMTypes; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
102 |
extern uint64_t jvmciHotSpotVMTypeEntryTypeNameOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
103 |
extern uint64_t jvmciHotSpotVMTypeEntrySuperclassNameOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
104 |
extern uint64_t jvmciHotSpotVMTypeEntryIsOopTypeOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
105 |
extern uint64_t jvmciHotSpotVMTypeEntryIsIntegerTypeOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
106 |
extern uint64_t jvmciHotSpotVMTypeEntryIsUnsignedOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
107 |
extern uint64_t jvmciHotSpotVMTypeEntrySizeOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
108 |
extern uint64_t jvmciHotSpotVMTypeEntryArrayStride; |
33160 | 109 |
|
35123
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
110 |
extern VMIntConstantEntry* jvmciHotSpotVMIntConstants; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
111 |
extern uint64_t jvmciHotSpotVMIntConstantEntryNameOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
112 |
extern uint64_t jvmciHotSpotVMIntConstantEntryValueOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
113 |
extern uint64_t jvmciHotSpotVMIntConstantEntryArrayStride; |
33160 | 114 |
|
35123
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
115 |
extern VMLongConstantEntry* jvmciHotSpotVMLongConstants; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
116 |
extern uint64_t jvmciHotSpotVMLongConstantEntryNameOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
117 |
extern uint64_t jvmciHotSpotVMLongConstantEntryValueOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
118 |
extern uint64_t jvmciHotSpotVMLongConstantEntryArrayStride; |
33160 | 119 |
|
35123
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
120 |
extern VMAddressEntry* jvmciHotSpotVMAddresses; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
121 |
extern uint64_t jvmciHotSpotVMAddressEntryNameOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
122 |
extern uint64_t jvmciHotSpotVMAddressEntryValueOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
123 |
extern uint64_t jvmciHotSpotVMAddressEntryArrayStride; |
33160 | 124 |
} |
125 |
||
35899 | 126 |
int CompilerToVM::Data::Klass_vtable_start_offset; |
127 |
int CompilerToVM::Data::Klass_vtable_length_offset; |
|
35123
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
128 |
|
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
129 |
int CompilerToVM::Data::Method_extra_stack_entries; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
130 |
|
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
131 |
address CompilerToVM::Data::SharedRuntime_ic_miss_stub; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
132 |
address CompilerToVM::Data::SharedRuntime_handle_wrong_method_stub; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
133 |
address CompilerToVM::Data::SharedRuntime_deopt_blob_unpack; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
134 |
address CompilerToVM::Data::SharedRuntime_deopt_blob_uncommon_trap; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
135 |
|
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
136 |
size_t CompilerToVM::Data::ThreadLocalAllocBuffer_alignment_reserve; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
137 |
|
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
138 |
CollectedHeap* CompilerToVM::Data::Universe_collectedHeap; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
139 |
int CompilerToVM::Data::Universe_base_vtable_size; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
140 |
address CompilerToVM::Data::Universe_narrow_oop_base; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
141 |
int CompilerToVM::Data::Universe_narrow_oop_shift; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
142 |
address CompilerToVM::Data::Universe_narrow_klass_base; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
143 |
int CompilerToVM::Data::Universe_narrow_klass_shift; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
144 |
void* CompilerToVM::Data::Universe_non_oop_bits; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
145 |
uintptr_t CompilerToVM::Data::Universe_verify_oop_mask; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
146 |
uintptr_t CompilerToVM::Data::Universe_verify_oop_bits; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
147 |
|
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
148 |
bool CompilerToVM::Data::_supports_inline_contig_alloc; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
149 |
HeapWord** CompilerToVM::Data::_heap_end_addr; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
150 |
HeapWord** CompilerToVM::Data::_heap_top_addr; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
151 |
|
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
152 |
jbyte* CompilerToVM::Data::cardtable_start_address; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
153 |
int CompilerToVM::Data::cardtable_shift; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
154 |
|
35593
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
155 |
int CompilerToVM::Data::vm_page_size; |
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
156 |
|
38283
4fb93f7c26fe
8156178: [JVMCI] expose StubRoutines trig functions
never
parents:
38139
diff
changeset
|
157 |
address CompilerToVM::Data::dsin; |
4fb93f7c26fe
8156178: [JVMCI] expose StubRoutines trig functions
never
parents:
38139
diff
changeset
|
158 |
address CompilerToVM::Data::dcos; |
4fb93f7c26fe
8156178: [JVMCI] expose StubRoutines trig functions
never
parents:
38139
diff
changeset
|
159 |
address CompilerToVM::Data::dtan; |
4fb93f7c26fe
8156178: [JVMCI] expose StubRoutines trig functions
never
parents:
38139
diff
changeset
|
160 |
address CompilerToVM::Data::dexp; |
4fb93f7c26fe
8156178: [JVMCI] expose StubRoutines trig functions
never
parents:
38139
diff
changeset
|
161 |
address CompilerToVM::Data::dlog; |
4fb93f7c26fe
8156178: [JVMCI] expose StubRoutines trig functions
never
parents:
38139
diff
changeset
|
162 |
address CompilerToVM::Data::dlog10; |
4fb93f7c26fe
8156178: [JVMCI] expose StubRoutines trig functions
never
parents:
38139
diff
changeset
|
163 |
address CompilerToVM::Data::dpow; |
4fb93f7c26fe
8156178: [JVMCI] expose StubRoutines trig functions
never
parents:
38139
diff
changeset
|
164 |
|
35123
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
165 |
void CompilerToVM::Data::initialize() { |
35899 | 166 |
Klass_vtable_start_offset = in_bytes(Klass::vtable_start_offset()); |
167 |
Klass_vtable_length_offset = in_bytes(Klass::vtable_length_offset()); |
|
35123
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
168 |
|
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
169 |
Method_extra_stack_entries = Method::extra_stack_entries(); |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
170 |
|
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
171 |
SharedRuntime_ic_miss_stub = SharedRuntime::get_ic_miss_stub(); |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
172 |
SharedRuntime_handle_wrong_method_stub = SharedRuntime::get_handle_wrong_method_stub(); |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
173 |
SharedRuntime_deopt_blob_unpack = SharedRuntime::deopt_blob()->unpack(); |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
174 |
SharedRuntime_deopt_blob_uncommon_trap = SharedRuntime::deopt_blob()->uncommon_trap(); |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
175 |
|
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
176 |
ThreadLocalAllocBuffer_alignment_reserve = ThreadLocalAllocBuffer::alignment_reserve(); |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
177 |
|
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
178 |
Universe_collectedHeap = Universe::heap(); |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
179 |
Universe_base_vtable_size = Universe::base_vtable_size(); |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
180 |
Universe_narrow_oop_base = Universe::narrow_oop_base(); |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
181 |
Universe_narrow_oop_shift = Universe::narrow_oop_shift(); |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
182 |
Universe_narrow_klass_base = Universe::narrow_klass_base(); |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
183 |
Universe_narrow_klass_shift = Universe::narrow_klass_shift(); |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
184 |
Universe_non_oop_bits = Universe::non_oop_word(); |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
185 |
Universe_verify_oop_mask = Universe::verify_oop_mask(); |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
186 |
Universe_verify_oop_bits = Universe::verify_oop_bits(); |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
187 |
|
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
188 |
_supports_inline_contig_alloc = Universe::heap()->supports_inline_contig_alloc(); |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
189 |
_heap_end_addr = _supports_inline_contig_alloc ? Universe::heap()->end_addr() : (HeapWord**) -1; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
190 |
_heap_top_addr = _supports_inline_contig_alloc ? Universe::heap()->top_addr() : (HeapWord**) -1; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
191 |
|
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
192 |
BarrierSet* bs = Universe::heap()->barrier_set(); |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
193 |
switch (bs->kind()) { |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
194 |
case BarrierSet::CardTableModRef: |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
195 |
case BarrierSet::CardTableForRS: |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
196 |
case BarrierSet::CardTableExtension: |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
197 |
case BarrierSet::G1SATBCT: |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
198 |
case BarrierSet::G1SATBCTLogging: { |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
199 |
jbyte* base = barrier_set_cast<CardTableModRefBS>(bs)->byte_map_base; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
200 |
assert(base != 0, "unexpected byte_map_base"); |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
201 |
cardtable_start_address = base; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
202 |
cardtable_shift = CardTableModRefBS::card_shift; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
203 |
break; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
204 |
} |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
205 |
case BarrierSet::ModRef: |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
206 |
cardtable_start_address = 0; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
207 |
cardtable_shift = 0; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
208 |
// No post barriers |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
209 |
break; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
210 |
default: |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
211 |
ShouldNotReachHere(); |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
212 |
break; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
213 |
} |
35593
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
214 |
|
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
215 |
vm_page_size = os::vm_page_size(); |
38283
4fb93f7c26fe
8156178: [JVMCI] expose StubRoutines trig functions
never
parents:
38139
diff
changeset
|
216 |
|
4fb93f7c26fe
8156178: [JVMCI] expose StubRoutines trig functions
never
parents:
38139
diff
changeset
|
217 |
#define SET_TRIGFUNC(name) \ |
4fb93f7c26fe
8156178: [JVMCI] expose StubRoutines trig functions
never
parents:
38139
diff
changeset
|
218 |
if (StubRoutines::name() != NULL) { \ |
4fb93f7c26fe
8156178: [JVMCI] expose StubRoutines trig functions
never
parents:
38139
diff
changeset
|
219 |
name = StubRoutines::name(); \ |
4fb93f7c26fe
8156178: [JVMCI] expose StubRoutines trig functions
never
parents:
38139
diff
changeset
|
220 |
} else { \ |
4fb93f7c26fe
8156178: [JVMCI] expose StubRoutines trig functions
never
parents:
38139
diff
changeset
|
221 |
name = CAST_FROM_FN_PTR(address, SharedRuntime::name); \ |
4fb93f7c26fe
8156178: [JVMCI] expose StubRoutines trig functions
never
parents:
38139
diff
changeset
|
222 |
} |
4fb93f7c26fe
8156178: [JVMCI] expose StubRoutines trig functions
never
parents:
38139
diff
changeset
|
223 |
|
4fb93f7c26fe
8156178: [JVMCI] expose StubRoutines trig functions
never
parents:
38139
diff
changeset
|
224 |
SET_TRIGFUNC(dsin); |
4fb93f7c26fe
8156178: [JVMCI] expose StubRoutines trig functions
never
parents:
38139
diff
changeset
|
225 |
SET_TRIGFUNC(dcos); |
4fb93f7c26fe
8156178: [JVMCI] expose StubRoutines trig functions
never
parents:
38139
diff
changeset
|
226 |
SET_TRIGFUNC(dtan); |
4fb93f7c26fe
8156178: [JVMCI] expose StubRoutines trig functions
never
parents:
38139
diff
changeset
|
227 |
SET_TRIGFUNC(dexp); |
4fb93f7c26fe
8156178: [JVMCI] expose StubRoutines trig functions
never
parents:
38139
diff
changeset
|
228 |
SET_TRIGFUNC(dlog10); |
4fb93f7c26fe
8156178: [JVMCI] expose StubRoutines trig functions
never
parents:
38139
diff
changeset
|
229 |
SET_TRIGFUNC(dlog); |
4fb93f7c26fe
8156178: [JVMCI] expose StubRoutines trig functions
never
parents:
38139
diff
changeset
|
230 |
SET_TRIGFUNC(dpow); |
4fb93f7c26fe
8156178: [JVMCI] expose StubRoutines trig functions
never
parents:
38139
diff
changeset
|
231 |
|
4fb93f7c26fe
8156178: [JVMCI] expose StubRoutines trig functions
never
parents:
38139
diff
changeset
|
232 |
#undef SET_TRIGFUNC |
35123
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
233 |
} |
33160 | 234 |
|
235 |
/** |
|
35123
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
236 |
* We put all jvmciHotSpotVM values in an array so we can read them easily from Java. |
33160 | 237 |
*/ |
238 |
static uintptr_t ciHotSpotVMData[28]; |
|
239 |
||
240 |
C2V_VMENTRY(jlong, initializeConfiguration, (JNIEnv *env, jobject)) |
|
35123
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
241 |
ciHotSpotVMData[0] = (uintptr_t) jvmciHotSpotVMStructs; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
242 |
ciHotSpotVMData[1] = jvmciHotSpotVMStructEntryTypeNameOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
243 |
ciHotSpotVMData[2] = jvmciHotSpotVMStructEntryFieldNameOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
244 |
ciHotSpotVMData[3] = jvmciHotSpotVMStructEntryTypeStringOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
245 |
ciHotSpotVMData[4] = jvmciHotSpotVMStructEntryIsStaticOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
246 |
ciHotSpotVMData[5] = jvmciHotSpotVMStructEntryOffsetOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
247 |
ciHotSpotVMData[6] = jvmciHotSpotVMStructEntryAddressOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
248 |
ciHotSpotVMData[7] = jvmciHotSpotVMStructEntryArrayStride; |
33160 | 249 |
|
35123
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
250 |
ciHotSpotVMData[8] = (uintptr_t) jvmciHotSpotVMTypes; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
251 |
ciHotSpotVMData[9] = jvmciHotSpotVMTypeEntryTypeNameOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
252 |
ciHotSpotVMData[10] = jvmciHotSpotVMTypeEntrySuperclassNameOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
253 |
ciHotSpotVMData[11] = jvmciHotSpotVMTypeEntryIsOopTypeOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
254 |
ciHotSpotVMData[12] = jvmciHotSpotVMTypeEntryIsIntegerTypeOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
255 |
ciHotSpotVMData[13] = jvmciHotSpotVMTypeEntryIsUnsignedOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
256 |
ciHotSpotVMData[14] = jvmciHotSpotVMTypeEntrySizeOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
257 |
ciHotSpotVMData[15] = jvmciHotSpotVMTypeEntryArrayStride; |
33160 | 258 |
|
35123
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
259 |
ciHotSpotVMData[16] = (uintptr_t) jvmciHotSpotVMIntConstants; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
260 |
ciHotSpotVMData[17] = jvmciHotSpotVMIntConstantEntryNameOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
261 |
ciHotSpotVMData[18] = jvmciHotSpotVMIntConstantEntryValueOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
262 |
ciHotSpotVMData[19] = jvmciHotSpotVMIntConstantEntryArrayStride; |
33160 | 263 |
|
35123
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
264 |
ciHotSpotVMData[20] = (uintptr_t) jvmciHotSpotVMLongConstants; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
265 |
ciHotSpotVMData[21] = jvmciHotSpotVMLongConstantEntryNameOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
266 |
ciHotSpotVMData[22] = jvmciHotSpotVMLongConstantEntryValueOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
267 |
ciHotSpotVMData[23] = jvmciHotSpotVMLongConstantEntryArrayStride; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
268 |
|
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
269 |
ciHotSpotVMData[24] = (uintptr_t) jvmciHotSpotVMAddresses; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
270 |
ciHotSpotVMData[25] = jvmciHotSpotVMAddressEntryNameOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
271 |
ciHotSpotVMData[26] = jvmciHotSpotVMAddressEntryValueOffset; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
272 |
ciHotSpotVMData[27] = jvmciHotSpotVMAddressEntryArrayStride; |
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
273 |
|
b0b89d83bcf5
8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents:
35092
diff
changeset
|
274 |
CompilerToVM::Data::initialize(); |
33160 | 275 |
|
276 |
return (jlong) (address) &ciHotSpotVMData; |
|
277 |
C2V_END |
|
278 |
||
279 |
C2V_VMENTRY(jbyteArray, getBytecode, (JNIEnv *, jobject, jobject jvmci_method)) |
|
280 |
methodHandle method = CompilerToVM::asMethod(jvmci_method); |
|
281 |
ResourceMark rm; |
|
282 |
||
283 |
int code_size = method->code_size(); |
|
284 |
typeArrayOop reconstituted_code = oopFactory::new_byteArray(code_size, CHECK_NULL); |
|
285 |
||
286 |
guarantee(method->method_holder()->is_rewritten(), "Method's holder should be rewritten"); |
|
287 |
// iterate over all bytecodes and replace non-Java bytecodes |
|
288 |
||
289 |
for (BytecodeStream s(method); s.next() != Bytecodes::_illegal; ) { |
|
290 |
Bytecodes::Code code = s.code(); |
|
291 |
Bytecodes::Code raw_code = s.raw_code(); |
|
292 |
int bci = s.bci(); |
|
293 |
int len = s.instruction_size(); |
|
294 |
||
295 |
// Restore original byte code. |
|
296 |
reconstituted_code->byte_at_put(bci, (jbyte) (s.is_wide()? Bytecodes::_wide : code)); |
|
297 |
if (len > 1) { |
|
298 |
memcpy(reconstituted_code->byte_at_addr(bci + 1), s.bcp()+1, len-1); |
|
299 |
} |
|
300 |
||
301 |
if (len > 1) { |
|
302 |
// Restore the big-endian constant pool indexes. |
|
303 |
// Cf. Rewriter::scan_method |
|
304 |
switch (code) { |
|
305 |
case Bytecodes::_getstatic: |
|
306 |
case Bytecodes::_putstatic: |
|
307 |
case Bytecodes::_getfield: |
|
308 |
case Bytecodes::_putfield: |
|
309 |
case Bytecodes::_invokevirtual: |
|
310 |
case Bytecodes::_invokespecial: |
|
311 |
case Bytecodes::_invokestatic: |
|
312 |
case Bytecodes::_invokeinterface: |
|
313 |
case Bytecodes::_invokehandle: { |
|
314 |
int cp_index = Bytes::get_native_u2((address) reconstituted_code->byte_at_addr(bci + 1)); |
|
315 |
Bytes::put_Java_u2((address) reconstituted_code->byte_at_addr(bci + 1), (u2) cp_index); |
|
316 |
break; |
|
317 |
} |
|
318 |
||
319 |
case Bytecodes::_invokedynamic: |
|
320 |
int cp_index = Bytes::get_native_u4((address) reconstituted_code->byte_at_addr(bci + 1)); |
|
321 |
Bytes::put_Java_u4((address) reconstituted_code->byte_at_addr(bci + 1), (u4) cp_index); |
|
322 |
break; |
|
323 |
} |
|
324 |
||
325 |
// Not all ldc byte code are rewritten. |
|
326 |
switch (raw_code) { |
|
327 |
case Bytecodes::_fast_aldc: { |
|
328 |
int cpc_index = reconstituted_code->byte_at(bci + 1) & 0xff; |
|
329 |
int cp_index = method->constants()->object_to_cp_index(cpc_index); |
|
330 |
assert(cp_index < method->constants()->length(), "sanity check"); |
|
331 |
reconstituted_code->byte_at_put(bci + 1, (jbyte) cp_index); |
|
332 |
break; |
|
333 |
} |
|
334 |
||
335 |
case Bytecodes::_fast_aldc_w: { |
|
336 |
int cpc_index = Bytes::get_native_u2((address) reconstituted_code->byte_at_addr(bci + 1)); |
|
337 |
int cp_index = method->constants()->object_to_cp_index(cpc_index); |
|
338 |
assert(cp_index < method->constants()->length(), "sanity check"); |
|
339 |
Bytes::put_Java_u2((address) reconstituted_code->byte_at_addr(bci + 1), (u2) cp_index); |
|
340 |
break; |
|
341 |
} |
|
342 |
} |
|
343 |
} |
|
344 |
} |
|
345 |
||
346 |
return (jbyteArray) JNIHandles::make_local(THREAD, reconstituted_code); |
|
347 |
C2V_END |
|
348 |
||
349 |
C2V_VMENTRY(jint, getExceptionTableLength, (JNIEnv *, jobject, jobject jvmci_method)) |
|
350 |
ResourceMark rm; |
|
351 |
methodHandle method = CompilerToVM::asMethod(jvmci_method); |
|
352 |
return method->exception_table_length(); |
|
353 |
C2V_END |
|
354 |
||
355 |
C2V_VMENTRY(jlong, getExceptionTableStart, (JNIEnv *, jobject, jobject jvmci_method)) |
|
356 |
ResourceMark rm; |
|
357 |
methodHandle method = CompilerToVM::asMethod(jvmci_method); |
|
358 |
if (method->exception_table_length() == 0) { |
|
359 |
return 0L; |
|
360 |
} |
|
361 |
return (jlong) (address) method->exception_table_start(); |
|
362 |
C2V_END |
|
363 |
||
364 |
C2V_VMENTRY(jobject, getResolvedJavaMethodAtSlot, (JNIEnv *, jobject, jclass holder_handle, jint slot)) |
|
365 |
oop java_class = JNIHandles::resolve(holder_handle); |
|
366 |
Klass* holder = java_lang_Class::as_Klass(java_class); |
|
367 |
methodHandle method = InstanceKlass::cast(holder)->method_with_idnum(slot); |
|
368 |
oop result = CompilerToVM::get_jvmci_method(method, CHECK_NULL); |
|
369 |
return JNIHandles::make_local(THREAD, result); |
|
370 |
} |
|
371 |
||
372 |
C2V_VMENTRY(jobject, getResolvedJavaMethod, (JNIEnv *, jobject, jobject base, jlong offset)) |
|
373 |
methodHandle method; |
|
374 |
oop base_object = JNIHandles::resolve(base); |
|
375 |
if (base_object == NULL) { |
|
376 |
method = *((Method**)(offset)); |
|
377 |
} else if (base_object->is_a(SystemDictionary::MemberName_klass())) { |
|
378 |
method = (Method*) (intptr_t) base_object->long_field(offset); |
|
379 |
} else if (base_object->is_a(SystemDictionary::HotSpotResolvedJavaMethodImpl_klass())) { |
|
380 |
method = *((Method**)(HotSpotResolvedJavaMethodImpl::metaspaceMethod(base_object) + offset)); |
|
381 |
} else { |
|
382 |
THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), |
|
383 |
err_msg("Unexpected type: %s", base_object->klass()->external_name())); |
|
384 |
} |
|
385 |
assert (method.is_null() || method->is_method(), "invalid read"); |
|
386 |
oop result = CompilerToVM::get_jvmci_method(method, CHECK_NULL); |
|
387 |
return JNIHandles::make_local(THREAD, result); |
|
388 |
} |
|
389 |
||
390 |
C2V_VMENTRY(jobject, getConstantPool, (JNIEnv *, jobject, jobject base, jlong offset)) |
|
391 |
constantPoolHandle cp; |
|
392 |
oop base_object = JNIHandles::resolve(base); |
|
393 |
jlong base_address = 0; |
|
394 |
if (base_object != NULL) { |
|
395 |
if (base_object->is_a(SystemDictionary::HotSpotResolvedJavaMethodImpl_klass())) { |
|
396 |
base_address = HotSpotResolvedJavaMethodImpl::metaspaceMethod(base_object); |
|
397 |
} else if (base_object->is_a(SystemDictionary::HotSpotConstantPool_klass())) { |
|
398 |
base_address = HotSpotConstantPool::metaspaceConstantPool(base_object); |
|
399 |
} else if (base_object->is_a(SystemDictionary::HotSpotResolvedObjectTypeImpl_klass())) { |
|
400 |
base_address = (jlong) CompilerToVM::asKlass(base_object); |
|
401 |
} else { |
|
402 |
THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), |
|
403 |
err_msg("Unexpected type: %s", base_object->klass()->external_name())); |
|
404 |
} |
|
405 |
} |
|
406 |
cp = *((ConstantPool**) (intptr_t) (base_address + offset)); |
|
407 |
if (!cp.is_null()) { |
|
408 |
JavaValue method_result(T_OBJECT); |
|
409 |
JavaCallArguments args; |
|
410 |
args.push_long((jlong) (address) cp()); |
|
411 |
JavaCalls::call_static(&method_result, SystemDictionary::HotSpotConstantPool_klass(), vmSymbols::fromMetaspace_name(), vmSymbols::constantPool_fromMetaspace_signature(), &args, CHECK_NULL); |
|
412 |
return JNIHandles::make_local(THREAD, (oop)method_result.get_jobject()); |
|
413 |
} |
|
414 |
return NULL; |
|
415 |
} |
|
416 |
||
417 |
C2V_VMENTRY(jobject, getResolvedJavaType, (JNIEnv *, jobject, jobject base, jlong offset, jboolean compressed)) |
|
418 |
KlassHandle klass; |
|
419 |
oop base_object = JNIHandles::resolve(base); |
|
420 |
jlong base_address = 0; |
|
421 |
if (base_object != NULL && offset == oopDesc::klass_offset_in_bytes()) { |
|
422 |
klass = base_object->klass(); |
|
423 |
} else if (!compressed) { |
|
424 |
if (base_object != NULL) { |
|
425 |
if (base_object->is_a(SystemDictionary::HotSpotResolvedJavaMethodImpl_klass())) { |
|
426 |
base_address = HotSpotResolvedJavaMethodImpl::metaspaceMethod(base_object); |
|
427 |
} else if (base_object->is_a(SystemDictionary::HotSpotConstantPool_klass())) { |
|
428 |
base_address = HotSpotConstantPool::metaspaceConstantPool(base_object); |
|
429 |
} else if (base_object->is_a(SystemDictionary::HotSpotResolvedObjectTypeImpl_klass())) { |
|
430 |
base_address = (jlong) CompilerToVM::asKlass(base_object); |
|
431 |
} else if (base_object->is_a(SystemDictionary::Class_klass())) { |
|
432 |
base_address = (jlong) (address) base_object; |
|
433 |
} else { |
|
434 |
THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), |
|
435 |
err_msg("Unexpected arguments: %s " JLONG_FORMAT " %s", base_object->klass()->external_name(), offset, compressed ? "true" : "false")); |
|
436 |
} |
|
437 |
} |
|
438 |
klass = *((Klass**) (intptr_t) (base_address + offset)); |
|
439 |
} else { |
|
440 |
THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), |
|
441 |
err_msg("Unexpected arguments: %s " JLONG_FORMAT " %s", base_object->klass()->external_name(), offset, compressed ? "true" : "false")); |
|
442 |
} |
|
443 |
assert (klass.is_null() || klass->is_klass(), "invalid read"); |
|
444 |
oop result = CompilerToVM::get_jvmci_type(klass, CHECK_NULL); |
|
445 |
return JNIHandles::make_local(THREAD, result); |
|
446 |
} |
|
447 |
||
448 |
C2V_VMENTRY(jobject, findUniqueConcreteMethod, (JNIEnv *, jobject, jobject jvmci_type, jobject jvmci_method)) |
|
449 |
ResourceMark rm; |
|
450 |
methodHandle method = CompilerToVM::asMethod(jvmci_method); |
|
451 |
KlassHandle holder = CompilerToVM::asKlass(jvmci_type); |
|
452 |
if (holder->is_interface()) { |
|
453 |
THROW_MSG_0(vmSymbols::java_lang_InternalError(), err_msg("Interface %s should be handled in Java code", holder->external_name())); |
|
454 |
} |
|
455 |
||
456 |
methodHandle ucm; |
|
457 |
{ |
|
458 |
MutexLocker locker(Compile_lock); |
|
459 |
ucm = Dependencies::find_unique_concrete_method(holder(), method()); |
|
460 |
} |
|
461 |
oop result = CompilerToVM::get_jvmci_method(ucm, CHECK_NULL); |
|
462 |
return JNIHandles::make_local(THREAD, result); |
|
463 |
C2V_END |
|
464 |
||
465 |
C2V_VMENTRY(jobject, getImplementor, (JNIEnv *, jobject, jobject jvmci_type)) |
|
466 |
InstanceKlass* klass = (InstanceKlass*) CompilerToVM::asKlass(jvmci_type); |
|
467 |
oop implementor = CompilerToVM::get_jvmci_type(klass->implementor(), CHECK_NULL); |
|
468 |
return JNIHandles::make_local(THREAD, implementor); |
|
469 |
C2V_END |
|
470 |
||
471 |
C2V_VMENTRY(jboolean, methodIsIgnoredBySecurityStackWalk,(JNIEnv *, jobject, jobject jvmci_method)) |
|
472 |
methodHandle method = CompilerToVM::asMethod(jvmci_method); |
|
473 |
return method->is_ignored_by_security_stack_walk(); |
|
474 |
C2V_END |
|
475 |
||
476 |
C2V_VMENTRY(jboolean, canInlineMethod,(JNIEnv *, jobject, jobject jvmci_method)) |
|
477 |
methodHandle method = CompilerToVM::asMethod(jvmci_method); |
|
36800
37014ee7264c
8151874: [JVMCI] canInlineMethod should check is_not_compilable for correct CompLevel
never
parents:
35913
diff
changeset
|
478 |
// In hosted mode ignore the not_compilable flags since they are never set by |
37014ee7264c
8151874: [JVMCI] canInlineMethod should check is_not_compilable for correct CompLevel
never
parents:
35913
diff
changeset
|
479 |
// the JVMCI compiler. |
37014ee7264c
8151874: [JVMCI] canInlineMethod should check is_not_compilable for correct CompLevel
never
parents:
35913
diff
changeset
|
480 |
bool is_compilable = UseJVMCICompiler ? !method->is_not_compilable(CompLevel_full_optimization) : true; |
37014ee7264c
8151874: [JVMCI] canInlineMethod should check is_not_compilable for correct CompLevel
never
parents:
35913
diff
changeset
|
481 |
return is_compilable && !CompilerOracle::should_not_inline(method) && !method->dont_inline(); |
33160 | 482 |
C2V_END |
483 |
||
484 |
C2V_VMENTRY(jboolean, shouldInlineMethod,(JNIEnv *, jobject, jobject jvmci_method)) |
|
485 |
methodHandle method = CompilerToVM::asMethod(jvmci_method); |
|
486 |
return CompilerOracle::should_inline(method) || method->force_inline(); |
|
487 |
C2V_END |
|
488 |
||
489 |
C2V_VMENTRY(jobject, lookupType, (JNIEnv*, jobject, jstring jname, jclass accessing_class, jboolean resolve)) |
|
490 |
ResourceMark rm; |
|
491 |
Handle name = JNIHandles::resolve(jname); |
|
492 |
Symbol* class_name = java_lang_String::as_symbol(name, CHECK_0); |
|
493 |
if (java_lang_String::length(name()) <= 1) { |
|
494 |
THROW_MSG_0(vmSymbols::java_lang_InternalError(), err_msg("Primitive type %s should be handled in Java code", class_name->as_C_string())); |
|
495 |
} |
|
496 |
||
497 |
Klass* resolved_klass = NULL; |
|
498 |
Handle class_loader; |
|
499 |
Handle protection_domain; |
|
500 |
if (JNIHandles::resolve(accessing_class) == NULL) { |
|
501 |
THROW_0(vmSymbols::java_lang_NullPointerException()); |
|
502 |
} |
|
503 |
Klass* accessing_klass = java_lang_Class::as_Klass(JNIHandles::resolve(accessing_class)); |
|
504 |
class_loader = accessing_klass->class_loader(); |
|
505 |
protection_domain = accessing_klass->protection_domain(); |
|
506 |
||
507 |
if (resolve) { |
|
508 |
resolved_klass = SystemDictionary::resolve_or_null(class_name, class_loader, protection_domain, CHECK_0); |
|
509 |
} else { |
|
510 |
if (class_name->byte_at(0) == 'L' && |
|
511 |
class_name->byte_at(class_name->utf8_length()-1) == ';') { |
|
512 |
// This is a name from a signature. Strip off the trimmings. |
|
513 |
// Call recursive to keep scope of strippedsym. |
|
514 |
TempNewSymbol strippedsym = SymbolTable::new_symbol(class_name->as_utf8()+1, |
|
515 |
class_name->utf8_length()-2, |
|
516 |
CHECK_0); |
|
517 |
resolved_klass = SystemDictionary::find(strippedsym, class_loader, protection_domain, CHECK_0); |
|
518 |
} else if (FieldType::is_array(class_name)) { |
|
519 |
FieldArrayInfo fd; |
|
520 |
// dimension and object_key in FieldArrayInfo are assigned as a side-effect |
|
521 |
// of this call |
|
522 |
BasicType t = FieldType::get_array_info(class_name, fd, CHECK_0); |
|
523 |
if (t == T_OBJECT) { |
|
524 |
TempNewSymbol strippedsym = SymbolTable::new_symbol(class_name->as_utf8()+1+fd.dimension(), |
|
525 |
class_name->utf8_length()-2-fd.dimension(), |
|
526 |
CHECK_0); |
|
527 |
// naked oop "k" is OK here -- we assign back into it |
|
528 |
resolved_klass = SystemDictionary::find(strippedsym, |
|
529 |
class_loader, |
|
530 |
protection_domain, |
|
531 |
CHECK_0); |
|
532 |
if (resolved_klass != NULL) { |
|
533 |
resolved_klass = resolved_klass->array_klass(fd.dimension(), CHECK_0); |
|
534 |
} |
|
535 |
} else { |
|
536 |
resolved_klass = Universe::typeArrayKlassObj(t); |
|
537 |
resolved_klass = TypeArrayKlass::cast(resolved_klass)->array_klass(fd.dimension(), CHECK_0); |
|
538 |
} |
|
539 |
} |
|
540 |
} |
|
541 |
Handle result = CompilerToVM::get_jvmci_type(resolved_klass, CHECK_NULL); |
|
542 |
return JNIHandles::make_local(THREAD, result()); |
|
543 |
C2V_END |
|
544 |
||
545 |
C2V_VMENTRY(jobject, resolveConstantInPool, (JNIEnv*, jobject, jobject jvmci_constant_pool, jint index)) |
|
546 |
constantPoolHandle cp = CompilerToVM::asConstantPool(jvmci_constant_pool); |
|
547 |
oop result = cp->resolve_constant_at(index, CHECK_NULL); |
|
548 |
return JNIHandles::make_local(THREAD, result); |
|
549 |
C2V_END |
|
550 |
||
551 |
C2V_VMENTRY(jobject, resolvePossiblyCachedConstantInPool, (JNIEnv*, jobject, jobject jvmci_constant_pool, jint index)) |
|
552 |
constantPoolHandle cp = CompilerToVM::asConstantPool(jvmci_constant_pool); |
|
553 |
oop result = cp->resolve_possibly_cached_constant_at(index, CHECK_NULL); |
|
554 |
return JNIHandles::make_local(THREAD, result); |
|
555 |
C2V_END |
|
556 |
||
557 |
C2V_VMENTRY(jint, lookupNameAndTypeRefIndexInPool, (JNIEnv*, jobject, jobject jvmci_constant_pool, jint index)) |
|
558 |
constantPoolHandle cp = CompilerToVM::asConstantPool(jvmci_constant_pool); |
|
559 |
return cp->name_and_type_ref_index_at(index); |
|
560 |
C2V_END |
|
561 |
||
562 |
C2V_VMENTRY(jobject, lookupNameInPool, (JNIEnv*, jobject, jobject jvmci_constant_pool, jint which)) |
|
563 |
constantPoolHandle cp = CompilerToVM::asConstantPool(jvmci_constant_pool); |
|
564 |
Handle sym = java_lang_String::create_from_symbol(cp->name_ref_at(which), CHECK_NULL); |
|
565 |
return JNIHandles::make_local(THREAD, sym()); |
|
566 |
C2V_END |
|
567 |
||
568 |
C2V_VMENTRY(jobject, lookupSignatureInPool, (JNIEnv*, jobject, jobject jvmci_constant_pool, jint which)) |
|
569 |
constantPoolHandle cp = CompilerToVM::asConstantPool(jvmci_constant_pool); |
|
570 |
Handle sym = java_lang_String::create_from_symbol(cp->signature_ref_at(which), CHECK_NULL); |
|
571 |
return JNIHandles::make_local(THREAD, sym()); |
|
572 |
C2V_END |
|
573 |
||
574 |
C2V_VMENTRY(jint, lookupKlassRefIndexInPool, (JNIEnv*, jobject, jobject jvmci_constant_pool, jint index)) |
|
575 |
constantPoolHandle cp = CompilerToVM::asConstantPool(jvmci_constant_pool); |
|
576 |
return cp->klass_ref_index_at(index); |
|
577 |
C2V_END |
|
578 |
||
579 |
C2V_VMENTRY(jobject, resolveTypeInPool, (JNIEnv*, jobject, jobject jvmci_constant_pool, jint index)) |
|
580 |
constantPoolHandle cp = CompilerToVM::asConstantPool(jvmci_constant_pool); |
|
581 |
Klass* resolved_klass = cp->klass_at(index, CHECK_NULL); |
|
582 |
Handle klass = CompilerToVM::get_jvmci_type(resolved_klass, CHECK_NULL); |
|
583 |
return JNIHandles::make_local(THREAD, klass()); |
|
584 |
C2V_END |
|
585 |
||
586 |
C2V_VMENTRY(jobject, lookupKlassInPool, (JNIEnv*, jobject, jobject jvmci_constant_pool, jint index, jbyte opcode)) |
|
587 |
constantPoolHandle cp = CompilerToVM::asConstantPool(jvmci_constant_pool); |
|
588 |
KlassHandle loading_klass(cp->pool_holder()); |
|
589 |
bool is_accessible = false; |
|
590 |
KlassHandle klass = JVMCIEnv::get_klass_by_index(cp, index, is_accessible, loading_klass); |
|
591 |
Symbol* symbol = NULL; |
|
592 |
if (klass.is_null()) { |
|
593 |
symbol = cp->klass_name_at(index); |
|
594 |
} |
|
595 |
Handle result; |
|
596 |
if (!klass.is_null()) { |
|
597 |
result = CompilerToVM::get_jvmci_type(klass, CHECK_NULL); |
|
598 |
} else { |
|
599 |
result = java_lang_String::create_from_symbol(symbol, CHECK_NULL); |
|
600 |
} |
|
601 |
return JNIHandles::make_local(THREAD, result()); |
|
602 |
C2V_END |
|
603 |
||
604 |
C2V_VMENTRY(jobject, lookupAppendixInPool, (JNIEnv*, jobject, jobject jvmci_constant_pool, jint index)) |
|
605 |
constantPoolHandle cp = CompilerToVM::asConstantPool(jvmci_constant_pool); |
|
606 |
oop appendix_oop = ConstantPool::appendix_at_if_loaded(cp, index); |
|
607 |
return JNIHandles::make_local(THREAD, appendix_oop); |
|
608 |
C2V_END |
|
609 |
||
610 |
C2V_VMENTRY(jobject, lookupMethodInPool, (JNIEnv*, jobject, jobject jvmci_constant_pool, jint index, jbyte opcode)) |
|
611 |
constantPoolHandle cp = CompilerToVM::asConstantPool(jvmci_constant_pool); |
|
612 |
instanceKlassHandle pool_holder(cp->pool_holder()); |
|
613 |
Bytecodes::Code bc = (Bytecodes::Code) (((int) opcode) & 0xFF); |
|
614 |
methodHandle method = JVMCIEnv::get_method_by_index(cp, index, bc, pool_holder); |
|
615 |
oop result = CompilerToVM::get_jvmci_method(method, CHECK_NULL); |
|
616 |
return JNIHandles::make_local(THREAD, result); |
|
617 |
C2V_END |
|
618 |
||
619 |
C2V_VMENTRY(jint, constantPoolRemapInstructionOperandFromCache, (JNIEnv*, jobject, jobject jvmci_constant_pool, jint index)) |
|
620 |
constantPoolHandle cp = CompilerToVM::asConstantPool(jvmci_constant_pool); |
|
621 |
return cp->remap_instruction_operand_from_cache(index); |
|
622 |
C2V_END |
|
623 |
||
39421
a9652c919db8
8157181: Compilers accept modification of final fields outside initializer methods
zmajo
parents:
38719
diff
changeset
|
624 |
C2V_VMENTRY(jobject, resolveFieldInPool, (JNIEnv*, jobject, jobject jvmci_constant_pool, jint index, jobject jvmci_method, jbyte opcode, jlongArray info_handle)) |
33160 | 625 |
ResourceMark rm; |
626 |
constantPoolHandle cp = CompilerToVM::asConstantPool(jvmci_constant_pool); |
|
627 |
Bytecodes::Code code = (Bytecodes::Code)(((int) opcode) & 0xFF); |
|
628 |
fieldDescriptor fd; |
|
39421
a9652c919db8
8157181: Compilers accept modification of final fields outside initializer methods
zmajo
parents:
38719
diff
changeset
|
629 |
LinkInfo link_info(cp, index, (jvmci_method != NULL) ? CompilerToVM::asMethod(jvmci_method) : NULL, CHECK_0); |
33160 | 630 |
LinkResolver::resolve_field(fd, link_info, Bytecodes::java_code(code), false, CHECK_0); |
631 |
typeArrayOop info = (typeArrayOop) JNIHandles::resolve(info_handle); |
|
632 |
assert(info != NULL && info->length() == 2, "must be"); |
|
633 |
info->long_at_put(0, (jlong) fd.access_flags().as_int()); |
|
634 |
info->long_at_put(1, (jlong) fd.offset()); |
|
635 |
oop field_holder = CompilerToVM::get_jvmci_type(fd.field_holder(), CHECK_NULL); |
|
636 |
return JNIHandles::make_local(THREAD, field_holder); |
|
637 |
C2V_END |
|
638 |
||
639 |
C2V_VMENTRY(jint, getVtableIndexForInterfaceMethod, (JNIEnv *, jobject, jobject jvmci_type, jobject jvmci_method)) |
|
640 |
ResourceMark rm; |
|
641 |
Klass* klass = CompilerToVM::asKlass(jvmci_type); |
|
642 |
Method* method = CompilerToVM::asMethod(jvmci_method); |
|
643 |
if (klass->is_interface()) { |
|
644 |
THROW_MSG_0(vmSymbols::java_lang_InternalError(), err_msg("Interface %s should be handled in Java code", klass->external_name())); |
|
645 |
} |
|
646 |
if (!method->method_holder()->is_interface()) { |
|
647 |
THROW_MSG_0(vmSymbols::java_lang_InternalError(), err_msg("Method %s is not held by an interface, this case should be handled in Java code", method->name_and_sig_as_C_string())); |
|
648 |
} |
|
33632 | 649 |
if (!InstanceKlass::cast(klass)->is_linked()) { |
650 |
THROW_MSG_0(vmSymbols::java_lang_InternalError(), err_msg("Class %s must be linked", klass->external_name())); |
|
33160 | 651 |
} |
652 |
return LinkResolver::vtable_index_of_interface_method(klass, method); |
|
653 |
C2V_END |
|
654 |
||
655 |
C2V_VMENTRY(jobject, resolveMethod, (JNIEnv *, jobject, jobject receiver_jvmci_type, jobject jvmci_method, jobject caller_jvmci_type)) |
|
38139
cf6f5c1b7205
8152903: [JVMCI] CompilerToVM::resolveMethod should correctly handle private methods in interfaces
never
parents:
38133
diff
changeset
|
656 |
KlassHandle recv_klass = CompilerToVM::asKlass(receiver_jvmci_type); |
cf6f5c1b7205
8152903: [JVMCI] CompilerToVM::resolveMethod should correctly handle private methods in interfaces
never
parents:
38133
diff
changeset
|
657 |
KlassHandle caller_klass = CompilerToVM::asKlass(caller_jvmci_type); |
cf6f5c1b7205
8152903: [JVMCI] CompilerToVM::resolveMethod should correctly handle private methods in interfaces
never
parents:
38133
diff
changeset
|
658 |
methodHandle method = CompilerToVM::asMethod(jvmci_method); |
33160 | 659 |
|
38139
cf6f5c1b7205
8152903: [JVMCI] CompilerToVM::resolveMethod should correctly handle private methods in interfaces
never
parents:
38133
diff
changeset
|
660 |
KlassHandle h_resolved (THREAD, method->method_holder()); |
cf6f5c1b7205
8152903: [JVMCI] CompilerToVM::resolveMethod should correctly handle private methods in interfaces
never
parents:
38133
diff
changeset
|
661 |
Symbol* h_name = method->name(); |
cf6f5c1b7205
8152903: [JVMCI] CompilerToVM::resolveMethod should correctly handle private methods in interfaces
never
parents:
38133
diff
changeset
|
662 |
Symbol* h_signature = method->signature(); |
33160 | 663 |
|
38719
133bf85c3f36
8145148: InterfaceMethod CP entry pointing to a class should cause ICCE
coleenp
parents:
38695
diff
changeset
|
664 |
LinkInfo link_info(h_resolved, h_name, h_signature, caller_klass); |
38139
cf6f5c1b7205
8152903: [JVMCI] CompilerToVM::resolveMethod should correctly handle private methods in interfaces
never
parents:
38133
diff
changeset
|
665 |
methodHandle m; |
cf6f5c1b7205
8152903: [JVMCI] CompilerToVM::resolveMethod should correctly handle private methods in interfaces
never
parents:
38133
diff
changeset
|
666 |
// Only do exact lookup if receiver klass has been linked. Otherwise, |
cf6f5c1b7205
8152903: [JVMCI] CompilerToVM::resolveMethod should correctly handle private methods in interfaces
never
parents:
38133
diff
changeset
|
667 |
// the vtable has not been setup, and the LinkResolver will fail. |
cf6f5c1b7205
8152903: [JVMCI] CompilerToVM::resolveMethod should correctly handle private methods in interfaces
never
parents:
38133
diff
changeset
|
668 |
if (recv_klass->is_array_klass() || |
cf6f5c1b7205
8152903: [JVMCI] CompilerToVM::resolveMethod should correctly handle private methods in interfaces
never
parents:
38133
diff
changeset
|
669 |
InstanceKlass::cast(recv_klass())->is_linked() && !recv_klass->is_interface()) { |
cf6f5c1b7205
8152903: [JVMCI] CompilerToVM::resolveMethod should correctly handle private methods in interfaces
never
parents:
38133
diff
changeset
|
670 |
if (h_resolved->is_interface()) { |
cf6f5c1b7205
8152903: [JVMCI] CompilerToVM::resolveMethod should correctly handle private methods in interfaces
never
parents:
38133
diff
changeset
|
671 |
m = LinkResolver::resolve_interface_call_or_null(recv_klass, link_info); |
33160 | 672 |
} else { |
38139
cf6f5c1b7205
8152903: [JVMCI] CompilerToVM::resolveMethod should correctly handle private methods in interfaces
never
parents:
38133
diff
changeset
|
673 |
m = LinkResolver::resolve_virtual_call_or_null(recv_klass, link_info); |
33160 | 674 |
} |
675 |
} |
|
38139
cf6f5c1b7205
8152903: [JVMCI] CompilerToVM::resolveMethod should correctly handle private methods in interfaces
never
parents:
38133
diff
changeset
|
676 |
|
cf6f5c1b7205
8152903: [JVMCI] CompilerToVM::resolveMethod should correctly handle private methods in interfaces
never
parents:
38133
diff
changeset
|
677 |
if (m.is_null()) { |
cf6f5c1b7205
8152903: [JVMCI] CompilerToVM::resolveMethod should correctly handle private methods in interfaces
never
parents:
38133
diff
changeset
|
678 |
// Return NULL only if there was a problem with lookup (uninitialized class, etc.) |
cf6f5c1b7205
8152903: [JVMCI] CompilerToVM::resolveMethod should correctly handle private methods in interfaces
never
parents:
38133
diff
changeset
|
679 |
return NULL; |
cf6f5c1b7205
8152903: [JVMCI] CompilerToVM::resolveMethod should correctly handle private methods in interfaces
never
parents:
38133
diff
changeset
|
680 |
} |
cf6f5c1b7205
8152903: [JVMCI] CompilerToVM::resolveMethod should correctly handle private methods in interfaces
never
parents:
38133
diff
changeset
|
681 |
|
cf6f5c1b7205
8152903: [JVMCI] CompilerToVM::resolveMethod should correctly handle private methods in interfaces
never
parents:
38133
diff
changeset
|
682 |
oop result = CompilerToVM::get_jvmci_method(m, CHECK_NULL); |
cf6f5c1b7205
8152903: [JVMCI] CompilerToVM::resolveMethod should correctly handle private methods in interfaces
never
parents:
38133
diff
changeset
|
683 |
return JNIHandles::make_local(THREAD, result); |
33160 | 684 |
C2V_END |
685 |
||
686 |
C2V_VMENTRY(jboolean, hasFinalizableSubclass,(JNIEnv *, jobject, jobject jvmci_type)) |
|
687 |
Klass* klass = CompilerToVM::asKlass(jvmci_type); |
|
688 |
assert(klass != NULL, "method must not be called for primitive types"); |
|
689 |
return Dependencies::find_finalizable_subclass(klass) != NULL; |
|
690 |
C2V_END |
|
691 |
||
692 |
C2V_VMENTRY(jobject, getClassInitializer, (JNIEnv *, jobject, jobject jvmci_type)) |
|
693 |
InstanceKlass* klass = (InstanceKlass*) CompilerToVM::asKlass(jvmci_type); |
|
694 |
oop result = CompilerToVM::get_jvmci_method(klass->class_initializer(), CHECK_NULL); |
|
695 |
return JNIHandles::make_local(THREAD, result); |
|
696 |
C2V_END |
|
697 |
||
698 |
C2V_VMENTRY(jlong, getMaxCallTargetOffset, (JNIEnv*, jobject, jlong addr)) |
|
699 |
address target_addr = (address) addr; |
|
700 |
if (target_addr != 0x0) { |
|
701 |
int64_t off_low = (int64_t)target_addr - ((int64_t)CodeCache::low_bound() + sizeof(int)); |
|
702 |
int64_t off_high = (int64_t)target_addr - ((int64_t)CodeCache::high_bound() + sizeof(int)); |
|
703 |
return MAX2(ABS(off_low), ABS(off_high)); |
|
704 |
} |
|
705 |
return -1; |
|
706 |
C2V_END |
|
707 |
||
708 |
C2V_VMENTRY(void, doNotInlineOrCompile,(JNIEnv *, jobject, jobject jvmci_method)) |
|
709 |
methodHandle method = CompilerToVM::asMethod(jvmci_method); |
|
710 |
method->set_not_c1_compilable(); |
|
711 |
method->set_not_c2_compilable(); |
|
712 |
method->set_dont_inline(true); |
|
713 |
C2V_END |
|
714 |
||
715 |
C2V_VMENTRY(jint, installCode, (JNIEnv *jniEnv, jobject, jobject target, jobject compiled_code, jobject installed_code, jobject speculation_log)) |
|
716 |
ResourceMark rm; |
|
717 |
HandleMark hm; |
|
718 |
Handle target_handle = JNIHandles::resolve(target); |
|
719 |
Handle compiled_code_handle = JNIHandles::resolve(compiled_code); |
|
720 |
CodeBlob* cb = NULL; |
|
721 |
Handle installed_code_handle = JNIHandles::resolve(installed_code); |
|
722 |
Handle speculation_log_handle = JNIHandles::resolve(speculation_log); |
|
723 |
||
724 |
JVMCICompiler* compiler = JVMCICompiler::instance(CHECK_JNI_ERR); |
|
725 |
||
726 |
TraceTime install_time("installCode", JVMCICompiler::codeInstallTimer()); |
|
727 |
CodeInstaller installer; |
|
34153
cbcfa2a6fe0b
8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
33632
diff
changeset
|
728 |
JVMCIEnv::CodeInstallResult result = installer.install(compiler, target_handle, compiled_code_handle, cb, installed_code_handle, speculation_log_handle, CHECK_0); |
33160 | 729 |
|
730 |
if (PrintCodeCacheOnCompilation) { |
|
731 |
stringStream s; |
|
732 |
// Dump code cache into a buffer before locking the tty, |
|
733 |
{ |
|
734 |
MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); |
|
735 |
CodeCache::print_summary(&s, false); |
|
736 |
} |
|
737 |
ttyLocker ttyl; |
|
738 |
tty->print_raw_cr(s.as_string()); |
|
739 |
} |
|
740 |
||
741 |
if (result != JVMCIEnv::ok) { |
|
742 |
assert(cb == NULL, "should be"); |
|
743 |
} else { |
|
744 |
if (!installed_code_handle.is_null()) { |
|
745 |
assert(installed_code_handle->is_a(InstalledCode::klass()), "wrong type"); |
|
35092
82170e5767c3
8143571: [JVMCI] Double unregistering of nmethod during unloading
never
parents:
34317
diff
changeset
|
746 |
nmethod::invalidate_installed_code(installed_code_handle, CHECK_0); |
82170e5767c3
8143571: [JVMCI] Double unregistering of nmethod during unloading
never
parents:
34317
diff
changeset
|
747 |
{ |
82170e5767c3
8143571: [JVMCI] Double unregistering of nmethod during unloading
never
parents:
34317
diff
changeset
|
748 |
// Ensure that all updates to the InstalledCode fields are consistent. |
82170e5767c3
8143571: [JVMCI] Double unregistering of nmethod during unloading
never
parents:
34317
diff
changeset
|
749 |
MutexLockerEx pl(Patching_lock, Mutex::_no_safepoint_check_flag); |
82170e5767c3
8143571: [JVMCI] Double unregistering of nmethod during unloading
never
parents:
34317
diff
changeset
|
750 |
InstalledCode::set_address(installed_code_handle, (jlong) cb); |
82170e5767c3
8143571: [JVMCI] Double unregistering of nmethod during unloading
never
parents:
34317
diff
changeset
|
751 |
InstalledCode::set_version(installed_code_handle, InstalledCode::version(installed_code_handle) + 1); |
82170e5767c3
8143571: [JVMCI] Double unregistering of nmethod during unloading
never
parents:
34317
diff
changeset
|
752 |
if (cb->is_nmethod()) { |
82170e5767c3
8143571: [JVMCI] Double unregistering of nmethod during unloading
never
parents:
34317
diff
changeset
|
753 |
InstalledCode::set_entryPoint(installed_code_handle, (jlong) cb->as_nmethod_or_null()->verified_entry_point()); |
82170e5767c3
8143571: [JVMCI] Double unregistering of nmethod during unloading
never
parents:
34317
diff
changeset
|
754 |
} else { |
82170e5767c3
8143571: [JVMCI] Double unregistering of nmethod during unloading
never
parents:
34317
diff
changeset
|
755 |
InstalledCode::set_entryPoint(installed_code_handle, (jlong) cb->code_begin()); |
82170e5767c3
8143571: [JVMCI] Double unregistering of nmethod during unloading
never
parents:
34317
diff
changeset
|
756 |
} |
82170e5767c3
8143571: [JVMCI] Double unregistering of nmethod during unloading
never
parents:
34317
diff
changeset
|
757 |
if (installed_code_handle->is_a(HotSpotInstalledCode::klass())) { |
82170e5767c3
8143571: [JVMCI] Double unregistering of nmethod during unloading
never
parents:
34317
diff
changeset
|
758 |
HotSpotInstalledCode::set_size(installed_code_handle, cb->size()); |
82170e5767c3
8143571: [JVMCI] Double unregistering of nmethod during unloading
never
parents:
34317
diff
changeset
|
759 |
HotSpotInstalledCode::set_codeStart(installed_code_handle, (jlong) cb->code_begin()); |
82170e5767c3
8143571: [JVMCI] Double unregistering of nmethod during unloading
never
parents:
34317
diff
changeset
|
760 |
HotSpotInstalledCode::set_codeSize(installed_code_handle, cb->code_size()); |
82170e5767c3
8143571: [JVMCI] Double unregistering of nmethod during unloading
never
parents:
34317
diff
changeset
|
761 |
} |
33160 | 762 |
} |
763 |
nmethod* nm = cb->as_nmethod_or_null(); |
|
764 |
if (nm != NULL && installed_code_handle->is_scavengable()) { |
|
765 |
assert(nm->detect_scavenge_root_oops(), "nm should be scavengable if installed_code is scavengable"); |
|
766 |
if (!UseG1GC) { |
|
767 |
assert(nm->on_scavenge_root_list(), "nm should be on scavengable list"); |
|
768 |
} |
|
769 |
} |
|
770 |
} |
|
771 |
} |
|
772 |
return result; |
|
773 |
C2V_END |
|
774 |
||
775 |
C2V_VMENTRY(jint, getMetadata, (JNIEnv *jniEnv, jobject, jobject target, jobject compiled_code, jobject metadata)) |
|
776 |
ResourceMark rm; |
|
777 |
HandleMark hm; |
|
778 |
||
779 |
Handle target_handle = JNIHandles::resolve(target); |
|
780 |
Handle compiled_code_handle = JNIHandles::resolve(compiled_code); |
|
781 |
Handle metadata_handle = JNIHandles::resolve(metadata); |
|
782 |
||
783 |
CodeMetadata code_metadata; |
|
784 |
CodeBlob *cb = NULL; |
|
785 |
CodeInstaller installer; |
|
786 |
||
38695 | 787 |
JVMCIEnv::CodeInstallResult result = installer.gather_metadata(target_handle, compiled_code_handle, code_metadata, CHECK_0); |
33160 | 788 |
if (result != JVMCIEnv::ok) { |
789 |
return result; |
|
790 |
} |
|
791 |
||
792 |
if (code_metadata.get_nr_pc_desc() > 0) { |
|
793 |
typeArrayHandle pcArrayOop = oopFactory::new_byteArray(sizeof(PcDesc) * code_metadata.get_nr_pc_desc(), CHECK_(JVMCIEnv::cache_full)); |
|
794 |
memcpy(pcArrayOop->byte_at_addr(0), code_metadata.get_pc_desc(), sizeof(PcDesc) * code_metadata.get_nr_pc_desc()); |
|
795 |
HotSpotMetaData::set_pcDescBytes(metadata_handle, pcArrayOop()); |
|
796 |
} |
|
797 |
||
798 |
if (code_metadata.get_scopes_size() > 0) { |
|
799 |
typeArrayHandle scopesArrayOop = oopFactory::new_byteArray(code_metadata.get_scopes_size(), CHECK_(JVMCIEnv::cache_full)); |
|
800 |
memcpy(scopesArrayOop->byte_at_addr(0), code_metadata.get_scopes_desc(), code_metadata.get_scopes_size()); |
|
801 |
HotSpotMetaData::set_scopesDescBytes(metadata_handle, scopesArrayOop()); |
|
802 |
} |
|
803 |
||
804 |
RelocBuffer* reloc_buffer = code_metadata.get_reloc_buffer(); |
|
805 |
typeArrayHandle relocArrayOop = oopFactory::new_byteArray((int) reloc_buffer->size(), CHECK_(JVMCIEnv::cache_full)); |
|
806 |
if (reloc_buffer->size() > 0) { |
|
807 |
memcpy(relocArrayOop->byte_at_addr(0), reloc_buffer->begin(), reloc_buffer->size()); |
|
808 |
} |
|
809 |
HotSpotMetaData::set_relocBytes(metadata_handle, relocArrayOop()); |
|
810 |
||
811 |
const OopMapSet* oopMapSet = installer.oopMapSet(); |
|
812 |
{ |
|
813 |
ResourceMark mark; |
|
814 |
ImmutableOopMapBuilder builder(oopMapSet); |
|
815 |
int oopmap_size = builder.heap_size(); |
|
816 |
typeArrayHandle oopMapArrayHandle = oopFactory::new_byteArray(oopmap_size, CHECK_(JVMCIEnv::cache_full)); |
|
817 |
builder.generate_into((address) oopMapArrayHandle->byte_at_addr(0)); |
|
818 |
HotSpotMetaData::set_oopMaps(metadata_handle, oopMapArrayHandle()); |
|
819 |
} |
|
820 |
||
821 |
HotSpotMetaData::set_metadata(metadata_handle, NULL); |
|
822 |
||
823 |
ExceptionHandlerTable* handler = code_metadata.get_exception_table(); |
|
824 |
int table_size = handler->size_in_bytes(); |
|
825 |
typeArrayHandle exceptionArrayOop = oopFactory::new_byteArray(table_size, CHECK_(JVMCIEnv::cache_full)); |
|
826 |
||
827 |
if (table_size > 0) { |
|
828 |
handler->copy_bytes_to((address) exceptionArrayOop->byte_at_addr(0)); |
|
829 |
} |
|
830 |
HotSpotMetaData::set_exceptionBytes(metadata_handle, exceptionArrayOop()); |
|
831 |
||
832 |
return result; |
|
833 |
C2V_END |
|
834 |
||
835 |
C2V_VMENTRY(void, resetCompilationStatistics, (JNIEnv *jniEnv, jobject)) |
|
836 |
JVMCICompiler* compiler = JVMCICompiler::instance(CHECK); |
|
837 |
CompilerStatistics* stats = compiler->stats(); |
|
838 |
stats->_standard.reset(); |
|
839 |
stats->_osr.reset(); |
|
840 |
C2V_END |
|
841 |
||
33632 | 842 |
C2V_VMENTRY(jobject, disassembleCodeBlob, (JNIEnv *jniEnv, jobject, jobject installedCode)) |
33160 | 843 |
ResourceMark rm; |
844 |
HandleMark hm; |
|
845 |
||
33632 | 846 |
if (installedCode == NULL) { |
847 |
THROW_MSG_NULL(vmSymbols::java_lang_NullPointerException(), "installedCode is null"); |
|
848 |
} |
|
849 |
||
850 |
jlong codeBlob = InstalledCode::address(installedCode); |
|
851 |
if (codeBlob == 0L) { |
|
852 |
return NULL; |
|
853 |
} |
|
854 |
||
33160 | 855 |
CodeBlob* cb = (CodeBlob*) (address) codeBlob; |
856 |
if (cb == NULL) { |
|
857 |
return NULL; |
|
858 |
} |
|
859 |
||
860 |
// We don't want the stringStream buffer to resize during disassembly as it |
|
861 |
// uses scoped resource memory. If a nested function called during disassembly uses |
|
862 |
// a ResourceMark and the buffer expands within the scope of the mark, |
|
863 |
// the buffer becomes garbage when that scope is exited. Experience shows that |
|
864 |
// the disassembled code is typically about 10x the code size so a fixed buffer |
|
865 |
// sized to 20x code size plus a fixed amount for header info should be sufficient. |
|
866 |
int bufferSize = cb->code_size() * 20 + 1024; |
|
867 |
char* buffer = NEW_RESOURCE_ARRAY(char, bufferSize); |
|
868 |
stringStream st(buffer, bufferSize); |
|
869 |
if (cb->is_nmethod()) { |
|
870 |
nmethod* nm = (nmethod*) cb; |
|
871 |
if (!nm->is_alive()) { |
|
872 |
return NULL; |
|
873 |
} |
|
874 |
} |
|
35542
9dccb7f9f656
8071374: -XX:+PrintAssembly -XX:+PrintSignatureHandlers crash fastdebug VM with assert(limit == __null || limit <= nm->code_end()) in RelocIterator::initialize
vlivanov
parents:
35123
diff
changeset
|
875 |
Disassembler::decode(cb, &st); |
33160 | 876 |
if (st.size() <= 0) { |
877 |
return NULL; |
|
878 |
} |
|
879 |
||
880 |
Handle result = java_lang_String::create_from_platform_dependent_str(st.as_string(), CHECK_NULL); |
|
881 |
return JNIHandles::make_local(THREAD, result()); |
|
882 |
C2V_END |
|
883 |
||
884 |
C2V_VMENTRY(jobject, getStackTraceElement, (JNIEnv*, jobject, jobject jvmci_method, int bci)) |
|
885 |
ResourceMark rm; |
|
886 |
HandleMark hm; |
|
887 |
||
888 |
methodHandle method = CompilerToVM::asMethod(jvmci_method); |
|
889 |
oop element = java_lang_StackTraceElement::create(method, bci, CHECK_NULL); |
|
890 |
return JNIHandles::make_local(THREAD, element); |
|
891 |
C2V_END |
|
892 |
||
893 |
C2V_VMENTRY(jobject, executeInstalledCode, (JNIEnv*, jobject, jobject args, jobject hotspotInstalledCode)) |
|
894 |
ResourceMark rm; |
|
895 |
HandleMark hm; |
|
896 |
||
897 |
jlong nmethodValue = InstalledCode::address(hotspotInstalledCode); |
|
898 |
if (nmethodValue == 0L) { |
|
899 |
THROW_NULL(vmSymbols::jdk_vm_ci_code_InvalidInstalledCodeException()); |
|
900 |
} |
|
901 |
nmethod* nm = (nmethod*) (address) nmethodValue; |
|
902 |
methodHandle mh = nm->method(); |
|
903 |
Symbol* signature = mh->signature(); |
|
904 |
JavaCallArguments jca(mh->size_of_parameters()); |
|
905 |
||
906 |
JavaArgumentUnboxer jap(signature, &jca, (arrayOop) JNIHandles::resolve(args), mh->is_static()); |
|
907 |
JavaValue result(jap.get_ret_type()); |
|
908 |
jca.set_alternative_target(nm); |
|
909 |
JavaCalls::call(&result, mh, &jca, CHECK_NULL); |
|
910 |
||
911 |
if (jap.get_ret_type() == T_VOID) { |
|
912 |
return NULL; |
|
913 |
} else if (jap.get_ret_type() == T_OBJECT || jap.get_ret_type() == T_ARRAY) { |
|
914 |
return JNIHandles::make_local(THREAD, (oop) result.get_jobject()); |
|
915 |
} else { |
|
916 |
jvalue *value = (jvalue *) result.get_value_addr(); |
|
917 |
// Narrow the value down if required (Important on big endian machines) |
|
918 |
switch (jap.get_ret_type()) { |
|
919 |
case T_BOOLEAN: |
|
920 |
value->z = (jboolean) value->i; |
|
921 |
break; |
|
922 |
case T_BYTE: |
|
923 |
value->b = (jbyte) value->i; |
|
924 |
break; |
|
925 |
case T_CHAR: |
|
926 |
value->c = (jchar) value->i; |
|
927 |
break; |
|
928 |
case T_SHORT: |
|
929 |
value->s = (jshort) value->i; |
|
930 |
break; |
|
931 |
} |
|
932 |
oop o = java_lang_boxing_object::create(jap.get_ret_type(), value, CHECK_NULL); |
|
933 |
return JNIHandles::make_local(THREAD, o); |
|
934 |
} |
|
935 |
C2V_END |
|
936 |
||
937 |
C2V_VMENTRY(jlongArray, getLineNumberTable, (JNIEnv *, jobject, jobject jvmci_method)) |
|
938 |
Method* method = CompilerToVM::asMethod(jvmci_method); |
|
939 |
if (!method->has_linenumber_table()) { |
|
940 |
return NULL; |
|
941 |
} |
|
942 |
u2 num_entries = 0; |
|
943 |
CompressedLineNumberReadStream streamForSize(method->compressed_linenumber_table()); |
|
944 |
while (streamForSize.read_pair()) { |
|
945 |
num_entries++; |
|
946 |
} |
|
947 |
||
948 |
CompressedLineNumberReadStream stream(method->compressed_linenumber_table()); |
|
949 |
typeArrayOop result = oopFactory::new_longArray(2 * num_entries, CHECK_NULL); |
|
950 |
||
951 |
int i = 0; |
|
952 |
jlong value; |
|
953 |
while (stream.read_pair()) { |
|
954 |
value = ((long) stream.bci()); |
|
955 |
result->long_at_put(i, value); |
|
956 |
value = ((long) stream.line()); |
|
957 |
result->long_at_put(i + 1, value); |
|
958 |
i += 2; |
|
959 |
} |
|
960 |
||
961 |
return (jlongArray) JNIHandles::make_local(THREAD, result); |
|
962 |
C2V_END |
|
963 |
||
964 |
C2V_VMENTRY(jlong, getLocalVariableTableStart, (JNIEnv *, jobject, jobject jvmci_method)) |
|
965 |
ResourceMark rm; |
|
966 |
Method* method = CompilerToVM::asMethod(jvmci_method); |
|
967 |
if (!method->has_localvariable_table()) { |
|
968 |
return 0; |
|
969 |
} |
|
970 |
return (jlong) (address) method->localvariable_table_start(); |
|
971 |
C2V_END |
|
972 |
||
973 |
C2V_VMENTRY(jint, getLocalVariableTableLength, (JNIEnv *, jobject, jobject jvmci_method)) |
|
974 |
ResourceMark rm; |
|
975 |
Method* method = CompilerToVM::asMethod(jvmci_method); |
|
976 |
return method->localvariable_table_length(); |
|
977 |
C2V_END |
|
978 |
||
979 |
C2V_VMENTRY(void, reprofile, (JNIEnv*, jobject, jobject jvmci_method)) |
|
980 |
Method* method = CompilerToVM::asMethod(jvmci_method); |
|
981 |
MethodCounters* mcs = method->method_counters(); |
|
982 |
if (mcs != NULL) { |
|
983 |
mcs->clear_counters(); |
|
984 |
} |
|
985 |
NOT_PRODUCT(method->set_compiled_invocation_count(0)); |
|
986 |
||
38133
78b95467b9f1
8151956: Support non-continuous CodeBlobs in HotSpot
rbackman
parents:
37296
diff
changeset
|
987 |
CompiledMethod* code = method->code(); |
33160 | 988 |
if (code != NULL) { |
989 |
code->make_not_entrant(); |
|
990 |
} |
|
991 |
||
992 |
MethodData* method_data = method->method_data(); |
|
993 |
if (method_data == NULL) { |
|
994 |
ClassLoaderData* loader_data = method->method_holder()->class_loader_data(); |
|
995 |
method_data = MethodData::allocate(loader_data, method, CHECK); |
|
996 |
method->set_method_data(method_data); |
|
997 |
} else { |
|
998 |
method_data->initialize(); |
|
999 |
} |
|
1000 |
C2V_END |
|
1001 |
||
1002 |
||
33632 | 1003 |
C2V_VMENTRY(void, invalidateInstalledCode, (JNIEnv*, jobject, jobject installed_code)) |
1004 |
Handle installed_code_handle = JNIHandles::resolve(installed_code); |
|
35092
82170e5767c3
8143571: [JVMCI] Double unregistering of nmethod during unloading
never
parents:
34317
diff
changeset
|
1005 |
nmethod::invalidate_installed_code(installed_code_handle, CHECK); |
33160 | 1006 |
C2V_END |
1007 |
||
1008 |
C2V_VMENTRY(jlongArray, collectCounters, (JNIEnv*, jobject)) |
|
1009 |
typeArrayOop arrayOop = oopFactory::new_longArray(JVMCICounterSize, CHECK_NULL); |
|
1010 |
JavaThread::collect_counters(arrayOop); |
|
1011 |
return (jlongArray) JNIHandles::make_local(THREAD, arrayOop); |
|
1012 |
C2V_END |
|
1013 |
||
1014 |
C2V_VMENTRY(int, allocateCompileId, (JNIEnv*, jobject, jobject jvmci_method, int entry_bci)) |
|
1015 |
HandleMark hm; |
|
1016 |
ResourceMark rm; |
|
1017 |
if (JNIHandles::resolve(jvmci_method) == NULL) { |
|
1018 |
THROW_0(vmSymbols::java_lang_NullPointerException()); |
|
1019 |
} |
|
1020 |
Method* method = CompilerToVM::asMethod(jvmci_method); |
|
1021 |
if (entry_bci >= method->code_size() || entry_bci < -1) { |
|
1022 |
THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), err_msg("Unexpected bci %d", entry_bci)); |
|
1023 |
} |
|
1024 |
return CompileBroker::assign_compile_id_unlocked(THREAD, method, entry_bci); |
|
1025 |
C2V_END |
|
1026 |
||
1027 |
||
1028 |
C2V_VMENTRY(jboolean, isMature, (JNIEnv*, jobject, jlong metaspace_method_data)) |
|
1029 |
MethodData* mdo = CompilerToVM::asMethodData(metaspace_method_data); |
|
1030 |
return mdo != NULL && mdo->is_mature(); |
|
1031 |
C2V_END |
|
1032 |
||
1033 |
C2V_VMENTRY(jboolean, hasCompiledCodeForOSR, (JNIEnv*, jobject, jobject jvmci_method, int entry_bci, int comp_level)) |
|
1034 |
Method* method = CompilerToVM::asMethod(jvmci_method); |
|
1035 |
return method->lookup_osr_nmethod_for(entry_bci, comp_level, true) != NULL; |
|
1036 |
C2V_END |
|
1037 |
||
1038 |
C2V_VMENTRY(jobject, getSymbol, (JNIEnv*, jobject, jlong symbol)) |
|
1039 |
Handle sym = java_lang_String::create_from_symbol((Symbol*)(address)symbol, CHECK_NULL); |
|
1040 |
return JNIHandles::make_local(THREAD, sym()); |
|
1041 |
C2V_END |
|
1042 |
||
1043 |
bool matches(jobjectArray methods, Method* method) { |
|
1044 |
objArrayOop methods_oop = (objArrayOop) JNIHandles::resolve(methods); |
|
1045 |
||
1046 |
for (int i = 0; i < methods_oop->length(); i++) { |
|
33632 | 1047 |
oop resolved = methods_oop->obj_at(i); |
1048 |
if (resolved->is_a(HotSpotResolvedJavaMethodImpl::klass()) && CompilerToVM::asMethod(resolved) == method) { |
|
33160 | 1049 |
return true; |
1050 |
} |
|
1051 |
} |
|
1052 |
return false; |
|
1053 |
} |
|
1054 |
||
1055 |
C2V_VMENTRY(jobject, getNextStackFrame, (JNIEnv*, jobject compilerToVM, jobject hs_frame, jobjectArray methods, jint initialSkip)) |
|
1056 |
ResourceMark rm; |
|
1057 |
||
1058 |
if (!thread->has_last_Java_frame()) return NULL; |
|
1059 |
Handle result = HotSpotStackFrameReference::klass()->allocate_instance(thread); |
|
1060 |
HotSpotStackFrameReference::klass()->initialize(thread); |
|
1061 |
||
1062 |
StackFrameStream fst(thread); |
|
1063 |
if (hs_frame != NULL) { |
|
1064 |
// look for the correct stack frame if one is given |
|
1065 |
intptr_t* stack_pointer = (intptr_t*) HotSpotStackFrameReference::stackPointer(hs_frame); |
|
1066 |
while (fst.current()->sp() != stack_pointer && !fst.is_done()) { |
|
1067 |
fst.next(); |
|
1068 |
} |
|
1069 |
if (fst.current()->sp() != stack_pointer) { |
|
1070 |
THROW_MSG_NULL(vmSymbols::java_lang_IllegalStateException(), "stack frame not found") |
|
1071 |
} |
|
1072 |
} |
|
1073 |
||
1074 |
int frame_number = 0; |
|
1075 |
vframe* vf = vframe::new_vframe(fst.current(), fst.register_map(), thread); |
|
1076 |
if (hs_frame != NULL) { |
|
1077 |
// look for the correct vframe within the stack frame if one is given |
|
1078 |
int last_frame_number = HotSpotStackFrameReference::frameNumber(hs_frame); |
|
1079 |
while (frame_number < last_frame_number) { |
|
1080 |
if (vf->is_top()) { |
|
1081 |
THROW_MSG_NULL(vmSymbols::java_lang_IllegalStateException(), "invalid frame number") |
|
1082 |
} |
|
1083 |
vf = vf->sender(); |
|
1084 |
frame_number ++; |
|
1085 |
} |
|
1086 |
// move one frame forward |
|
1087 |
if (vf->is_top()) { |
|
1088 |
if (fst.is_done()) { |
|
1089 |
return NULL; |
|
1090 |
} |
|
1091 |
fst.next(); |
|
1092 |
vf = vframe::new_vframe(fst.current(), fst.register_map(), thread); |
|
1093 |
frame_number = 0; |
|
1094 |
} else { |
|
1095 |
vf = vf->sender(); |
|
1096 |
frame_number++; |
|
1097 |
} |
|
1098 |
} |
|
1099 |
||
1100 |
while (true) { |
|
1101 |
// look for the given method |
|
1102 |
while (true) { |
|
1103 |
StackValueCollection* locals = NULL; |
|
1104 |
if (vf->is_compiled_frame()) { |
|
1105 |
// compiled method frame |
|
1106 |
compiledVFrame* cvf = compiledVFrame::cast(vf); |
|
1107 |
if (methods == NULL || matches(methods, cvf->method())) { |
|
1108 |
if (initialSkip > 0) { |
|
1109 |
initialSkip --; |
|
1110 |
} else { |
|
1111 |
ScopeDesc* scope = cvf->scope(); |
|
1112 |
// native wrapper do not have a scope |
|
1113 |
if (scope != NULL && scope->objects() != NULL) { |
|
1114 |
bool realloc_failures = Deoptimization::realloc_objects(thread, fst.current(), scope->objects(), THREAD); |
|
1115 |
Deoptimization::reassign_fields(fst.current(), fst.register_map(), scope->objects(), realloc_failures, false); |
|
1116 |
||
1117 |
GrowableArray<ScopeValue*>* local_values = scope->locals(); |
|
1118 |
typeArrayHandle array = oopFactory::new_boolArray(local_values->length(), thread); |
|
1119 |
for (int i = 0; i < local_values->length(); i++) { |
|
1120 |
ScopeValue* value = local_values->at(i); |
|
1121 |
if (value->is_object()) { |
|
1122 |
array->bool_at_put(i, true); |
|
1123 |
} |
|
1124 |
} |
|
1125 |
HotSpotStackFrameReference::set_localIsVirtual(result, array()); |
|
1126 |
} else { |
|
1127 |
HotSpotStackFrameReference::set_localIsVirtual(result, NULL); |
|
1128 |
} |
|
1129 |
||
1130 |
locals = cvf->locals(); |
|
1131 |
HotSpotStackFrameReference::set_bci(result, cvf->bci()); |
|
1132 |
oop method = CompilerToVM::get_jvmci_method(cvf->method(), CHECK_NULL); |
|
1133 |
HotSpotStackFrameReference::set_method(result, method); |
|
1134 |
} |
|
1135 |
} |
|
1136 |
} else if (vf->is_interpreted_frame()) { |
|
1137 |
// interpreted method frame |
|
1138 |
interpretedVFrame* ivf = interpretedVFrame::cast(vf); |
|
1139 |
if (methods == NULL || matches(methods, ivf->method())) { |
|
1140 |
if (initialSkip > 0) { |
|
1141 |
initialSkip --; |
|
1142 |
} else { |
|
1143 |
locals = ivf->locals(); |
|
1144 |
HotSpotStackFrameReference::set_bci(result, ivf->bci()); |
|
1145 |
oop method = CompilerToVM::get_jvmci_method(ivf->method(), CHECK_NULL); |
|
1146 |
HotSpotStackFrameReference::set_method(result, method); |
|
1147 |
HotSpotStackFrameReference::set_localIsVirtual(result, NULL); |
|
1148 |
} |
|
1149 |
} |
|
1150 |
} |
|
1151 |
||
1152 |
// locals != NULL means that we found a matching frame and result is already partially initialized |
|
1153 |
if (locals != NULL) { |
|
1154 |
HotSpotStackFrameReference::set_compilerToVM(result, JNIHandles::resolve(compilerToVM)); |
|
1155 |
HotSpotStackFrameReference::set_stackPointer(result, (jlong) fst.current()->sp()); |
|
1156 |
HotSpotStackFrameReference::set_frameNumber(result, frame_number); |
|
1157 |
||
1158 |
// initialize the locals array |
|
1159 |
objArrayHandle array = oopFactory::new_objectArray(locals->size(), thread); |
|
1160 |
for (int i = 0; i < locals->size(); i++) { |
|
1161 |
StackValue* var = locals->at(i); |
|
1162 |
if (var->type() == T_OBJECT) { |
|
1163 |
array->obj_at_put(i, locals->at(i)->get_obj()()); |
|
1164 |
} |
|
1165 |
} |
|
1166 |
HotSpotStackFrameReference::set_locals(result, array()); |
|
1167 |
||
1168 |
return JNIHandles::make_local(thread, result()); |
|
1169 |
} |
|
1170 |
||
1171 |
if (vf->is_top()) { |
|
1172 |
break; |
|
1173 |
} |
|
1174 |
frame_number++; |
|
1175 |
vf = vf->sender(); |
|
1176 |
} // end of vframe loop |
|
1177 |
||
1178 |
if (fst.is_done()) { |
|
1179 |
break; |
|
1180 |
} |
|
1181 |
fst.next(); |
|
1182 |
vf = vframe::new_vframe(fst.current(), fst.register_map(), thread); |
|
1183 |
frame_number = 0; |
|
1184 |
} // end of frame loop |
|
1185 |
||
1186 |
// the end was reached without finding a matching method |
|
1187 |
return NULL; |
|
1188 |
C2V_END |
|
1189 |
||
1190 |
C2V_VMENTRY(void, resolveInvokeDynamicInPool, (JNIEnv*, jobject, jobject jvmci_constant_pool, jint index)) |
|
1191 |
constantPoolHandle cp = CompilerToVM::asConstantPool(jvmci_constant_pool); |
|
1192 |
CallInfo callInfo; |
|
1193 |
LinkResolver::resolve_invoke(callInfo, Handle(), cp, index, Bytecodes::_invokedynamic, CHECK); |
|
1194 |
ConstantPoolCacheEntry* cp_cache_entry = cp->invokedynamic_cp_cache_entry_at(index); |
|
1195 |
cp_cache_entry->set_dynamic_call(cp, callInfo); |
|
1196 |
C2V_END |
|
1197 |
||
1198 |
C2V_VMENTRY(void, resolveInvokeHandleInPool, (JNIEnv*, jobject, jobject jvmci_constant_pool, jint index)) |
|
1199 |
constantPoolHandle cp = CompilerToVM::asConstantPool(jvmci_constant_pool); |
|
1200 |
CallInfo callInfo; |
|
1201 |
LinkResolver::resolve_invoke(callInfo, Handle(), cp, index, Bytecodes::_invokehandle, CHECK); |
|
1202 |
ConstantPoolCacheEntry* cp_cache_entry = cp_cache_entry = cp->cache()->entry_at(cp->decode_cpcache_index(index)); |
|
1203 |
cp_cache_entry->set_method_handle(cp, callInfo); |
|
1204 |
C2V_END |
|
1205 |
||
1206 |
C2V_VMENTRY(jboolean, shouldDebugNonSafepoints, (JNIEnv*, jobject)) |
|
1207 |
//see compute_recording_non_safepoints in debugInfroRec.cpp |
|
1208 |
if (JvmtiExport::should_post_compiled_method_load() && FLAG_IS_DEFAULT(DebugNonSafepoints)) { |
|
1209 |
return true; |
|
1210 |
} |
|
1211 |
return DebugNonSafepoints; |
|
1212 |
C2V_END |
|
1213 |
||
1214 |
// public native void materializeVirtualObjects(HotSpotStackFrameReference stackFrame, boolean invalidate); |
|
1215 |
C2V_VMENTRY(void, materializeVirtualObjects, (JNIEnv*, jobject, jobject hs_frame, bool invalidate)) |
|
1216 |
ResourceMark rm; |
|
1217 |
||
1218 |
if (hs_frame == NULL) { |
|
1219 |
THROW_MSG(vmSymbols::java_lang_NullPointerException(), "stack frame is null") |
|
1220 |
} |
|
1221 |
||
1222 |
HotSpotStackFrameReference::klass()->initialize(thread); |
|
1223 |
||
1224 |
// look for the given stack frame |
|
1225 |
StackFrameStream fst(thread); |
|
1226 |
intptr_t* stack_pointer = (intptr_t*) HotSpotStackFrameReference::stackPointer(hs_frame); |
|
1227 |
while (fst.current()->sp() != stack_pointer && !fst.is_done()) { |
|
1228 |
fst.next(); |
|
1229 |
} |
|
1230 |
if (fst.current()->sp() != stack_pointer) { |
|
1231 |
THROW_MSG(vmSymbols::java_lang_IllegalStateException(), "stack frame not found") |
|
1232 |
} |
|
1233 |
||
1234 |
if (invalidate) { |
|
1235 |
if (!fst.current()->is_compiled_frame()) { |
|
1236 |
THROW_MSG(vmSymbols::java_lang_IllegalStateException(), "compiled stack frame expected") |
|
1237 |
} |
|
1238 |
assert(fst.current()->cb()->is_nmethod(), "nmethod expected"); |
|
1239 |
((nmethod*) fst.current()->cb())->make_not_entrant(); |
|
1240 |
} |
|
1241 |
Deoptimization::deoptimize(thread, *fst.current(), fst.register_map(), Deoptimization::Reason_none); |
|
1242 |
// look for the frame again as it has been updated by deopt (pc, deopt state...) |
|
1243 |
StackFrameStream fstAfterDeopt(thread); |
|
1244 |
while (fstAfterDeopt.current()->sp() != stack_pointer && !fstAfterDeopt.is_done()) { |
|
1245 |
fstAfterDeopt.next(); |
|
1246 |
} |
|
1247 |
if (fstAfterDeopt.current()->sp() != stack_pointer) { |
|
1248 |
THROW_MSG(vmSymbols::java_lang_IllegalStateException(), "stack frame not found after deopt") |
|
1249 |
} |
|
1250 |
||
1251 |
vframe* vf = vframe::new_vframe(fstAfterDeopt.current(), fstAfterDeopt.register_map(), thread); |
|
1252 |
if (!vf->is_compiled_frame()) { |
|
1253 |
THROW_MSG(vmSymbols::java_lang_IllegalStateException(), "compiled stack frame expected") |
|
1254 |
} |
|
1255 |
||
1256 |
GrowableArray<compiledVFrame*>* virtualFrames = new GrowableArray<compiledVFrame*>(10); |
|
1257 |
while (true) { |
|
1258 |
assert(vf->is_compiled_frame(), "Wrong frame type"); |
|
1259 |
virtualFrames->push(compiledVFrame::cast(vf)); |
|
1260 |
if (vf->is_top()) { |
|
1261 |
break; |
|
1262 |
} |
|
1263 |
vf = vf->sender(); |
|
1264 |
} |
|
1265 |
||
1266 |
int last_frame_number = HotSpotStackFrameReference::frameNumber(hs_frame); |
|
1267 |
if (last_frame_number >= virtualFrames->length()) { |
|
1268 |
THROW_MSG(vmSymbols::java_lang_IllegalStateException(), "invalid frame number") |
|
1269 |
} |
|
1270 |
||
1271 |
// Reallocate the non-escaping objects and restore their fields. |
|
1272 |
assert (virtualFrames->at(last_frame_number)->scope() != NULL,"invalid scope"); |
|
1273 |
GrowableArray<ScopeValue*>* objects = virtualFrames->at(last_frame_number)->scope()->objects(); |
|
1274 |
||
1275 |
if (objects == NULL) { |
|
1276 |
// no objects to materialize |
|
1277 |
return; |
|
1278 |
} |
|
1279 |
||
1280 |
bool realloc_failures = Deoptimization::realloc_objects(thread, fstAfterDeopt.current(), objects, THREAD); |
|
1281 |
Deoptimization::reassign_fields(fstAfterDeopt.current(), fstAfterDeopt.register_map(), objects, realloc_failures, false); |
|
1282 |
||
1283 |
for (int frame_index = 0; frame_index < virtualFrames->length(); frame_index++) { |
|
1284 |
compiledVFrame* cvf = virtualFrames->at(frame_index); |
|
1285 |
||
1286 |
GrowableArray<ScopeValue*>* scopeLocals = cvf->scope()->locals(); |
|
1287 |
StackValueCollection* locals = cvf->locals(); |
|
1288 |
||
1289 |
if (locals != NULL) { |
|
1290 |
for (int i2 = 0; i2 < locals->size(); i2++) { |
|
1291 |
StackValue* var = locals->at(i2); |
|
1292 |
if (var->type() == T_OBJECT && scopeLocals->at(i2)->is_object()) { |
|
1293 |
jvalue val; |
|
1294 |
val.l = (jobject) locals->at(i2)->get_obj()(); |
|
1295 |
cvf->update_local(T_OBJECT, i2, val); |
|
1296 |
} |
|
1297 |
} |
|
1298 |
} |
|
1299 |
} |
|
1300 |
||
1301 |
// all locals are materialized by now |
|
1302 |
HotSpotStackFrameReference::set_localIsVirtual(hs_frame, NULL); |
|
1303 |
||
1304 |
// update the locals array |
|
1305 |
objArrayHandle array = HotSpotStackFrameReference::locals(hs_frame); |
|
1306 |
StackValueCollection* locals = virtualFrames->at(last_frame_number)->locals(); |
|
1307 |
for (int i = 0; i < locals->size(); i++) { |
|
1308 |
StackValue* var = locals->at(i); |
|
1309 |
if (var->type() == T_OBJECT) { |
|
1310 |
array->obj_at_put(i, locals->at(i)->get_obj()()); |
|
1311 |
} |
|
1312 |
} |
|
1313 |
C2V_END |
|
1314 |
||
1315 |
C2V_VMENTRY(void, writeDebugOutput, (JNIEnv*, jobject, jbyteArray bytes, jint offset, jint length)) |
|
1316 |
if (bytes == NULL) { |
|
1317 |
THROW(vmSymbols::java_lang_NullPointerException()); |
|
1318 |
} |
|
1319 |
typeArrayOop array = (typeArrayOop) JNIHandles::resolve(bytes); |
|
1320 |
||
1321 |
// Check if offset and length are non negative. |
|
1322 |
if (offset < 0 || length < 0) { |
|
1323 |
THROW(vmSymbols::java_lang_ArrayIndexOutOfBoundsException()); |
|
1324 |
} |
|
1325 |
// Check if the range is valid. |
|
1326 |
if ((((unsigned int) length + (unsigned int) offset) > (unsigned int) array->length())) { |
|
1327 |
THROW(vmSymbols::java_lang_ArrayIndexOutOfBoundsException()); |
|
1328 |
} |
|
1329 |
while (length > 0) { |
|
1330 |
jbyte* start = array->byte_at_addr(offset); |
|
1331 |
tty->write((char*) start, MIN2(length, O_BUFLEN)); |
|
1332 |
length -= O_BUFLEN; |
|
1333 |
offset += O_BUFLEN; |
|
1334 |
} |
|
1335 |
C2V_END |
|
1336 |
||
1337 |
C2V_VMENTRY(void, flushDebugOutput, (JNIEnv*, jobject)) |
|
1338 |
tty->flush(); |
|
1339 |
C2V_END |
|
1340 |
||
33632 | 1341 |
C2V_VMENTRY(int, methodDataProfileDataSize, (JNIEnv*, jobject, jlong metaspace_method_data, jint position)) |
1342 |
ResourceMark rm; |
|
1343 |
MethodData* mdo = CompilerToVM::asMethodData(metaspace_method_data); |
|
1344 |
ProfileData* profile_data = mdo->data_at(position); |
|
1345 |
if (mdo->is_valid(profile_data)) { |
|
1346 |
return profile_data->size_in_bytes(); |
|
1347 |
} |
|
1348 |
DataLayout* data = mdo->extra_data_base(); |
|
1349 |
DataLayout* end = mdo->extra_data_limit(); |
|
1350 |
for (;; data = mdo->next_extra(data)) { |
|
1351 |
assert(data < end, "moved past end of extra data"); |
|
1352 |
profile_data = data->data_in(); |
|
1353 |
if (mdo->dp_to_di(profile_data->dp()) == position) { |
|
1354 |
return profile_data->size_in_bytes(); |
|
1355 |
} |
|
1356 |
} |
|
1357 |
THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), err_msg("Invalid profile data position %d", position)); |
|
1358 |
C2V_END |
|
1359 |
||
35593
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1360 |
C2V_VMENTRY(int, interpreterFrameSize, (JNIEnv*, jobject, jobject bytecode_frame_handle)) |
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1361 |
if (bytecode_frame_handle == NULL) { |
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1362 |
THROW_0(vmSymbols::java_lang_NullPointerException()); |
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1363 |
} |
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1364 |
|
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1365 |
oop top_bytecode_frame = JNIHandles::resolve_non_null(bytecode_frame_handle); |
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1366 |
oop bytecode_frame = top_bytecode_frame; |
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1367 |
int size = 0; |
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1368 |
int callee_parameters = 0; |
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1369 |
int callee_locals = 0; |
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1370 |
Method* method = getMethodFromHotSpotMethod(BytecodePosition::method(bytecode_frame)); |
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1371 |
int extra_args = method->max_stack() - BytecodeFrame::numStack(bytecode_frame); |
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1372 |
|
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1373 |
while (bytecode_frame != NULL) { |
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1374 |
int locks = BytecodeFrame::numLocks(bytecode_frame); |
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1375 |
int temps = BytecodeFrame::numStack(bytecode_frame); |
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1376 |
bool is_top_frame = (bytecode_frame == top_bytecode_frame); |
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1377 |
Method* method = getMethodFromHotSpotMethod(BytecodePosition::method(bytecode_frame)); |
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1378 |
|
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1379 |
int frame_size = BytesPerWord * Interpreter::size_activation(method->max_stack(), |
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1380 |
temps + callee_parameters, |
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1381 |
extra_args, |
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1382 |
locks, |
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1383 |
callee_parameters, |
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1384 |
callee_locals, |
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1385 |
is_top_frame); |
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1386 |
size += frame_size; |
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1387 |
|
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1388 |
callee_parameters = method->size_of_parameters(); |
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1389 |
callee_locals = method->max_locals(); |
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1390 |
extra_args = 0; |
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1391 |
bytecode_frame = BytecodePosition::caller(bytecode_frame); |
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1392 |
} |
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1393 |
return size + Deoptimization::last_frame_adjust(0, callee_locals) * BytesPerWord; |
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1394 |
C2V_END |
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1395 |
|
33160 | 1396 |
|
1397 |
#define CC (char*) /*cast a literal from (const char*)*/ |
|
1398 |
#define FN_PTR(f) CAST_FROM_FN_PTR(void*, &(c2v_ ## f)) |
|
1399 |
||
1400 |
#define STRING "Ljava/lang/String;" |
|
1401 |
#define OBJECT "Ljava/lang/Object;" |
|
1402 |
#define CLASS "Ljava/lang/Class;" |
|
1403 |
#define STACK_TRACE_ELEMENT "Ljava/lang/StackTraceElement;" |
|
1404 |
#define INSTALLED_CODE "Ljdk/vm/ci/code/InstalledCode;" |
|
1405 |
#define TARGET_DESCRIPTION "Ljdk/vm/ci/code/TargetDescription;" |
|
35593
c733fd198e6e
8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap
never
parents:
35592
diff
changeset
|
1406 |
#define BYTECODE_FRAME "Ljdk/vm/ci/code/BytecodeFrame;" |
33160 | 1407 |
#define RESOLVED_METHOD "Ljdk/vm/ci/meta/ResolvedJavaMethod;" |
1408 |
#define HS_RESOLVED_METHOD "Ljdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl;" |
|
1409 |
#define HS_RESOLVED_KLASS "Ljdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl;" |
|
1410 |
#define HS_CONSTANT_POOL "Ljdk/vm/ci/hotspot/HotSpotConstantPool;" |
|
1411 |
#define HS_COMPILED_CODE "Ljdk/vm/ci/hotspot/HotSpotCompiledCode;" |
|
33632 | 1412 |
#define HS_CONFIG "Ljdk/vm/ci/hotspot/HotSpotVMConfig;" |
33160 | 1413 |
#define HS_METADATA "Ljdk/vm/ci/hotspot/HotSpotMetaData;" |
1414 |
#define HS_STACK_FRAME_REF "Ljdk/vm/ci/hotspot/HotSpotStackFrameReference;" |
|
33632 | 1415 |
#define HS_SPECULATION_LOG "Ljdk/vm/ci/hotspot/HotSpotSpeculationLog;" |
33160 | 1416 |
#define METASPACE_METHOD_DATA "J" |
1417 |
||
1418 |
JNINativeMethod CompilerToVM::methods[] = { |
|
37282
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1419 |
{CC "getBytecode", CC "(" HS_RESOLVED_METHOD ")[B", FN_PTR(getBytecode)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1420 |
{CC "getExceptionTableStart", CC "(" HS_RESOLVED_METHOD ")J", FN_PTR(getExceptionTableStart)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1421 |
{CC "getExceptionTableLength", CC "(" HS_RESOLVED_METHOD ")I", FN_PTR(getExceptionTableLength)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1422 |
{CC "findUniqueConcreteMethod", CC "(" HS_RESOLVED_KLASS HS_RESOLVED_METHOD ")" HS_RESOLVED_METHOD, FN_PTR(findUniqueConcreteMethod)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1423 |
{CC "getImplementor", CC "(" HS_RESOLVED_KLASS ")" HS_RESOLVED_KLASS, FN_PTR(getImplementor)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1424 |
{CC "getStackTraceElement", CC "(" HS_RESOLVED_METHOD "I)" STACK_TRACE_ELEMENT, FN_PTR(getStackTraceElement)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1425 |
{CC "methodIsIgnoredBySecurityStackWalk", CC "(" HS_RESOLVED_METHOD ")Z", FN_PTR(methodIsIgnoredBySecurityStackWalk)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1426 |
{CC "doNotInlineOrCompile", CC "(" HS_RESOLVED_METHOD ")V", FN_PTR(doNotInlineOrCompile)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1427 |
{CC "canInlineMethod", CC "(" HS_RESOLVED_METHOD ")Z", FN_PTR(canInlineMethod)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1428 |
{CC "shouldInlineMethod", CC "(" HS_RESOLVED_METHOD ")Z", FN_PTR(shouldInlineMethod)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1429 |
{CC "lookupType", CC "(" STRING CLASS "Z)" HS_RESOLVED_KLASS, FN_PTR(lookupType)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1430 |
{CC "lookupNameInPool", CC "(" HS_CONSTANT_POOL "I)" STRING, FN_PTR(lookupNameInPool)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1431 |
{CC "lookupNameAndTypeRefIndexInPool", CC "(" HS_CONSTANT_POOL "I)I", FN_PTR(lookupNameAndTypeRefIndexInPool)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1432 |
{CC "lookupSignatureInPool", CC "(" HS_CONSTANT_POOL "I)" STRING, FN_PTR(lookupSignatureInPool)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1433 |
{CC "lookupKlassRefIndexInPool", CC "(" HS_CONSTANT_POOL "I)I", FN_PTR(lookupKlassRefIndexInPool)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1434 |
{CC "lookupKlassInPool", CC "(" HS_CONSTANT_POOL "I)Ljava/lang/Object;", FN_PTR(lookupKlassInPool)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1435 |
{CC "lookupAppendixInPool", CC "(" HS_CONSTANT_POOL "I)" OBJECT, FN_PTR(lookupAppendixInPool)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1436 |
{CC "lookupMethodInPool", CC "(" HS_CONSTANT_POOL "IB)" HS_RESOLVED_METHOD, FN_PTR(lookupMethodInPool)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1437 |
{CC "constantPoolRemapInstructionOperandFromCache", CC "(" HS_CONSTANT_POOL "I)I", FN_PTR(constantPoolRemapInstructionOperandFromCache)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1438 |
{CC "resolveConstantInPool", CC "(" HS_CONSTANT_POOL "I)" OBJECT, FN_PTR(resolveConstantInPool)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1439 |
{CC "resolvePossiblyCachedConstantInPool", CC "(" HS_CONSTANT_POOL "I)" OBJECT, FN_PTR(resolvePossiblyCachedConstantInPool)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1440 |
{CC "resolveTypeInPool", CC "(" HS_CONSTANT_POOL "I)" HS_RESOLVED_KLASS, FN_PTR(resolveTypeInPool)}, |
39421
a9652c919db8
8157181: Compilers accept modification of final fields outside initializer methods
zmajo
parents:
38719
diff
changeset
|
1441 |
{CC "resolveFieldInPool", CC "(" HS_CONSTANT_POOL "I" HS_RESOLVED_METHOD "B[J)" HS_RESOLVED_KLASS, FN_PTR(resolveFieldInPool)}, |
37282
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1442 |
{CC "resolveInvokeDynamicInPool", CC "(" HS_CONSTANT_POOL "I)V", FN_PTR(resolveInvokeDynamicInPool)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1443 |
{CC "resolveInvokeHandleInPool", CC "(" HS_CONSTANT_POOL "I)V", FN_PTR(resolveInvokeHandleInPool)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1444 |
{CC "resolveMethod", CC "(" HS_RESOLVED_KLASS HS_RESOLVED_METHOD HS_RESOLVED_KLASS ")" HS_RESOLVED_METHOD, FN_PTR(resolveMethod)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1445 |
{CC "getVtableIndexForInterfaceMethod", CC "(" HS_RESOLVED_KLASS HS_RESOLVED_METHOD ")I", FN_PTR(getVtableIndexForInterfaceMethod)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1446 |
{CC "getClassInitializer", CC "(" HS_RESOLVED_KLASS ")" HS_RESOLVED_METHOD, FN_PTR(getClassInitializer)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1447 |
{CC "hasFinalizableSubclass", CC "(" HS_RESOLVED_KLASS ")Z", FN_PTR(hasFinalizableSubclass)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1448 |
{CC "getMaxCallTargetOffset", CC "(J)J", FN_PTR(getMaxCallTargetOffset)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1449 |
{CC "getResolvedJavaMethodAtSlot", CC "(" CLASS "I)" HS_RESOLVED_METHOD, FN_PTR(getResolvedJavaMethodAtSlot)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1450 |
{CC "getResolvedJavaMethod", CC "(Ljava/lang/Object;J)" HS_RESOLVED_METHOD, FN_PTR(getResolvedJavaMethod)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1451 |
{CC "getConstantPool", CC "(Ljava/lang/Object;J)" HS_CONSTANT_POOL, FN_PTR(getConstantPool)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1452 |
{CC "getResolvedJavaType", CC "(Ljava/lang/Object;JZ)" HS_RESOLVED_KLASS, FN_PTR(getResolvedJavaType)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1453 |
{CC "initializeConfiguration", CC "(" HS_CONFIG ")J", FN_PTR(initializeConfiguration)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1454 |
{CC "installCode", CC "(" TARGET_DESCRIPTION HS_COMPILED_CODE INSTALLED_CODE HS_SPECULATION_LOG ")I", FN_PTR(installCode)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1455 |
{CC "getMetadata", CC "(" TARGET_DESCRIPTION HS_COMPILED_CODE HS_METADATA ")I", FN_PTR(getMetadata)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1456 |
{CC "resetCompilationStatistics", CC "()V", FN_PTR(resetCompilationStatistics)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1457 |
{CC "disassembleCodeBlob", CC "(" INSTALLED_CODE ")" STRING, FN_PTR(disassembleCodeBlob)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1458 |
{CC "executeInstalledCode", CC "([" OBJECT INSTALLED_CODE ")" OBJECT, FN_PTR(executeInstalledCode)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1459 |
{CC "getLineNumberTable", CC "(" HS_RESOLVED_METHOD ")[J", FN_PTR(getLineNumberTable)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1460 |
{CC "getLocalVariableTableStart", CC "(" HS_RESOLVED_METHOD ")J", FN_PTR(getLocalVariableTableStart)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1461 |
{CC "getLocalVariableTableLength", CC "(" HS_RESOLVED_METHOD ")I", FN_PTR(getLocalVariableTableLength)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1462 |
{CC "reprofile", CC "(" HS_RESOLVED_METHOD ")V", FN_PTR(reprofile)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1463 |
{CC "invalidateInstalledCode", CC "(" INSTALLED_CODE ")V", FN_PTR(invalidateInstalledCode)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1464 |
{CC "collectCounters", CC "()[J", FN_PTR(collectCounters)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1465 |
{CC "allocateCompileId", CC "(" HS_RESOLVED_METHOD "I)I", FN_PTR(allocateCompileId)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1466 |
{CC "isMature", CC "(" METASPACE_METHOD_DATA ")Z", FN_PTR(isMature)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1467 |
{CC "hasCompiledCodeForOSR", CC "(" HS_RESOLVED_METHOD "II)Z", FN_PTR(hasCompiledCodeForOSR)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1468 |
{CC "getSymbol", CC "(J)" STRING, FN_PTR(getSymbol)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1469 |
{CC "getNextStackFrame", CC "(" HS_STACK_FRAME_REF "[" RESOLVED_METHOD "I)" HS_STACK_FRAME_REF, FN_PTR(getNextStackFrame)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1470 |
{CC "materializeVirtualObjects", CC "(" HS_STACK_FRAME_REF "Z)V", FN_PTR(materializeVirtualObjects)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1471 |
{CC "shouldDebugNonSafepoints", CC "()Z", FN_PTR(shouldDebugNonSafepoints)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1472 |
{CC "writeDebugOutput", CC "([BII)V", FN_PTR(writeDebugOutput)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1473 |
{CC "flushDebugOutput", CC "()V", FN_PTR(flushDebugOutput)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1474 |
{CC "methodDataProfileDataSize", CC "(JI)I", FN_PTR(methodDataProfileDataSize)}, |
3f55e4b3231c
8150690: C++11 user-defined literal syntax in jvmciCompilerToVM.cpp.
rraghavan
parents:
36842
diff
changeset
|
1475 |
{CC "interpreterFrameSize", CC "(" BYTECODE_FRAME ")I", FN_PTR(interpreterFrameSize)}, |
33160 | 1476 |
}; |
1477 |
||
1478 |
int CompilerToVM::methods_count() { |
|
1479 |
return sizeof(methods) / sizeof(JNINativeMethod); |
|
1480 |
} |
|
1481 |