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
25 #include "precompiled.hpp"
26 #include "gc/shenandoah/shenandoahBarrierSet.inline.hpp"
27 #include "gc/shenandoah/shenandoahBarrierSetClone.inline.hpp"
28 #include "gc/shenandoah/shenandoahRuntime.hpp"
29 #include "gc/shenandoah/shenandoahThreadLocalData.hpp"
30 #include "runtime/interfaceSupport.inline.hpp"
31 #include "oops/oop.inline.hpp"
32 #include "utilities/copy.hpp"
33
34 void ShenandoahRuntime::write_ref_array_pre_oop_entry(oop* src, oop* dst, size_t length) {
35 ShenandoahBarrierSet *bs = ShenandoahBarrierSet::barrier_set();
36 bs->arraycopy_pre(src, dst, length);
37 }
38
39 void ShenandoahRuntime::write_ref_array_pre_narrow_oop_entry(narrowOop* src, narrowOop* dst, size_t length) {
40 ShenandoahBarrierSet *bs = ShenandoahBarrierSet::barrier_set();
41 bs->arraycopy_pre(src, dst, length);
42 }
43
44 void ShenandoahRuntime::write_ref_array_pre_duinit_oop_entry(oop* src, oop* dst, size_t length) {
45 ShenandoahBarrierSet *bs = ShenandoahBarrierSet::barrier_set();
46 bs->arraycopy_update(src, length);
47 }
48
49 void ShenandoahRuntime::write_ref_array_pre_duinit_narrow_oop_entry(narrowOop* src, narrowOop* dst, size_t length) {
50 ShenandoahBarrierSet *bs = ShenandoahBarrierSet::barrier_set();
51 bs->arraycopy_update(src, length);
52 }
53
54 // Shenandoah pre write barrier slowpath
55 JRT_LEAF(void, ShenandoahRuntime::write_ref_field_pre_entry(oopDesc* orig, JavaThread *thread))
56 if (orig == NULL) {
57 assert(false, "should be optimized out");
58 return;
59 }
60 shenandoah_assert_correct(NULL, orig);
61 // store the original value that was in the field reference
62 assert(ShenandoahThreadLocalData::satb_mark_queue(thread).is_active(), "Shouldn't be here otherwise");
63 ShenandoahThreadLocalData::satb_mark_queue(thread).enqueue_known_active(orig);
64 JRT_END
65
66 JRT_LEAF(oopDesc*, ShenandoahRuntime::load_reference_barrier(oopDesc* src, oop* load_addr))
67 return ShenandoahBarrierSet::barrier_set()->load_reference_barrier_mutator(src, load_addr);
68 JRT_END
69
70 JRT_LEAF(oopDesc*, ShenandoahRuntime::load_reference_barrier_narrow(oopDesc* src, narrowOop* load_addr))
71 return ShenandoahBarrierSet::barrier_set()->load_reference_barrier_mutator(src, load_addr);
|
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
25 #include "precompiled.hpp"
26 #include "gc/shenandoah/shenandoahBarrierSet.inline.hpp"
27 #include "gc/shenandoah/shenandoahBarrierSetClone.inline.hpp"
28 #include "gc/shenandoah/shenandoahRuntime.hpp"
29 #include "gc/shenandoah/shenandoahThreadLocalData.hpp"
30 #include "runtime/interfaceSupport.inline.hpp"
31 #include "oops/oop.inline.hpp"
32 #include "utilities/copy.hpp"
33
34 void ShenandoahRuntime::arraycopy_barrier_oop_entry(oop* src, oop* dst, size_t length) {
35 ShenandoahBarrierSet *bs = ShenandoahBarrierSet::barrier_set();
36 bs->arraycopy_barrier(src, dst, length);
37 }
38
39 void ShenandoahRuntime::arraycopy_barrier_narrow_oop_entry(narrowOop* src, narrowOop* dst, size_t length) {
40 ShenandoahBarrierSet *bs = ShenandoahBarrierSet::barrier_set();
41 bs->arraycopy_barrier(src, dst, length);
42 }
43
44 // Shenandoah pre write barrier slowpath
45 JRT_LEAF(void, ShenandoahRuntime::write_ref_field_pre_entry(oopDesc* orig, JavaThread *thread))
46 if (orig == NULL) {
47 assert(false, "should be optimized out");
48 return;
49 }
50 shenandoah_assert_correct(NULL, orig);
51 // store the original value that was in the field reference
52 assert(ShenandoahThreadLocalData::satb_mark_queue(thread).is_active(), "Shouldn't be here otherwise");
53 ShenandoahThreadLocalData::satb_mark_queue(thread).enqueue_known_active(orig);
54 JRT_END
55
56 JRT_LEAF(oopDesc*, ShenandoahRuntime::load_reference_barrier(oopDesc* src, oop* load_addr))
57 return ShenandoahBarrierSet::barrier_set()->load_reference_barrier_mutator(src, load_addr);
58 JRT_END
59
60 JRT_LEAF(oopDesc*, ShenandoahRuntime::load_reference_barrier_narrow(oopDesc* src, narrowOop* load_addr))
61 return ShenandoahBarrierSet::barrier_set()->load_reference_barrier_mutator(src, load_addr);
|