2067 assert(!x->has_index() || idx.value() == x->index(), "should match"); |
2067 assert(!x->has_index() || idx.value() == x->index(), "should match"); |
2068 |
2068 |
2069 LIR_Opr base_op = base.result(); |
2069 LIR_Opr base_op = base.result(); |
2070 LIR_Opr index_op = idx.result(); |
2070 LIR_Opr index_op = idx.result(); |
2071 #ifndef _LP64 |
2071 #ifndef _LP64 |
2072 if (x->base()->type()->tag() == longTag) { |
2072 if (base_op->type() == T_LONG) { |
2073 base_op = new_register(T_INT); |
2073 base_op = new_register(T_INT); |
2074 __ convert(Bytecodes::_l2i, base.result(), base_op); |
2074 __ convert(Bytecodes::_l2i, base.result(), base_op); |
2075 } |
2075 } |
2076 if (x->has_index()) { |
2076 if (x->has_index()) { |
2077 if (x->index()->type()->tag() == longTag) { |
2077 if (index_op->type() == T_LONG) { |
2078 LIR_Opr long_index_op = index_op; |
2078 LIR_Opr long_index_op = index_op; |
2079 if (x->index()->type()->is_constant()) { |
2079 if (index_op->is_constant()) { |
2080 long_index_op = new_register(T_LONG); |
2080 long_index_op = new_register(T_LONG); |
2081 __ move(index_op, long_index_op); |
2081 __ move(index_op, long_index_op); |
2082 } |
2082 } |
2083 index_op = new_register(T_INT); |
2083 index_op = new_register(T_INT); |
2084 __ convert(Bytecodes::_l2i, long_index_op, index_op); |
2084 __ convert(Bytecodes::_l2i, long_index_op, index_op); |
2089 // At this point base and index should be all ints. |
2089 // At this point base and index should be all ints. |
2090 assert(base_op->type() == T_INT && !base_op->is_constant(), "base should be an non-constant int"); |
2090 assert(base_op->type() == T_INT && !base_op->is_constant(), "base should be an non-constant int"); |
2091 assert(!x->has_index() || index_op->type() == T_INT, "index should be an int"); |
2091 assert(!x->has_index() || index_op->type() == T_INT, "index should be an int"); |
2092 #else |
2092 #else |
2093 if (x->has_index()) { |
2093 if (x->has_index()) { |
2094 if (x->index()->type()->tag() == intTag) { |
2094 if (index_op->type() == T_INT) { |
2095 if (!x->index()->type()->is_constant()) { |
2095 if (!index_op->is_constant()) { |
2096 index_op = new_register(T_LONG); |
2096 index_op = new_register(T_LONG); |
2097 __ convert(Bytecodes::_i2l, idx.result(), index_op); |
2097 __ convert(Bytecodes::_i2l, idx.result(), index_op); |
2098 } |
2098 } |
2099 } else { |
2099 } else { |
2100 assert(x->index()->type()->tag() == longTag, "must be"); |
2100 assert(index_op->type() == T_LONG, "must be"); |
2101 if (x->index()->type()->is_constant()) { |
2101 if (index_op->is_constant()) { |
2102 index_op = new_register(T_LONG); |
2102 index_op = new_register(T_LONG); |
2103 __ move(idx.result(), index_op); |
2103 __ move(idx.result(), index_op); |
2104 } |
2104 } |
2105 } |
2105 } |
2106 } |
2106 } |
2177 |
2177 |
2178 LIR_Opr base_op = base.result(); |
2178 LIR_Opr base_op = base.result(); |
2179 LIR_Opr index_op = idx.result(); |
2179 LIR_Opr index_op = idx.result(); |
2180 |
2180 |
2181 #ifndef _LP64 |
2181 #ifndef _LP64 |
2182 if (x->base()->type()->tag() == longTag) { |
2182 if (base_op->type() == T_LONG) { |
2183 base_op = new_register(T_INT); |
2183 base_op = new_register(T_INT); |
2184 __ convert(Bytecodes::_l2i, base.result(), base_op); |
2184 __ convert(Bytecodes::_l2i, base.result(), base_op); |
2185 } |
2185 } |
2186 if (x->has_index()) { |
2186 if (x->has_index()) { |
2187 if (x->index()->type()->tag() == longTag) { |
2187 if (index_op->type() == T_LONG) { |
2188 index_op = new_register(T_INT); |
2188 index_op = new_register(T_INT); |
2189 __ convert(Bytecodes::_l2i, idx.result(), index_op); |
2189 __ convert(Bytecodes::_l2i, idx.result(), index_op); |
2190 } |
2190 } |
2191 } |
2191 } |
2192 // At this point base and index should be all ints and not constants |
2192 // At this point base and index should be all ints and not constants |
2193 assert(base_op->type() == T_INT && !base_op->is_constant(), "base should be an non-constant int"); |
2193 assert(base_op->type() == T_INT && !base_op->is_constant(), "base should be an non-constant int"); |
2194 assert(!x->has_index() || (index_op->type() == T_INT && !index_op->is_constant()), "index should be an non-constant int"); |
2194 assert(!x->has_index() || (index_op->type() == T_INT && !index_op->is_constant()), "index should be an non-constant int"); |
2195 #else |
2195 #else |
2196 if (x->has_index()) { |
2196 if (x->has_index()) { |
2197 if (x->index()->type()->tag() == intTag) { |
2197 if (index_op->type() == T_INT) { |
2198 index_op = new_register(T_LONG); |
2198 index_op = new_register(T_LONG); |
2199 __ convert(Bytecodes::_i2l, idx.result(), index_op); |
2199 __ convert(Bytecodes::_i2l, idx.result(), index_op); |
2200 } |
2200 } |
2201 } |
2201 } |
2202 // At this point base and index are long and non-constant |
2202 // At this point base and index are long and non-constant |