< 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 // Search for str1 in str2 and return index or -1
  49 // Clobbers: rscratch1, rscratch2, rflags. May also clobber v0-v1, when icnt1==-1.
  50 void C2_MacroAssembler::string_indexof(Register str2, Register str1,
  51                                        Register cnt2, Register cnt1,
  52                                        Register tmp1, Register tmp2,
  53                                        Register tmp3, Register tmp4,
  54                                        Register tmp5, Register tmp6,
  55                                        int icnt1, Register result, int ae) {
  56   // NOTE: tmp5, tmp6 can be zr depending on specific method version
  57   Label LINEARSEARCH, LINEARSTUB, LINEAR_MEDIUM, DONE, NOMATCH, MATCH;
  58 
  59   Register ch1 = rscratch1;
  60   Register ch2 = rscratch2;
  61   Register cnt1tmp = tmp1;
  62   Register cnt2tmp = tmp2;
  63   Register cnt1_neg = cnt1;
  64   Register cnt2_neg = cnt2;
  65   Register result_tmp = tmp4;
  66 
  67   bool isL = ae == StrIntrinsicNode::LL;

  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() != nullptr) {
  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 = new (Compile::current()->comp_arena()) C2EntryBarrierStub();
  61       Compile::current()->output()->add_stub(stub);
  62       slow_path = &stub->entry();
  63       continuation = &stub->continuation();
  64       guard = &stub->guard();
  65     }
  66     // In the C2 code, we move the non-hot part of nmethod entry barriers out-of-line to a stub.
  67     bs->nmethod_entry_barrier(this, slow_path, continuation, guard);
  68   }
  69 }
  70 
  71 // Search for str1 in str2 and return index or -1
  72 // Clobbers: rscratch1, rscratch2, rflags. May also clobber v0-v1, when icnt1==-1.
  73 void C2_MacroAssembler::string_indexof(Register str2, Register str1,
  74                                        Register cnt2, Register cnt1,
  75                                        Register tmp1, Register tmp2,
  76                                        Register tmp3, Register tmp4,
  77                                        Register tmp5, Register tmp6,
  78                                        int icnt1, Register result, int ae) {
  79   // NOTE: tmp5, tmp6 can be zr depending on specific method version
  80   Label LINEARSEARCH, LINEARSTUB, LINEAR_MEDIUM, DONE, NOMATCH, MATCH;
  81 
  82   Register ch1 = rscratch1;
  83   Register ch2 = rscratch2;
  84   Register cnt1tmp = tmp1;
  85   Register cnt2tmp = tmp2;
  86   Register cnt1_neg = cnt1;
  87   Register cnt2_neg = cnt2;
  88   Register result_tmp = tmp4;
  89 
  90   bool isL = ae == StrIntrinsicNode::LL;
< prev index next >