1 /* |
1 /* |
2 * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. |
3 * Copyright (c) 2012, 2017 SAP SE. All rights reserved. |
3 * Copyright (c) 2012, 2016 SAP SE. All rights reserved. |
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
5 * |
5 * |
6 * This code is free software; you can redistribute it and/or modify it |
6 * This code is free software; you can redistribute it and/or modify it |
7 * under the terms of the GNU General Public License version 2 only, as |
7 * under the terms of the GNU General Public License version 2 only, as |
8 * published by the Free Software Foundation. |
8 * published by the Free Software Foundation. |
3031 li(R0, 0); // dirty |
3031 li(R0, 0); // dirty |
3032 if (UseConcMarkSweepGC) membar(Assembler::StoreStore); |
3032 if (UseConcMarkSweepGC) membar(Assembler::StoreStore); |
3033 stbx(R0, Rtmp, Robj); |
3033 stbx(R0, Rtmp, Robj); |
3034 } |
3034 } |
3035 |
3035 |
3036 // Kills R31 if value is a volatile register. |
|
3037 void MacroAssembler::resolve_jobject(Register value, Register tmp1, Register tmp2, bool needs_frame) { |
|
3038 Label done; |
|
3039 cmpdi(CCR0, value, 0); |
|
3040 beq(CCR0, done); // Use NULL as-is. |
|
3041 |
|
3042 clrrdi(tmp1, value, JNIHandles::weak_tag_size); |
|
3043 #if INCLUDE_ALL_GCS |
|
3044 if (UseG1GC) { andi_(tmp2, value, JNIHandles::weak_tag_mask); } |
|
3045 #endif |
|
3046 ld(value, 0, tmp1); // Resolve (untagged) jobject. |
|
3047 |
|
3048 #if INCLUDE_ALL_GCS |
|
3049 if (UseG1GC) { |
|
3050 Label not_weak; |
|
3051 beq(CCR0, not_weak); // Test for jweak tag. |
|
3052 verify_oop(value); |
|
3053 g1_write_barrier_pre(noreg, // obj |
|
3054 noreg, // offset |
|
3055 value, // pre_val |
|
3056 tmp1, tmp2, needs_frame); |
|
3057 bind(not_weak); |
|
3058 } |
|
3059 #endif // INCLUDE_ALL_GCS |
|
3060 verify_oop(value); |
|
3061 bind(done); |
|
3062 } |
|
3063 |
|
3064 #if INCLUDE_ALL_GCS |
3036 #if INCLUDE_ALL_GCS |
3065 // General G1 pre-barrier generator. |
3037 // General G1 pre-barrier generator. |
3066 // Goal: record the previous value if it is not null. |
3038 // Goal: record the previous value if it is not null. |
3067 void MacroAssembler::g1_write_barrier_pre(Register Robj, RegisterOrConstant offset, Register Rpre_val, |
3039 void MacroAssembler::g1_write_barrier_pre(Register Robj, RegisterOrConstant offset, Register Rpre_val, |
3068 Register Rtmp1, Register Rtmp2, bool needs_frame) { |
3040 Register Rtmp1, Register Rtmp2, bool needs_frame) { |