hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp
changeset 44093 e22e0d071bf9
parent 44088 fb5421685295
child 46338 e84b501fa52e
child 44406 a46a6c4d1dd9
equal deleted inserted replaced
44092:bc842cc2356b 44093:e22e0d071bf9
     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) {
  3120   stdx(Rpre_val, Rbuffer, Rindex);
  3092   stdx(Rpre_val, Rbuffer, Rindex);
  3121   b(filtered);
  3093   b(filtered);
  3122 
  3094 
  3123   bind(runtime);
  3095   bind(runtime);
  3124 
  3096 
  3125   // May need to preserve LR. Also needed if current frame is not compatible with C calling convention.
  3097   // VM call need frame to access(write) O register.
  3126   if (needs_frame) {
  3098   if (needs_frame) {
  3127     save_LR_CR(Rtmp1);
  3099     save_LR_CR(Rtmp1);
  3128     push_frame_reg_args(0, Rtmp2);
  3100     push_frame_reg_args(0, Rtmp2);
  3129   }
  3101   }
  3130 
  3102