< 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 }


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


























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




  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 }


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


< prev index next >