< prev index next >

src/cpu/x86/vm/templateTable_x86_64.cpp

Print this page




  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 "asm/macroAssembler.hpp"
  27 #include "interpreter/interpreter.hpp"
  28 #include "interpreter/interpreterRuntime.hpp"
  29 #include "interpreter/templateTable.hpp"
  30 #include "memory/universe.inline.hpp"
  31 #include "oops/methodData.hpp"
  32 #include "oops/objArrayKlass.hpp"
  33 #include "oops/oop.inline.hpp"
  34 #include "prims/methodHandles.hpp"
  35 #include "runtime/sharedRuntime.hpp"
  36 #include "runtime/stubRoutines.hpp"
  37 #include "runtime/synchronizer.hpp"
  38 #include "utilities/macros.hpp"



  39 
  40 #ifndef CC_INTERP
  41 
  42 #define __ _masm->
  43 
  44 // Platform-dependent initialization
  45 
  46 void TemplateTable::pd_initialize() {
  47   // No amd64 specific initialization
  48 }
  49 
  50 // Address computation: local variables
  51 
  52 static inline Address iaddress(int n) {
  53   return Address(r14, Interpreter::local_offset_in_bytes(n));
  54 }
  55 
  56 static inline Address laddress(int n) {
  57   return iaddress(n + 1);
  58 }


 153                                 rbx /* pre_val */,
 154                                 r15_thread /* thread */,
 155                                 r8  /* tmp */,
 156                                 val != noreg /* tosca_live */,
 157                                 false /* expand_call */);
 158         if (val == noreg) {
 159           __ store_heap_oop_null(Address(rdx, 0));
 160         } else {
 161           // G1 barrier needs uncompressed oop for region cross check.
 162           Register new_val = val;
 163           if (UseCompressedOops) {
 164             new_val = rbx;
 165             __ movptr(new_val, val);
 166           }
 167           __ store_heap_oop(Address(rdx, 0), val);
 168           __ g1_write_barrier_post(rdx /* store_adr */,
 169                                    new_val /* new_val */,
 170                                    r15_thread /* thread */,
 171                                    r8 /* tmp */,
 172                                    rbx /* tmp2 */);


























 173         }
 174       }
 175       break;
 176 #endif // INCLUDE_ALL_GCS
 177     case BarrierSet::CardTableModRef:
 178     case BarrierSet::CardTableExtension:
 179       {
 180         if (val == noreg) {
 181           __ store_heap_oop_null(obj);
 182         } else {
 183           __ store_heap_oop(obj, val);
 184           // flatten object address if needed
 185           if (!precise || (obj.index() == noreg && obj.disp() == 0)) {
 186             __ store_check(obj.base());
 187           } else {
 188             __ leaq(rdx, obj);
 189             __ store_check(rdx);
 190           }
 191         }
 192       }




  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 "asm/macroAssembler.hpp"
  27 #include "interpreter/interpreter.hpp"
  28 #include "interpreter/interpreterRuntime.hpp"
  29 #include "interpreter/templateTable.hpp"
  30 #include "memory/universe.inline.hpp"
  31 #include "oops/methodData.hpp"
  32 #include "oops/objArrayKlass.hpp"
  33 #include "oops/oop.inline.hpp"
  34 #include "prims/methodHandles.hpp"
  35 #include "runtime/sharedRuntime.hpp"
  36 #include "runtime/stubRoutines.hpp"
  37 #include "runtime/synchronizer.hpp"
  38 #include "utilities/macros.hpp"
  39 #if INCLUDE_ALL_GCS
  40 #include "shenandoahBarrierSetAssembler_x86.hpp"
  41 #endif
  42 
  43 #ifndef CC_INTERP
  44 
  45 #define __ _masm->
  46 
  47 // Platform-dependent initialization
  48 
  49 void TemplateTable::pd_initialize() {
  50   // No amd64 specific initialization
  51 }
  52 
  53 // Address computation: local variables
  54 
  55 static inline Address iaddress(int n) {
  56   return Address(r14, Interpreter::local_offset_in_bytes(n));
  57 }
  58 
  59 static inline Address laddress(int n) {
  60   return iaddress(n + 1);
  61 }


 156                                 rbx /* pre_val */,
 157                                 r15_thread /* thread */,
 158                                 r8  /* tmp */,
 159                                 val != noreg /* tosca_live */,
 160                                 false /* expand_call */);
 161         if (val == noreg) {
 162           __ store_heap_oop_null(Address(rdx, 0));
 163         } else {
 164           // G1 barrier needs uncompressed oop for region cross check.
 165           Register new_val = val;
 166           if (UseCompressedOops) {
 167             new_val = rbx;
 168             __ movptr(new_val, val);
 169           }
 170           __ store_heap_oop(Address(rdx, 0), val);
 171           __ g1_write_barrier_post(rdx /* store_adr */,
 172                                    new_val /* new_val */,
 173                                    r15_thread /* thread */,
 174                                    r8 /* tmp */,
 175                                    rbx /* tmp2 */);
 176         }
 177       }
 178       break;
 179     case BarrierSet::ShenandoahBarrierSet:
 180       {
 181         // flatten object address if needed
 182         if (obj.index() == noreg && obj.disp() == 0) {
 183           if (obj.base() != rdx) {
 184             __ movq(rdx, obj.base());
 185           }
 186         } else {
 187           __ leaq(rdx, obj);
 188         }
 189         if (ShenandoahSATBBarrier) {
 190           __ g1_write_barrier_pre(rdx /* obj */,
 191                                   rbx /* pre_val */,
 192                                   r15_thread /* thread */,
 193                                   r8  /* tmp */,
 194                                   val != noreg /* tosca_live */,
 195                                   false /* expand_call */);
 196         }
 197         if (val == noreg) {
 198           __ store_heap_oop_null(Address(rdx, 0));
 199         } else {
 200             ShenandoahBarrierSetAssembler::bsasm()->storeval_barrier(_masm, val, r8);
 201           __ store_heap_oop(Address(rdx, 0), val);
 202         }
 203       }
 204       break;
 205 #endif // INCLUDE_ALL_GCS
 206     case BarrierSet::CardTableModRef:
 207     case BarrierSet::CardTableExtension:
 208       {
 209         if (val == noreg) {
 210           __ store_heap_oop_null(obj);
 211         } else {
 212           __ store_heap_oop(obj, val);
 213           // flatten object address if needed
 214           if (!precise || (obj.index() == noreg && obj.disp() == 0)) {
 215             __ store_check(obj.base());
 216           } else {
 217             __ leaq(rdx, obj);
 218             __ store_check(rdx);
 219           }
 220         }
 221       }


< prev index next >