comparison src/share/vm/oops/typeArrayKlass.cpp @ 2119:d4fca0a6abde

7011386: race in objArrayKlass::array_klass_impl Summary: Move _lower_dimension field initialization before _higher_dimension and add storestore barrier. Reviewed-by: dholmes, iveresov, never
author kvn
date Tue, 11 Jan 2011 20:26:13 -0800
parents f95d63e2154a
children 3582bf76420e
comparison
equal deleted inserted replaced
2118:dd031b2226de 2119:d4fca0a6abde
1 /* 1 /*
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
177 klassOop oak = objArrayKlassKlass::cast( 177 klassOop oak = objArrayKlassKlass::cast(
178 Universe::objArrayKlassKlassObj())->allocate_objArray_klass( 178 Universe::objArrayKlassKlassObj())->allocate_objArray_klass(
179 dimension + 1, h_this, CHECK_NULL); 179 dimension + 1, h_this, CHECK_NULL);
180 h_ak = objArrayKlassHandle(THREAD, oak); 180 h_ak = objArrayKlassHandle(THREAD, oak);
181 h_ak->set_lower_dimension(h_this()); 181 h_ak->set_lower_dimension(h_this());
182 OrderAccess::storestore();
182 h_this->set_higher_dimension(h_ak()); 183 h_this->set_higher_dimension(h_ak());
183 assert(h_ak->oop_is_objArray(), "incorrect initialization of objArrayKlass"); 184 assert(h_ak->oop_is_objArray(), "incorrect initialization of objArrayKlass");
184 } 185 }
185 } 186 }
186 } else { 187 } else {