equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2017, 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. |
22 * |
22 * |
23 */ |
23 */ |
24 |
24 |
25 #include "precompiled.hpp" |
25 #include "precompiled.hpp" |
26 #include "gc/shared/specialized_oop_closures.hpp" |
26 #include "gc/shared/specialized_oop_closures.hpp" |
|
27 #include "oops/access.inline.hpp" |
27 #include "oops/objArrayKlass.hpp" |
28 #include "oops/objArrayKlass.hpp" |
28 #include "oops/objArrayOop.hpp" |
29 #include "oops/objArrayOop.hpp" |
29 #include "oops/oop.inline.hpp" |
30 #include "oops/oop.inline.hpp" |
30 |
31 |
31 oop objArrayOopDesc::atomic_compare_exchange_oop(int index, oop exchange_value, |
32 oop objArrayOopDesc::atomic_compare_exchange_oop(int index, oop exchange_value, |
34 if (UseCompressedOops) { |
35 if (UseCompressedOops) { |
35 dest = (HeapWord*)obj_at_addr<narrowOop>(index); |
36 dest = (HeapWord*)obj_at_addr<narrowOop>(index); |
36 } else { |
37 } else { |
37 dest = (HeapWord*)obj_at_addr<oop>(index); |
38 dest = (HeapWord*)obj_at_addr<oop>(index); |
38 } |
39 } |
39 oop res = oopDesc::atomic_compare_exchange_oop(exchange_value, dest, compare_value, true); |
40 return HeapAccess<>::oop_atomic_cmpxchg(exchange_value, dest, compare_value); |
40 // update card mark if success |
41 } |
41 if (res == compare_value) { |
42 |
42 update_barrier_set((void*)dest, exchange_value); |
43 Klass* objArrayOopDesc::element_klass() { |
43 } |
44 return ObjArrayKlass::cast(klass())->element_klass(); |
44 return res; |
|
45 } |
45 } |
46 |
46 |
47 #define ObjArrayOop_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ |
47 #define ObjArrayOop_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ |
48 \ |
48 \ |
49 void objArrayOopDesc::oop_iterate_range(OopClosureType* blk, int start, int end) { \ |
49 void objArrayOopDesc::oop_iterate_range(OopClosureType* blk, int start, int end) { \ |