|
1 | 1 | /* |
2 | | - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | 4 | * |
5 | 5 | * This code is free software; you can redistribute it and/or modify it |
@@ -2936,13 +2936,17 @@ void CompiledEntrySignature::compute_calling_conventions(bool init) { |
2936 | 2936 | for (int i = 0; i < supers->length(); ++i) { |
2937 | 2937 | Method* super_method = supers->at(i); |
2938 | 2938 | if (super_method->is_scalarized_arg(arg_num) DEBUG_ONLY(|| (stress && (os::random() & 1) == 1))) { |
2939 | | - super_method->set_mismatch(); |
2940 | | - MutexLocker ml(Compile_lock, Mutex::_safepoint_check_flag); |
2941 | 2939 | JavaThread* thread = JavaThread::current(); |
2942 | 2940 | HandleMark hm(thread); |
2943 | 2941 | methodHandle mh(thread, super_method); |
2944 | 2942 | DeoptimizationScope deopt_scope; |
2945 | | - CodeCache::mark_for_deoptimization(&deopt_scope, mh()); |
| 2943 | + { |
| 2944 | + // Keep the lock scope minimal. Prevent interference with other |
| 2945 | + // dependency checks by setting mismatch and marking within the lock. |
| 2946 | + MutexLocker ml(Compile_lock, Mutex::_safepoint_check_flag); |
| 2947 | + super_method->set_mismatch(); |
| 2948 | + CodeCache::mark_for_deoptimization(&deopt_scope, mh()); |
| 2949 | + } |
2946 | 2950 | deopt_scope.deoptimize_marked(); |
2947 | 2951 | } |
2948 | 2952 | } |
|
0 commit comments