< prev index next >

src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp

Print this page

  28 #include "opto/c2_MacroAssembler.hpp"
  29 #include "opto/compile.hpp"
  30 #include "opto/intrinsicnode.hpp"
  31 #include "opto/matcher.hpp"
  32 #include "opto/output.hpp"
  33 #include "opto/subnode.hpp"
  34 #include "runtime/stubRoutines.hpp"
  35 
  36 #ifdef PRODUCT
  37 #define BLOCK_COMMENT(str) /* nothing */
  38 #define STOP(error) stop(error)
  39 #else
  40 #define BLOCK_COMMENT(str) block_comment(str)
  41 #define STOP(error) block_comment(error); stop(error)
  42 #endif
  43 
  44 #define BIND(label) bind(label); BLOCK_COMMENT(#label ":")
  45 
  46 typedef void (MacroAssembler::* chr_insn)(Register Rt, const Address &adr);
  47 






















  48 void C2_MacroAssembler::emit_entry_barrier_stub(C2EntryBarrierStub* stub) {
  49   bind(stub->slow_path());
  50   movptr(rscratch1, (uintptr_t) StubRoutines::aarch64::method_entry_barrier());
  51   blr(rscratch1);
  52   b(stub->continuation());
  53 
  54   bind(stub->guard());
  55   relocate(entry_guard_Relocation::spec());
  56   emit_int32(0);   // nmethod guard value
  57 }
  58 
  59 int C2_MacroAssembler::entry_barrier_stub_size() {
  60   return 4 * 6;
  61 }
  62 
  63 // Search for str1 in str2 and return index or -1
  64 void C2_MacroAssembler::string_indexof(Register str2, Register str1,
  65                                        Register cnt2, Register cnt1,
  66                                        Register tmp1, Register tmp2,
  67                                        Register tmp3, Register tmp4,

  28 #include "opto/c2_MacroAssembler.hpp"
  29 #include "opto/compile.hpp"
  30 #include "opto/intrinsicnode.hpp"
  31 #include "opto/matcher.hpp"
  32 #include "opto/output.hpp"
  33 #include "opto/subnode.hpp"
  34 #include "runtime/stubRoutines.hpp"
  35 
  36 #ifdef PRODUCT
  37 #define BLOCK_COMMENT(str) /* nothing */
  38 #define STOP(error) stop(error)
  39 #else
  40 #define BLOCK_COMMENT(str) block_comment(str)
  41 #define STOP(error) block_comment(error); stop(error)
  42 #endif
  43 
  44 #define BIND(label) bind(label); BLOCK_COMMENT(#label ":")
  45 
  46 typedef void (MacroAssembler::* chr_insn)(Register Rt, const Address &adr);
  47 
  48 void C2_MacroAssembler::entry_barrier() {
  49   BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
  50   if (BarrierSet::barrier_set()->barrier_set_nmethod() != NULL) {
  51     // Dummy labels for just measuring the code size
  52     Label dummy_slow_path;
  53     Label dummy_continuation;
  54     Label dummy_guard;
  55     Label* slow_path = &dummy_slow_path;
  56     Label* continuation = &dummy_continuation;
  57     Label* guard = &dummy_guard;
  58     if (!Compile::current()->output()->in_scratch_emit_size()) {
  59       // Use real labels from actual stub when not emitting code for the purpose of measuring its size
  60       C2EntryBarrierStub* stub = Compile::current()->output()->entry_barrier_table()->add_entry_barrier();
  61       slow_path = &stub->slow_path();
  62       continuation = &stub->continuation();
  63       guard = &stub->guard();
  64     }
  65     // In the C2 code, we move the non-hot part of nmethod entry barriers out-of-line to a stub.
  66     bs->nmethod_entry_barrier(this, slow_path, continuation, guard);
  67   }
  68 }
  69 
  70 void C2_MacroAssembler::emit_entry_barrier_stub(C2EntryBarrierStub* stub) {
  71   bind(stub->slow_path());
  72   movptr(rscratch1, (uintptr_t) StubRoutines::aarch64::method_entry_barrier());
  73   blr(rscratch1);
  74   b(stub->continuation());
  75 
  76   bind(stub->guard());
  77   relocate(entry_guard_Relocation::spec());
  78   emit_int32(0);   // nmethod guard value
  79 }
  80 
  81 int C2_MacroAssembler::entry_barrier_stub_size() {
  82   return 4 * 6;
  83 }
  84 
  85 // Search for str1 in str2 and return index or -1
  86 void C2_MacroAssembler::string_indexof(Register str2, Register str1,
  87                                        Register cnt2, Register cnt1,
  88                                        Register tmp1, Register tmp2,
  89                                        Register tmp3, Register tmp4,
< prev index next >