diff --git a/src/hotspot/share/runtime/deoptimization.cpp b/src/hotspot/share/runtime/deoptimization.cpp index a5f2e09afaa8e..87587944469c1 100644 --- a/src/hotspot/share/runtime/deoptimization.cpp +++ b/src/hotspot/share/runtime/deoptimization.cpp @@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1603,6 +1603,10 @@ void Deoptimization::reassign_fields(frame* fr, RegisterMap* reg_map, GrowableAr reassign_object_array_elements(fr, reg_map, sv, (objArrayOop) obj()); } } + // These objects may escape when we return to Interpreter after deoptimization. + // We need barrier so that stores that initialize these objects can't be reordered + // with subsequent stores that make these objects accessible by other threads. + OrderAccess::storestore(); }