< prev index next >
src/hotspot/share/jvmci/jvmciCodeInstaller.cpp
Print this page
*** 201,212 ****
if (h->is_klass()) {
klass = (Klass*) h;
result = JVMCIENV->get_jvmci_type(klass, JVMCI_CATCH);
} else if (h->is_method()) {
Method* method = (Method*) h;
! methodHandle mh(method);
! result = JVMCIENV->get_jvmci_method(method, JVMCI_CATCH);
}
jobject ref = JVMCIENV->get_jobject(result);
record_meta_ref(ref, index);
return index;
--- 201,212 ----
if (h->is_klass()) {
klass = (Klass*) h;
result = JVMCIENV->get_jvmci_type(klass, JVMCI_CATCH);
} else if (h->is_method()) {
Method* method = (Method*) h;
! methodHandle mh(THREAD, method);
! result = JVMCIENV->get_jvmci_method(mh, JVMCI_CATCH);
}
jobject ref = JVMCIENV->get_jobject(result);
record_meta_ref(ref, index);
return index;
*** 499,510 ****
JVMCIObjectArray methods = jvmci_env()->get_HotSpotCompiledCode_methods(compiled_code);
if (methods.is_non_null()) {
int length = JVMCIENV->get_length(methods);
for (int i = 0; i < length; ++i) {
JVMCIObject method_handle = JVMCIENV->get_object_at(methods, i);
! methodHandle method = jvmci_env()->asMethod(method_handle);
! _dependencies->assert_evol_method(method());
}
}
}
}
--- 499,510 ----
JVMCIObjectArray methods = jvmci_env()->get_HotSpotCompiledCode_methods(compiled_code);
if (methods.is_non_null()) {
int length = JVMCIENV->get_length(methods);
for (int i = 0; i < length; ++i) {
JVMCIObject method_handle = JVMCIENV->get_object_at(methods, i);
! Method* method = jvmci_env()->asMethod(method_handle);
! _dependencies->assert_evol_method(method);
}
}
}
}
*** 618,634 ****
JVMCICompileState* compile_state = (JVMCICompileState*) (address) jvmci_env()->get_HotSpotCompiledNmethod_compileState(compiled_code);
if (compile_state != NULL) {
jvmci_env()->set_compile_state(compile_state);
}
! methodHandle method = jvmci_env()->asMethod(jvmci_env()->get_HotSpotCompiledNmethod_method(compiled_code));
jint entry_bci = jvmci_env()->get_HotSpotCompiledNmethod_entryBCI(compiled_code);
bool has_unsafe_access = jvmci_env()->get_HotSpotCompiledNmethod_hasUnsafeAccess(compiled_code) == JNI_TRUE;
jint id = jvmci_env()->get_HotSpotCompiledNmethod_id(compiled_code);
if (id == -1) {
// Make sure a valid compile_id is associated with every compile
! id = CompileBroker::assign_compile_id_unlocked(Thread::current(), method, entry_bci);
jvmci_env()->set_HotSpotCompiledNmethod_id(compiled_code, id);
}
if (!jvmci_env()->isa_HotSpotNmethod(installed_code)) {
JVMCI_THROW_MSG_(IllegalArgumentException, "InstalledCode object must be a HotSpotNmethod when installing a HotSpotCompiledNmethod", JVMCI::ok);
}
--- 618,636 ----
JVMCICompileState* compile_state = (JVMCICompileState*) (address) jvmci_env()->get_HotSpotCompiledNmethod_compileState(compiled_code);
if (compile_state != NULL) {
jvmci_env()->set_compile_state(compile_state);
}
! Thread* thread = Thread::current();
!
! methodHandle method(thread, jvmci_env()->asMethod(jvmci_env()->get_HotSpotCompiledNmethod_method(compiled_code)));
jint entry_bci = jvmci_env()->get_HotSpotCompiledNmethod_entryBCI(compiled_code);
bool has_unsafe_access = jvmci_env()->get_HotSpotCompiledNmethod_hasUnsafeAccess(compiled_code) == JNI_TRUE;
jint id = jvmci_env()->get_HotSpotCompiledNmethod_id(compiled_code);
if (id == -1) {
// Make sure a valid compile_id is associated with every compile
! id = CompileBroker::assign_compile_id_unlocked(thread, method, entry_bci);
jvmci_env()->set_HotSpotCompiledNmethod_id(compiled_code, id);
}
if (!jvmci_env()->isa_HotSpotNmethod(installed_code)) {
JVMCI_THROW_MSG_(IllegalArgumentException, "InstalledCode object must be a HotSpotNmethod when installing a HotSpotCompiledNmethod", JVMCI::ok);
}
*** 657,667 ****
}
void CodeInstaller::initialize_fields(JVMCIObject target, JVMCIObject compiled_code, JVMCI_TRAPS) {
if (jvmci_env()->isa_HotSpotCompiledNmethod(compiled_code)) {
JVMCIObject hotspotJavaMethod = jvmci_env()->get_HotSpotCompiledNmethod_method(compiled_code);
! methodHandle method = jvmci_env()->asMethod(hotspotJavaMethod);
_parameter_count = method->size_of_parameters();
TRACE_jvmci_2("installing code for %s", method->name_and_sig_as_C_string());
} else {
// Must be a HotSpotCompiledRuntimeStub.
// Only used in OopMap constructor for non-product builds
--- 659,670 ----
}
void CodeInstaller::initialize_fields(JVMCIObject target, JVMCIObject compiled_code, JVMCI_TRAPS) {
if (jvmci_env()->isa_HotSpotCompiledNmethod(compiled_code)) {
JVMCIObject hotspotJavaMethod = jvmci_env()->get_HotSpotCompiledNmethod_method(compiled_code);
! Thread* thread = Thread::current();
! methodHandle method(thread, jvmci_env()->asMethod(hotspotJavaMethod));
_parameter_count = method->size_of_parameters();
TRACE_jvmci_2("installing code for %s", method->name_and_sig_as_C_string());
} else {
// Must be a HotSpotCompiledRuntimeStub.
// Only used in OopMap constructor for non-product builds
*** 935,948 ****
void CodeInstaller::assumption_ConcreteMethod(JVMCIObject assumption) {
JVMCIObject impl_handle = jvmci_env()->get_Assumptions_ConcreteMethod_impl(assumption);
JVMCIObject context_handle = jvmci_env()->get_Assumptions_ConcreteMethod_context(assumption);
! methodHandle impl = jvmci_env()->asMethod(impl_handle);
Klass* context = jvmci_env()->asKlass(context_handle);
! _dependencies->assert_unique_concrete_method(context, impl());
}
void CodeInstaller::assumption_CallSiteTargetValue(JVMCIObject assumption, JVMCI_TRAPS) {
JVMCIObject callSiteConstant = jvmci_env()->get_Assumptions_CallSiteTargetValue_callSite(assumption);
Handle callSite = jvmci_env()->asConstant(callSiteConstant, JVMCI_CHECK);
--- 938,951 ----
void CodeInstaller::assumption_ConcreteMethod(JVMCIObject assumption) {
JVMCIObject impl_handle = jvmci_env()->get_Assumptions_ConcreteMethod_impl(assumption);
JVMCIObject context_handle = jvmci_env()->get_Assumptions_ConcreteMethod_context(assumption);
! Method* impl = jvmci_env()->asMethod(impl_handle);
Klass* context = jvmci_env()->asKlass(context_handle);
! _dependencies->assert_unique_concrete_method(context, impl);
}
void CodeInstaller::assumption_CallSiteTargetValue(JVMCIObject assumption, JVMCI_TRAPS) {
JVMCIObject callSiteConstant = jvmci_env()->get_Assumptions_CallSiteTargetValue_callSite(assumption);
Handle callSite = jvmci_env()->asConstant(callSiteConstant, JVMCI_CHECK);
*** 1062,1072 ****
if (caller_frame.is_non_null()) {
record_scope(pc_offset, caller_frame, scope_mode, objects, return_oop, JVMCI_CHECK);
}
JVMCIObject hotspot_method = jvmci_env()->get_BytecodePosition_method(position);
! Method* method = jvmci_env()->asMethod(hotspot_method);
jint bci = map_jvmci_bci(jvmci_env()->get_BytecodePosition_bci(position));
if (bci == jvmci_env()->get_BytecodeFrame_BEFORE_BCI()) {
bci = SynchronizationEntryBCI;
}
--- 1065,1076 ----
if (caller_frame.is_non_null()) {
record_scope(pc_offset, caller_frame, scope_mode, objects, return_oop, JVMCI_CHECK);
}
JVMCIObject hotspot_method = jvmci_env()->get_BytecodePosition_method(position);
! Thread* thread = Thread::current();
! methodHandle method(thread, jvmci_env()->asMethod(hotspot_method));
jint bci = map_jvmci_bci(jvmci_env()->get_BytecodePosition_bci(position));
if (bci == jvmci_env()->get_BytecodeFrame_BEFORE_BCI()) {
bci = SynchronizationEntryBCI;
}
*** 1075,1085 ****
bool reexecute = false;
if (frame.is_non_null()) {
if (bci < 0){
reexecute = false;
} else {
! Bytecodes::Code code = Bytecodes::java_code_at(method, method->bcp_from(bci));
reexecute = bytecode_should_reexecute(code);
if (frame.is_non_null()) {
reexecute = (jvmci_env()->get_BytecodeFrame_duringCall(frame) == JNI_FALSE);
}
}
--- 1079,1089 ----
bool reexecute = false;
if (frame.is_non_null()) {
if (bci < 0){
reexecute = false;
} else {
! Bytecodes::Code code = Bytecodes::java_code_at(method(), method->bcp_from(bci));
reexecute = bytecode_should_reexecute(code);
if (frame.is_non_null()) {
reexecute = (jvmci_env()->get_BytecodeFrame_duringCall(frame) == JNI_FALSE);
}
}
< prev index next >