hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp
changeset 44093 e22e0d071bf9
parent 44088 fb5421685295
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  * 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.
  5127     vxorps(dst, nds, Address(rscratch1, 0), vector_len);
  5127     vxorps(dst, nds, Address(rscratch1, 0), vector_len);
  5128   }
  5128   }
  5129 }
  5129 }
  5130 
  5130 
  5131 
  5131 
  5132 void MacroAssembler::resolve_jobject(Register value,
       
  5133                                      Register thread,
       
  5134                                      Register tmp) {
       
  5135   assert_different_registers(value, thread, tmp);
       
  5136   Label done, not_weak;
       
  5137   testptr(value, value);
       
  5138   jcc(Assembler::zero, done);                // Use NULL as-is.
       
  5139   testptr(value, JNIHandles::weak_tag_mask); // Test for jweak tag.
       
  5140   jcc(Assembler::zero, not_weak);
       
  5141   // Resolve jweak.
       
  5142   movptr(value, Address(value, -JNIHandles::weak_tag_value));
       
  5143   verify_oop(value);
       
  5144 #if INCLUDE_ALL_GCS
       
  5145   if (UseG1GC) {
       
  5146     g1_write_barrier_pre(noreg /* obj */,
       
  5147                          value /* pre_val */,
       
  5148                          thread /* thread */,
       
  5149                          tmp /* tmp */,
       
  5150                          true /* tosca_live */,
       
  5151                          true /* expand_call */);
       
  5152   }
       
  5153 #endif // INCLUDE_ALL_GCS
       
  5154   jmp(done);
       
  5155   bind(not_weak);
       
  5156   // Resolve (untagged) jobject.
       
  5157   movptr(value, Address(value, 0));
       
  5158   verify_oop(value);
       
  5159   bind(done);
       
  5160 }
       
  5161 
       
  5162 void MacroAssembler::clear_jweak_tag(Register possibly_jweak) {
       
  5163   const int32_t inverted_jweak_mask = ~static_cast<int32_t>(JNIHandles::weak_tag_mask);
       
  5164   STATIC_ASSERT(inverted_jweak_mask == -2); // otherwise check this code
       
  5165   // The inverted mask is sign-extended
       
  5166   andptr(possibly_jweak, inverted_jweak_mask);
       
  5167 }
       
  5168 
       
  5169 //////////////////////////////////////////////////////////////////////////////////
  5132 //////////////////////////////////////////////////////////////////////////////////
  5170 #if INCLUDE_ALL_GCS
  5133 #if INCLUDE_ALL_GCS
  5171 
  5134 
  5172 void MacroAssembler::g1_write_barrier_pre(Register obj,
  5135 void MacroAssembler::g1_write_barrier_pre(Register obj,
  5173                                           Register pre_val,
  5136                                           Register pre_val,