8205957: setfldw001/TestDescription.java fails with bad field value

Reviewed-by: sspitsyn, dlong
This commit is contained in:
Leonid Mesnik 2024-08-20 18:41:15 +00:00
parent 285ceb9ee5
commit c646efc366
3 changed files with 26 additions and 33 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -357,14 +357,6 @@ void JavaCalls::call_helper(JavaValue* result, const methodHandle& method, JavaC
CompilationPolicy::compile_if_required(method, CHECK);
// Since the call stub sets up like the interpreter we call the from_interpreted_entry
// so we can go compiled via a i2c. Otherwise initial entry method will always
// run interpreted.
address entry_point = method->from_interpreted_entry();
if (JvmtiExport::can_post_interpreter_events() && thread->is_interp_only_mode()) {
entry_point = method->interpreter_entry();
}
// Figure out if the result value is an oop or not (Note: This is a different value
// than result_type. result_type will be T_INT of oops. (it is about size)
BasicType result_type = runtime_type_from(result);
@ -398,20 +390,34 @@ void JavaCalls::call_helper(JavaValue* result, const methodHandle& method, JavaC
// the call to call_stub, the optimizer produces wrong code.
intptr_t* result_val_address = (intptr_t*)(result->get_value_addr());
intptr_t* parameter_address = args->parameters();
address entry_point;
{
// The enter_interp_only_mode use handshake to set interp_only mode
// so no safepoint should be allowed between is_interp_only_mode() and call
NoSafepointVerifier nsv;
if (JvmtiExport::can_post_interpreter_events() && thread->is_interp_only_mode()) {
entry_point = method->interpreter_entry();
} else {
// Since the call stub sets up like the interpreter we call the from_interpreted_entry
// so we can go compiled via a i2c.
entry_point = method->from_interpreted_entry();
#if INCLUDE_JVMCI
// Gets the alternative target (if any) that should be called
Handle alternative_target = args->alternative_target();
if (!alternative_target.is_null()) {
// Must extract verified entry point from HotSpotNmethod after VM to Java
// transition in JavaCallWrapper constructor so that it is safe with
// respect to nmethod sweeping.
address verified_entry_point = (address) HotSpotJVMCI::InstalledCode::entryPoint(nullptr, alternative_target());
if (verified_entry_point != nullptr) {
thread->set_jvmci_alternate_call_target(verified_entry_point);
entry_point = method->adapter()->get_i2c_entry();
// Gets the alternative target (if any) that should be called
Handle alternative_target = args->alternative_target();
if (!alternative_target.is_null()) {
// Must extract verified entry point from HotSpotNmethod after VM to Java
// transition in JavaCallWrapper constructor so that it is safe with
// respect to nmethod sweeping.
address verified_entry_point = (address) HotSpotJVMCI::InstalledCode::entryPoint(nullptr, alternative_target());
if (verified_entry_point != nullptr) {
thread->set_jvmci_alternate_call_target(verified_entry_point);
entry_point = method->adapter()->get_i2c_entry();
}
}
#endif
}
}
#endif
StubRoutines::call_stub()(
(address)&link,
// (intptr_t*)&(result->_value), // see NOTE above (compiler problem)

View File

@ -29,11 +29,6 @@
vmTestbase/nsk/jvmti/AttachOnDemand/attach020/TestDescription.java 8287324 generic-all
vmTestbase/nsk/jvmti/SetFieldAccessWatch/setfldw001/TestDescription.java#id0 8205957 generic-all
vmTestbase/nsk/jvmti/SetFieldAccessWatch/setfldw001/TestDescription.java#logging 8205957 generic-all
vmTestbase/nsk/jvmti/SetFieldModificationWatch/setfmodw001/TestDescription.java#id0 8205957 generic-all
vmTestbase/nsk/jvmti/SetFieldModificationWatch/setfmodw001/TestDescription.java#logging 8205957 generic-all
vmTestbase/nsk/jvmti/scenarios/sampling/SP07/sp07t002/TestDescription.java 8245680 windows-x64
vmTestbase/vm/mlvm/mixed/stress/regression/b6969574/INDIFY_Test.java 8265295 linux-x64,windows-x64

View File

@ -47,11 +47,3 @@
* /test/lib
* @run main/othervm/native -agentlib:setfmodw001 nsk.jvmti.SetFieldModificationWatch.setfmodw001
*/
/*
* @test id=logging
*
* @library /vmTestbase
* /test/lib
* @run main/othervm/native -agentlib:setfmodw001 -XX:TraceJVMTI=ec+,+ioe,+s -Xlog:jvmti=trace:file=vm.%p.log nsk.jvmti.SetFieldModificationWatch.setfmodw001
*/