src/share/vm/c1/c1_LIR.cpp

changeset 8865
ffcdff41a92f
parent 8856
ac27a9c85bea
child 9126
bc5b8e3dcb6b
     1.1 --- a/src/share/vm/c1/c1_LIR.cpp	Sat Jan 06 16:30:58 2018 +0800
     1.2 +++ b/src/share/vm/c1/c1_LIR.cpp	Thu May 24 19:49:50 2018 +0800
     1.3 @@ -392,8 +392,7 @@
     1.4          _stub(NULL) {
     1.5  }
     1.6  
     1.7 -#endif 
     1.8 -
     1.9 +#endif
    1.10  void LIR_OpBranch::change_block(BlockBegin* b) {
    1.11    assert(_block != NULL, "must have old block");
    1.12    assert(_block->label() == label(), "must be equal");
    1.13 @@ -1342,7 +1341,10 @@
    1.14  }
    1.15  
    1.16  void LIR_List::volatile_load_unsafe_reg(LIR_Opr base, LIR_Opr offset, LIR_Opr dst, BasicType type, CodeEmitInfo* info, LIR_PatchCode patch_code) {
    1.17 -#ifndef MIPS64
    1.18 +#ifdef MIPS64
    1.19 +  add(base, offset, base);
    1.20 +  offset = 0;
    1.21 +#endif
    1.22    append(new LIR_Op1(
    1.23              lir_move,
    1.24              LIR_OprFact::address(new LIR_Address(base, offset, type)),
    1.25 @@ -1350,16 +1352,6 @@
    1.26              type,
    1.27              patch_code,
    1.28              info, lir_move_volatile));
    1.29 -#else
    1.30 -  add(base, offset, base);
    1.31 -  append(new LIR_Op1(
    1.32 -            lir_move,
    1.33 -            LIR_OprFact::address(new LIR_Address(base, 0, type)),
    1.34 -            dst,
    1.35 -            type,
    1.36 -            patch_code,
    1.37 -            info, lir_move_volatile));
    1.38 -#endif
    1.39  }
    1.40  
    1.41  
    1.42 @@ -1415,7 +1407,10 @@
    1.43  }
    1.44  
    1.45  void LIR_List::volatile_store_unsafe_reg(LIR_Opr src, LIR_Opr base, LIR_Opr offset, BasicType type, CodeEmitInfo* info, LIR_PatchCode patch_code) {
    1.46 -#ifndef MIPS64
    1.47 +#ifdef MIPS64
    1.48 +  add(base, offset, base);
    1.49 +  offset = 0;
    1.50 +#endif
    1.51    append(new LIR_Op1(
    1.52              lir_move,
    1.53              src,
    1.54 @@ -1423,18 +1418,6 @@
    1.55              type,
    1.56              patch_code,
    1.57              info, lir_move_volatile));
    1.58 -#else
    1.59 -  add(base, offset, base);
    1.60 -  append(new LIR_Op1(
    1.61 -            lir_move,
    1.62 -            src,
    1.63 -            LIR_OprFact::address(new LIR_Address(base, 0, type)),
    1.64 -            type,
    1.65 -            patch_code,
    1.66 -            info, lir_move_volatile));
    1.67 -
    1.68 -#endif
    1.69 -
    1.70  }
    1.71  
    1.72  #ifdef MIPS64
    1.73 @@ -1503,18 +1486,6 @@
    1.74                      info));
    1.75  }
    1.76  
    1.77 -void LIR_List::null_check(LIR_Opr opr, CodeEmitInfo* info, bool deoptimize_on_null) {
    1.78 -  if (deoptimize_on_null) {
    1.79 -    // Emit an explicit null check and deoptimize if opr is null
    1.80 -    CodeStub* deopt = new DeoptimizeStub(info);
    1.81 -    cmp(lir_cond_equal, opr, LIR_OprFact::oopConst(NULL));
    1.82 -    branch(lir_cond_equal, T_OBJECT, deopt);
    1.83 -  } else {
    1.84 -    // Emit an implicit null check
    1.85 -    append(new LIR_Op1(lir_null_check, opr, info));
    1.86 -  }
    1.87 -}
    1.88 -
    1.89  void LIR_List::cmp_reg_mem(LIR_Condition condition, LIR_Opr reg, LIR_Address* addr, CodeEmitInfo* info) {
    1.90    append(new LIR_Op2(
    1.91                      lir_cmp,
    1.92 @@ -1523,7 +1494,26 @@
    1.93                      LIR_OprFact::address(addr),
    1.94                      info));
    1.95  }
    1.96 +#endif
    1.97  
    1.98 +void LIR_List::null_check(LIR_Opr opr, CodeEmitInfo* info, bool deoptimize_on_null) {
    1.99 +  if (deoptimize_on_null) {
   1.100 +    // Emit an explicit null check and deoptimize if opr is null
   1.101 +    CodeStub* deopt = new DeoptimizeStub(info);
   1.102 +#ifndef MIPS64
   1.103 +    cmp(lir_cond_equal, opr, LIR_OprFact::oopConst(NULL));
   1.104 +    branch(lir_cond_equal, T_OBJECT, deopt);
   1.105 +#else
   1.106 +    null_check_for_branch(lir_cond_equal, opr, LIR_OprFact::oopConst(NULL));
   1.107 +    branch(lir_cond_equal, opr, LIR_OprFact::oopConst(NULL), T_OBJECT, deopt);
   1.108 +#endif
   1.109 +  } else {
   1.110 +    // Emit an implicit null check
   1.111 +    append(new LIR_Op1(lir_null_check, opr, info));
   1.112 +  }
   1.113 +}
   1.114 +
   1.115 +#ifndef MIPS64
   1.116  void LIR_List::allocate_object(LIR_Opr dst, LIR_Opr t1, LIR_Opr t2, LIR_Opr t3, LIR_Opr t4,
   1.117                                 int header_size, int object_size, LIR_Opr klass, bool init_check, CodeStub* stub) {
   1.118    append(new LIR_OpAllocObj(
   1.119 @@ -1552,7 +1542,7 @@
   1.120                             stub));
   1.121  }
   1.122  #else
   1.123 - void LIR_List::allocate_object(LIR_Opr dst, LIR_Opr t1, LIR_Opr t2, LIR_Opr t3, LIR_Opr t4, LIR_Opr t5, LIR_Opr t6,
   1.124 +void LIR_List::allocate_object(LIR_Opr dst, LIR_Opr t1, LIR_Opr t2, LIR_Opr t3, LIR_Opr t4, LIR_Opr t5, LIR_Opr t6,
   1.125                                  int header_size, int object_size, LIR_Opr klass, bool init_check, CodeStub* stub) {
   1.126          append(new LIR_OpAllocObj(
   1.127                                  klass,
   1.128 @@ -1674,6 +1664,7 @@
   1.129    append(c);
   1.130  }
   1.131  
   1.132 +
   1.133  void LIR_List::store_check(LIR_Opr object, LIR_Opr array, LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3,
   1.134                             CodeEmitInfo* info_for_exception, ciMethod* profiled_method, int profiled_bci) {
   1.135    LIR_OpTypeCheck* c = new LIR_OpTypeCheck(lir_store_check, object, array, tmp1, tmp2, tmp3, info_for_exception);
   1.136 @@ -1685,6 +1676,7 @@
   1.137    append(c);
   1.138  }
   1.139  
   1.140 +
   1.141  #ifndef MIPS64
   1.142  void LIR_List::cas_long(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value,
   1.143                          LIR_Opr t1, LIR_Opr t2, LIR_Opr result) {

mercurial