10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 #include "precompiled.hpp"
25 #include "gc/z/zAttachedArray.inline.hpp"
26 #include "gc/z/zLock.inline.hpp"
27 #include "gc/z/zNMethodData.hpp"
28 #include "memory/allocation.hpp"
29 #include "runtime/atomic.hpp"
30 #include "runtime/orderAccess.hpp"
31 #include "utilities/align.hpp"
32 #include "utilities/debug.hpp"
33 #include "utilities/growableArray.hpp"
34
35 ZNMethodDataOops* ZNMethodDataOops::create(const GrowableArray<oop*>& immediates, bool has_non_immediates) {
36 return ::new (AttachedArray::alloc(immediates.length())) ZNMethodDataOops(immediates, has_non_immediates);
37 }
38
39 void ZNMethodDataOops::destroy(ZNMethodDataOops* oops) {
40 AttachedArray::free(oops);
41 }
42
43 ZNMethodDataOops::ZNMethodDataOops(const GrowableArray<oop*>& immediates, bool has_non_immediates) :
44 _immediates(immediates.length()),
45 _has_non_immediates(has_non_immediates) {
46 // Save all immediate oops
47 for (size_t i = 0; i < immediates_count(); i++) {
48 immediates_begin()[i] = immediates.at(int(i));
49 }
50 }
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 #include "precompiled.hpp"
25 #include "gc/z/zAttachedArray.inline.hpp"
26 #include "gc/z/zLock.inline.hpp"
27 #include "gc/z/zNMethodData.hpp"
28 #include "memory/allocation.hpp"
29 #include "runtime/atomic.hpp"
30 #include "utilities/align.hpp"
31 #include "utilities/debug.hpp"
32 #include "utilities/growableArray.hpp"
33
34 ZNMethodDataOops* ZNMethodDataOops::create(const GrowableArray<oop*>& immediates, bool has_non_immediates) {
35 return ::new (AttachedArray::alloc(immediates.length())) ZNMethodDataOops(immediates, has_non_immediates);
36 }
37
38 void ZNMethodDataOops::destroy(ZNMethodDataOops* oops) {
39 AttachedArray::free(oops);
40 }
41
42 ZNMethodDataOops::ZNMethodDataOops(const GrowableArray<oop*>& immediates, bool has_non_immediates) :
43 _immediates(immediates.length()),
44 _has_non_immediates(has_non_immediates) {
45 // Save all immediate oops
46 for (size_t i = 0; i < immediates_count(); i++) {
47 immediates_begin()[i] = immediates.at(int(i));
48 }
49 }
|