1 /* |
1 /* |
2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2014, 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. |
25 #include "precompiled.hpp" |
25 #include "precompiled.hpp" |
26 #include "oops/objArrayKlass.hpp" |
26 #include "oops/objArrayKlass.hpp" |
27 #include "oops/objArrayOop.hpp" |
27 #include "oops/objArrayOop.hpp" |
28 #include "oops/oop.inline.hpp" |
28 #include "oops/oop.inline.hpp" |
29 |
29 |
|
30 oop objArrayOopDesc::atomic_compare_exchange_oop(int index, oop exchange_value, |
|
31 oop compare_value) { |
|
32 volatile HeapWord* dest; |
|
33 if (UseCompressedOops) { |
|
34 dest = (HeapWord*)obj_at_addr<narrowOop>(index); |
|
35 } else { |
|
36 dest = (HeapWord*)obj_at_addr<oop>(index); |
|
37 } |
|
38 oop res = oopDesc::atomic_compare_exchange_oop(exchange_value, dest, compare_value, true); |
|
39 // update card mark if success |
|
40 if (res == compare_value) { |
|
41 update_barrier_set((void*)dest, exchange_value); |
|
42 } |
|
43 return res; |
|
44 } |
|
45 |
30 #define ObjArrayOop_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ |
46 #define ObjArrayOop_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ |
31 \ |
47 \ |
32 int objArrayOopDesc::oop_iterate_range(OopClosureType* blk, int start, int end) { \ |
48 int objArrayOopDesc::oop_iterate_range(OopClosureType* blk, int start, int end) { \ |
33 SpecializationStats::record_call(); \ |
49 SpecializationStats::record_call(); \ |
34 return ((ObjArrayKlass*)klass())->oop_oop_iterate_range##nv_suffix(this, blk, start, end); \ |
50 return ((ObjArrayKlass*)klass())->oop_oop_iterate_range##nv_suffix(this, blk, start, end); \ |