RFR: 8255718: Zero: VM should know it runs in interpreter-only mode
Aleksey Shipilev
shade at openjdk.java.net
Sun Nov 1 17:31:59 UTC 2020
There are many tests in tier1 that fail with Zero, because they supply -XX:+TieredCompilation, and that makes VM code believe it runs in "mixed" mode.
Can be reproduced trivially by running anything with -XX:+TieredCompilation. Then Zero fails when runtime asks it to produce a native wrapper for MH intrinsics. That code is normally protected by Arguments::is_interpreter_only.
Method* SystemDictionary::find_method_handle_intrinsic(vmIntrinsics::ID iid,
Symbol* signature,
TRAPS) {
...
if (!Arguments::is_interpreter_only()) { // <--- checks here
// Generate a compiled form of the MH intrinsic.
AdapterHandlerLibrary::create_native_wrapper(m); // <--- fails through here
}
Then in `sharedRuntime_zero.cpp`:
nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm,
const methodHandle& method,
int compile_id,
BasicType *sig_bt,
VMRegPair *regs,
BasicType ret_type,
address critical_entry) {
ShouldNotCallThis(); // <--- crashes here
return NULL;
}
...so:
$ build/linux-x86_64-zero-fastdebug/images/jdk/bin/java -XX:+TieredCompilation
OpenJDK 64-Bit Zero VM warning: -XX:+TieredCompilation not supported in this VM
# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc: SuppressErrorAt=/sharedRuntime_zero.cpp:80
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (/home/shade/trunks/jdk/src/hotspot/cpu/zero/sharedRuntime_zero.cpp:80), pid=404967, tid=404968
# Error: ShouldNotCall()
Additional testing:
- [x] ad-hoc Hello World runs with Linux x86_64 Zero
- [x] re-run some failed `tier1` tests with Linux x86_64 Zero, now passing
-------------
Commit messages:
- 8255718: Zero: VM should know it runs in interpreter-only mode
Changes: https://git.openjdk.java.net/jdk/pull/985/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=985&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8255718
Stats: 5 lines in 1 file changed: 5 ins; 0 del; 0 mod
Patch: https://git.openjdk.java.net/jdk/pull/985.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/985/head:pull/985
PR: https://git.openjdk.java.net/jdk/pull/985
More information about the hotspot-runtime-dev
mailing list