1 /*
   2  * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  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 "ci/ciEnv.hpp"
  27 #include "ci/ciType.hpp"
  28 #include "ci/ciUtilities.inline.hpp"
  29 #include "classfile/systemDictionary.hpp"
  30 #include "memory/resourceArea.hpp"
  31 #include "oops/oop.inline.hpp"
  32 
  33 ciType* ciType::_basic_types[T_CONFLICT+1];
  34 
  35 // ciType
  36 //
  37 // This class represents either a class (T_OBJECT), array (T_ARRAY),
  38 // or one of the primitive types such as T_INT.
  39 
  40 // ------------------------------------------------------------------
  41 // ciType::ciType
  42 //
  43 ciType::ciType(BasicType basic_type) : ciMetadata() {
  44   assert(basic_type >= T_BOOLEAN && basic_type <= T_CONFLICT, "range check");
  45   _basic_type = basic_type;
  46 }
  47 
  48 ciType::ciType(Klass* k) : ciMetadata(k) {
  49   _basic_type = k->is_array_klass() ? T_ARRAY : T_OBJECT;
  50 }
  51 
  52 
  53 // ------------------------------------------------------------------
  54 // ciType::is_subtype_of
  55 //
  56 bool ciType::is_subtype_of(ciType* type) {
  57   if (this == type)  return true;
  58   if (is_klass() && type->is_klass())
  59     return this->as_klass()->is_subtype_of(type->as_klass());
  60   return false;
  61 }
  62 
  63 // ------------------------------------------------------------------
  64 // ciType::name
  65 //
  66 // Return the name of this type
  67 const char* ciType::name() {
  68   if (is_primitive_type()) {
  69     return type2name(basic_type());
  70   } else {
  71     assert(is_klass(), "must be");
  72     return as_klass()->name()->as_utf8();
  73   }
  74 }
  75 
  76 // ------------------------------------------------------------------
  77 // ciType::print_impl
  78 //
  79 // Implementation of the print method.
  80 void ciType::print_impl(outputStream* st) {
  81   st->print(" type=");
  82   print_name_on(st);
  83 }
  84 
  85 // ------------------------------------------------------------------
  86 // ciType::print_name
  87 //
  88 // Print the name of this type
  89 void ciType::print_name_on(outputStream* st) {
  90   ResourceMark rm;
  91   st->print("%s", name());
  92 }
  93 
  94 
  95 
  96 // ------------------------------------------------------------------
  97 // ciType::java_mirror
  98 //
  99 ciInstance* ciType::java_mirror() {
 100   VM_ENTRY_MARK;
 101   return CURRENT_THREAD_ENV->get_instance(Universe::java_mirror(basic_type()));
 102 }
 103 
 104 // ------------------------------------------------------------------
 105 // ciType::box_klass
 106 //
 107 ciKlass* ciType::box_klass() {
 108   if (!is_primitive_type())  return this->as_klass();  // reference types are "self boxing"
 109 
 110   // Void is "boxed" with a null.
 111   if (basic_type() == T_VOID)  return NULL;
 112 
 113   VM_ENTRY_MARK;
 114   return CURRENT_THREAD_ENV->get_instance_klass(SystemDictionary::box_klass(basic_type()));
 115 }
 116 
 117 
 118 // ------------------------------------------------------------------
 119 // ciType::make
 120 //
 121 // Produce the ciType for a given primitive BasicType.
 122 // As a bonus, produce the right reference type for T_OBJECT.
 123 // Does not work on T_ARRAY.
 124 ciType* ciType::make(BasicType t) {
 125   // short, etc.
 126   // Note: Bare T_ADDRESS means a raw pointer type, not a return_address.
 127   assert((uint)t < T_CONFLICT+1, "range check");
 128   if (t == T_OBJECT)  return ciEnv::_Object_klass;  // java/lang/Object
 129   assert(_basic_types[t] != NULL, "domain check");
 130   return _basic_types[t];
 131 }
 132 
 133 static bool is_float64vector(BasicType bt, vmSymbols::SID sid) {
 134   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Float64Vector);
 135 }
 136 static bool is_float64species(BasicType bt, vmSymbols::SID sid) {
 137   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Float64Vector_Float64Species);
 138 }
 139 static bool is_float64mask(BasicType bt, vmSymbols::SID sid) {
 140   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Float64Vector_Float64Mask);
 141 }
 142 static bool is_float64shuffle(BasicType bt, vmSymbols::SID sid) {
 143   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Float64Vector_Float64Shuffle);
 144 }
 145 static bool is_float64(BasicType bt, vmSymbols::SID sid) {
 146   return is_float64vector(bt, sid) || is_float64species(bt, sid) || is_float64mask(bt, sid);
 147 }
 148 static bool is_float128vector(BasicType bt, vmSymbols::SID sid) {
 149   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Float128Vector);
 150 }
 151 static bool is_float128species(BasicType bt, vmSymbols::SID sid) {
 152   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Float128Vector_Float128Species);
 153 }
 154 static bool is_float128mask(BasicType bt, vmSymbols::SID sid) {
 155   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Float128Vector_Float128Mask);
 156 }
 157 static bool is_float128shuffle(BasicType bt, vmSymbols::SID sid) {
 158   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Float128Vector_Float128Shuffle);
 159 }
 160 static bool is_float128(BasicType bt, vmSymbols::SID sid) {
 161   return is_float128vector(bt, sid) || is_float128species(bt, sid) || is_float128mask(bt, sid);
 162 }
 163 static bool is_float256vector(BasicType bt, vmSymbols::SID sid) {
 164   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Float256Vector);
 165 }
 166 static bool is_float256species(BasicType bt, vmSymbols::SID sid) {
 167   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Float256Vector_Float256Species);
 168 }
 169 static bool is_float256mask(BasicType bt, vmSymbols::SID sid) {
 170   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Float256Vector_Float256Mask);
 171 }
 172 static bool is_float256shuffle(BasicType bt, vmSymbols::SID sid) {
 173   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Float256Vector_Float256Shuffle);
 174 }
 175 static bool is_float256(BasicType bt, vmSymbols::SID sid) {
 176   return is_float256vector(bt, sid) || is_float256species(bt, sid) || is_float256mask(bt, sid);
 177 }
 178 static bool is_float512vector(BasicType bt, vmSymbols::SID sid) {
 179   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Float512Vector);
 180 }
 181 static bool is_float512species(BasicType bt, vmSymbols::SID sid) {
 182   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Float512Vector_Float512Species);
 183 }
 184 static bool is_float512mask(BasicType bt, vmSymbols::SID sid) {
 185   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Float512Vector_Float512Mask);
 186 }
 187 static bool is_float512shuffle(BasicType bt, vmSymbols::SID sid) {
 188   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Float512Vector_Float512Shuffle);
 189 }
 190 static bool is_float512(BasicType bt, vmSymbols::SID sid) {
 191   return is_float512vector(bt, sid) || is_float512species(bt, sid) || is_float512mask(bt, sid);
 192 }
 193 static bool is_float_vec_or_mask(BasicType bt, vmSymbols::SID sid) {
 194   return is_float64(bt, sid) || is_float128(bt, sid) || is_float256(bt, sid) || is_float512(bt, sid);
 195 }
 196 static bool is_double64vector(BasicType bt, vmSymbols::SID sid) {
 197   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Double64Vector);
 198 }
 199 static bool is_double64species(BasicType bt, vmSymbols::SID sid) {
 200   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Double64Vector_Double64Species);
 201 }
 202 static bool is_double64mask(BasicType bt, vmSymbols::SID sid) {
 203   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Double64Vector_Double64Mask);
 204 }
 205 static bool is_double64shuffle(BasicType bt, vmSymbols::SID sid) {
 206   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Double64Vector_Double64Shuffle);
 207 }
 208 static bool is_double64(BasicType bt, vmSymbols::SID sid) {
 209   return is_double64vector(bt, sid) || is_double64species(bt, sid) || is_double64mask(bt, sid);
 210 }
 211 static bool is_double128vector(BasicType bt, vmSymbols::SID sid) {
 212   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Double128Vector);
 213 }
 214 static bool is_double128species(BasicType bt, vmSymbols::SID sid) {
 215   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Double128Vector_Double128Species);
 216 }
 217 static bool is_double128mask(BasicType bt, vmSymbols::SID sid) {
 218   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Double128Vector_Double128Mask);
 219 }
 220 static bool is_double128shuffle(BasicType bt, vmSymbols::SID sid) {
 221   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Double128Vector_Double128Shuffle);
 222 }
 223 static bool is_double128(BasicType bt, vmSymbols::SID sid) {
 224   return is_double128vector(bt, sid) || is_double128species(bt, sid) || is_double128mask(bt, sid);
 225 }
 226 static bool is_double256vector(BasicType bt, vmSymbols::SID sid) {
 227   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Double256Vector);
 228 }
 229 static bool is_double256species(BasicType bt, vmSymbols::SID sid) {
 230   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Double256Vector_Double256Species);
 231 }
 232 static bool is_double256mask(BasicType bt, vmSymbols::SID sid) {
 233   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Double256Vector_Double256Mask);
 234 }
 235 static bool is_double256shuffle(BasicType bt, vmSymbols::SID sid) {
 236   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Double256Vector_Double256Shuffle);
 237 }
 238 static bool is_double256(BasicType bt, vmSymbols::SID sid) {
 239   return is_double256vector(bt, sid) || is_double256species(bt, sid) || is_double256mask(bt, sid);
 240 }
 241 static bool is_double512vector(BasicType bt, vmSymbols::SID sid) {
 242   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Double512Vector);
 243 }
 244 static bool is_double512species(BasicType bt, vmSymbols::SID sid) {
 245   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Double512Vector_Double512Species);
 246 }
 247 static bool is_double512mask(BasicType bt, vmSymbols::SID sid) {
 248   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Double512Vector_Double512Mask);
 249 }
 250 static bool is_double512shuffle(BasicType bt, vmSymbols::SID sid) {
 251   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Double512Vector_Double512Shuffle);
 252 }
 253 static bool is_double512(BasicType bt, vmSymbols::SID sid) {
 254   return is_double512vector(bt, sid) || is_double512species(bt, sid) || is_double512mask(bt, sid);
 255 }
 256 static bool is_double_vec_or_mask(BasicType bt, vmSymbols::SID sid) {
 257   return is_double64(bt, sid) || is_double128(bt, sid) || is_double256(bt, sid) || is_double512(bt, sid);
 258 }
 259 static bool is_int64vector(BasicType bt, vmSymbols::SID sid) {
 260   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Int64Vector);
 261 }
 262 static bool is_int64species(BasicType bt, vmSymbols::SID sid) {
 263   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Int64Vector_Int64Species);
 264 }
 265 static bool is_int64mask(BasicType bt, vmSymbols::SID sid) {
 266   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Int64Vector_Int64Mask);
 267 }
 268 static bool is_int64shuffle(BasicType bt, vmSymbols::SID sid) {
 269   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Int64Vector_Int64Shuffle);
 270 }
 271 static bool is_int64(BasicType bt, vmSymbols::SID sid) {
 272   return is_int64vector(bt, sid) || is_int64species(bt, sid) || is_int64mask(bt, sid);
 273 }
 274 static bool is_int128vector(BasicType bt, vmSymbols::SID sid) {
 275   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Int128Vector);
 276 }
 277 static bool is_int128species(BasicType bt, vmSymbols::SID sid) {
 278   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Int128Vector_Int128Species);
 279 }
 280 static bool is_int128mask(BasicType bt, vmSymbols::SID sid) {
 281   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Int128Vector_Int128Mask);
 282 }
 283 static bool is_int128shuffle(BasicType bt, vmSymbols::SID sid) {
 284   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Int128Vector_Int128Shuffle);
 285 }
 286 static bool is_int128(BasicType bt, vmSymbols::SID sid) {
 287   return is_int128vector(bt, sid) || is_int128species(bt, sid) || is_int128mask(bt, sid);
 288 }
 289 static bool is_int256vector(BasicType bt, vmSymbols::SID sid) {
 290   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Int256Vector);
 291 }
 292 static bool is_int256species(BasicType bt, vmSymbols::SID sid) {
 293   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Int256Vector_Int256Species);
 294 }
 295 static bool is_int256mask(BasicType bt, vmSymbols::SID sid) {
 296   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Int256Vector_Int256Mask);
 297 }
 298 static bool is_int256shuffle(BasicType bt, vmSymbols::SID sid) {
 299   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Int256Vector_Int256Shuffle);
 300 }
 301 static bool is_int256(BasicType bt, vmSymbols::SID sid) {
 302   return is_int256vector(bt, sid) || is_int256species(bt, sid) || is_int256mask(bt, sid);
 303 }
 304 static bool is_int512vector(BasicType bt, vmSymbols::SID sid) {
 305   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Int512Vector);
 306 }
 307 static bool is_int512species(BasicType bt, vmSymbols::SID sid) {
 308   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Int512Vector_Int512Species);
 309 }
 310 static bool is_int512mask(BasicType bt, vmSymbols::SID sid) {
 311   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Int512Vector_Int512Mask);
 312 }
 313 static bool is_int512shuffle(BasicType bt, vmSymbols::SID sid) {
 314   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Int512Vector_Int512Shuffle);
 315 }
 316 static bool is_int512(BasicType bt, vmSymbols::SID sid) {
 317   return is_int512vector(bt, sid) || is_int512species(bt, sid) || is_int512mask(bt, sid);
 318 }
 319 static bool is_int_vec_or_mask(BasicType bt, vmSymbols::SID sid) {
 320   return is_int64(bt, sid) || is_int128(bt, sid) || is_int256(bt, sid) || is_int512(bt, sid);
 321 }
 322 static bool is_long64vector(BasicType bt, vmSymbols::SID sid) {
 323   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Long64Vector);
 324 }
 325 static bool is_long64species(BasicType bt, vmSymbols::SID sid) {
 326   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Long64Vector_Long64Species);
 327 }
 328 static bool is_long64mask(BasicType bt, vmSymbols::SID sid) {
 329   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Long64Vector_Long64Mask);
 330 }
 331 static bool is_long64shuffle(BasicType bt, vmSymbols::SID sid) {
 332   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Long64Vector_Long64Shuffle);
 333 }
 334 static bool is_long64(BasicType bt, vmSymbols::SID sid) {
 335   return is_long64vector(bt, sid) || is_long64species(bt, sid) || is_long64mask(bt, sid);
 336 }
 337 static bool is_long128vector(BasicType bt, vmSymbols::SID sid) {
 338   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Long128Vector);
 339 }
 340 static bool is_long128species(BasicType bt, vmSymbols::SID sid) {
 341   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Long128Vector_Long128Species);
 342 }
 343 static bool is_long128mask(BasicType bt, vmSymbols::SID sid) {
 344   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Long128Vector_Long128Mask);
 345 }
 346 static bool is_long128shuffle(BasicType bt, vmSymbols::SID sid) {
 347   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Long128Vector_Long128Shuffle);
 348 }
 349 static bool is_long128(BasicType bt, vmSymbols::SID sid) {
 350   return is_long128vector(bt, sid) || is_long128species(bt, sid) || is_long128mask(bt, sid);
 351 }
 352 static bool is_long256vector(BasicType bt, vmSymbols::SID sid) {
 353   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Long256Vector);
 354 }
 355 static bool is_long256species(BasicType bt, vmSymbols::SID sid) {
 356   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Long256Vector_Long256Species);
 357 }
 358 static bool is_long256mask(BasicType bt, vmSymbols::SID sid) {
 359   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Long256Vector_Long256Mask);
 360 }
 361 static bool is_long256shuffle(BasicType bt, vmSymbols::SID sid) {
 362   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Long256Vector_Long256Shuffle);
 363 }
 364 static bool is_long256(BasicType bt, vmSymbols::SID sid) {
 365   return is_long256vector(bt, sid) || is_long256species(bt, sid) || is_long256mask(bt, sid);
 366 }
 367 static bool is_long512vector(BasicType bt, vmSymbols::SID sid) {
 368   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Long512Vector);
 369 }
 370 static bool is_long512species(BasicType bt, vmSymbols::SID sid) {
 371   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Long512Vector_Long512Species);
 372 }
 373 static bool is_long512mask(BasicType bt, vmSymbols::SID sid) {
 374   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Long512Vector_Long512Mask);
 375 }
 376 static bool is_long512shuffle(BasicType bt, vmSymbols::SID sid) {
 377   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Long512Vector_Long512Shuffle);
 378 }
 379 static bool is_long512(BasicType bt, vmSymbols::SID sid) {
 380   return is_long512vector(bt, sid) || is_long512species(bt, sid) || is_long512mask(bt, sid);
 381 }
 382 static bool is_long_vec_or_mask(BasicType bt, vmSymbols::SID sid) {
 383   return is_long64(bt, sid) || is_long128(bt, sid) || is_long256(bt, sid) || is_long512(bt, sid);
 384 }
 385 static bool is_byte64vector(BasicType bt, vmSymbols::SID sid) {
 386   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Byte64Vector);
 387 }
 388 static bool is_byte64species(BasicType bt, vmSymbols::SID sid) {
 389   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Byte64Vector_Byte64Species);
 390 }
 391 static bool is_byte64mask(BasicType bt, vmSymbols::SID sid) {
 392   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Byte64Vector_Byte64Mask);
 393 }
 394 static bool is_byte64shuffle(BasicType bt, vmSymbols::SID sid) {
 395   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Byte64Vector_Byte64Shuffle);
 396 }
 397 static bool is_byte64(BasicType bt, vmSymbols::SID sid) {
 398   return is_byte64vector(bt, sid) || is_byte64species(bt, sid) || is_byte64mask(bt, sid);
 399 }
 400 static bool is_byte128vector(BasicType bt, vmSymbols::SID sid) {
 401   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Byte128Vector);
 402 }
 403 static bool is_byte128species(BasicType bt, vmSymbols::SID sid) {
 404   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Byte128Vector_Byte128Species);
 405 }
 406 static bool is_byte128mask(BasicType bt, vmSymbols::SID sid) {
 407   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Byte128Vector_Byte128Mask);
 408 }
 409 static bool is_byte128shuffle(BasicType bt, vmSymbols::SID sid) {
 410   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Byte128Vector_Byte128Shuffle);
 411 }
 412 static bool is_byte128(BasicType bt, vmSymbols::SID sid) {
 413   return is_byte128vector(bt, sid) || is_byte128species(bt, sid) || is_byte128mask(bt, sid);
 414 }
 415 static bool is_byte256vector(BasicType bt, vmSymbols::SID sid) {
 416   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Byte256Vector);
 417 }
 418 static bool is_byte256species(BasicType bt, vmSymbols::SID sid) {
 419   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Byte256Vector_Byte256Species);
 420 }
 421 static bool is_byte256mask(BasicType bt, vmSymbols::SID sid) {
 422   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Byte256Vector_Byte256Mask);
 423 }
 424 static bool is_byte256shuffle(BasicType bt, vmSymbols::SID sid) {
 425   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Byte256Vector_Byte256Shuffle);
 426 }
 427 static bool is_byte256(BasicType bt, vmSymbols::SID sid) {
 428   return is_byte256vector(bt, sid) || is_byte256species(bt, sid) || is_byte256mask(bt, sid);
 429 }
 430 static bool is_byte512vector(BasicType bt, vmSymbols::SID sid) {
 431   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Byte512Vector);
 432 }
 433 static bool is_byte512species(BasicType bt, vmSymbols::SID sid) {
 434   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Byte512Vector_Byte512Species);
 435 }
 436 static bool is_byte512mask(BasicType bt, vmSymbols::SID sid) {
 437   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Byte512Vector_Byte512Mask);
 438 }
 439 static bool is_byte512shuffle(BasicType bt, vmSymbols::SID sid) {
 440   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Byte512Vector_Byte512Shuffle);
 441 }
 442 static bool is_byte512(BasicType bt, vmSymbols::SID sid) {
 443   return is_byte512vector(bt, sid) || is_byte512species(bt, sid) || is_byte512mask(bt, sid);
 444 }
 445 static bool is_byte_vec_or_mask(BasicType bt, vmSymbols::SID sid) {
 446   return is_byte64(bt, sid) || is_byte128(bt, sid) || is_byte256(bt, sid) || is_byte512(bt, sid);
 447 }
 448 static bool is_short64vector(BasicType bt, vmSymbols::SID sid) {
 449   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Short64Vector);
 450 }
 451 static bool is_short64species(BasicType bt, vmSymbols::SID sid) {
 452   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Short64Vector_Short64Species);
 453 }
 454 static bool is_short64mask(BasicType bt, vmSymbols::SID sid) {
 455   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Short64Vector_Short64Mask);
 456 }
 457 static bool is_short64shuffle(BasicType bt, vmSymbols::SID sid) {
 458   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Short64Vector_Short64Shuffle);
 459 }
 460 static bool is_short64(BasicType bt, vmSymbols::SID sid) {
 461   return is_short64vector(bt, sid) || is_short64species(bt, sid) || is_short64mask(bt, sid);
 462 }
 463 static bool is_short128vector(BasicType bt, vmSymbols::SID sid) {
 464   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Short128Vector);
 465 }
 466 static bool is_short128species(BasicType bt, vmSymbols::SID sid) {
 467   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Short128Vector_Short128Species);
 468 }
 469 static bool is_short128mask(BasicType bt, vmSymbols::SID sid) {
 470   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Short128Vector_Short128Mask);
 471 }
 472 static bool is_short128shuffle(BasicType bt, vmSymbols::SID sid) {
 473   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Short128Vector_Short128Shuffle);
 474 }
 475 static bool is_short128(BasicType bt, vmSymbols::SID sid) {
 476   return is_short128vector(bt, sid) || is_short128species(bt, sid) || is_short128mask(bt, sid);
 477 }
 478 static bool is_short256vector(BasicType bt, vmSymbols::SID sid) {
 479   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Short256Vector);
 480 }
 481 static bool is_short256species(BasicType bt, vmSymbols::SID sid) {
 482   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Short256Vector_Short256Species);
 483 }
 484 static bool is_short256mask(BasicType bt, vmSymbols::SID sid) {
 485   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Short256Vector_Short256Mask);
 486 }
 487 static bool is_short256shuffle(BasicType bt, vmSymbols::SID sid) {
 488   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Short256Vector_Short256Shuffle);
 489 }
 490 static bool is_short256(BasicType bt, vmSymbols::SID sid) {
 491   return is_short256vector(bt, sid) || is_short256species(bt, sid) || is_short256mask(bt, sid);
 492 }
 493 static bool is_short512vector(BasicType bt, vmSymbols::SID sid) {
 494   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Short512Vector);
 495 }
 496 static bool is_short512species(BasicType bt, vmSymbols::SID sid) {
 497   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Short512Vector_Short512Species);
 498 }
 499 static bool is_short512mask(BasicType bt, vmSymbols::SID sid) {
 500   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Short512Vector_Short512Mask);
 501 }
 502 static bool is_short512shuffle(BasicType bt, vmSymbols::SID sid) {
 503   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Short512Vector_Short512Shuffle);
 504 }
 505 static bool is_short512(BasicType bt, vmSymbols::SID sid) {
 506   return is_short512vector(bt, sid) || is_short512species(bt, sid) || is_short512mask(bt, sid);
 507 }
 508 static bool is_short_vec_or_mask(BasicType bt, vmSymbols::SID sid) {
 509   return is_short64(bt, sid) || is_short128(bt, sid) || is_short256(bt, sid) || is_short512(bt, sid);
 510 }
 511 
 512 #define __ basic_type(), as_klass()->name()->sid()
 513 
 514 bool ciType::is_vectormask() {
 515   return basic_type() == T_OBJECT &&
 516       (is_float64mask(__) || is_float128mask(__) || is_float256mask(__) || is_float512mask(__) ||
 517        is_double64mask(__) || is_double128mask(__) || is_double256mask(__) || is_double512mask(__) ||
 518        is_int64mask(__) || is_int128mask(__) || is_int256mask(__) || is_int512mask(__) ||
 519        is_long64mask(__) || is_long128mask(__) || is_long256mask(__) || is_long512mask(__) ||
 520        is_byte64mask(__) || is_byte128mask(__) || is_byte256mask(__) || is_byte512mask(__) ||
 521        is_short64mask(__) || is_short128mask(__) || is_short256mask(__) || is_short512mask(__));
 522 }
 523 
 524 bool ciType::is_vectorshuffle() {
 525   return basic_type() == T_OBJECT &&
 526       (is_float64shuffle(__) || is_float128shuffle(__) || is_float256shuffle(__) || is_float512shuffle(__) ||
 527        is_double64shuffle(__) || is_double128shuffle(__) || is_double256shuffle(__) || is_double512shuffle(__) ||
 528        is_int64shuffle(__) || is_int128shuffle(__) || is_int256shuffle(__) || is_int512shuffle(__) ||
 529        is_long64shuffle(__) || is_long128shuffle(__) || is_long256shuffle(__) || is_long512shuffle(__) ||
 530        is_byte64shuffle(__) || is_byte128shuffle(__) || is_byte256shuffle(__) || is_byte512shuffle(__) ||
 531        is_short64shuffle(__) || is_short128shuffle(__) || is_short256shuffle(__) || is_short512shuffle(__));
 532 }
 533 
 534 bool ciType::is_vectorapi_vector() {
 535   return is_float_vec_or_mask(__) ||
 536       is_double_vec_or_mask(__) ||
 537       is_int_vec_or_mask(__) ||
 538       is_long_vec_or_mask(__) ||
 539       is_byte_vec_or_mask(__) ||
 540       is_short_vec_or_mask(__);
 541 }
 542 
 543 int ciType::vectorapi_vector_size() {
 544   if ( is_double64(__) || is_long64(__)) return 1;
 545   if ( is_int64(__) || is_float64(__) || is_long128(__) || is_double128(__) ) return 2;
 546   if ( is_short64(__) || is_int128(__) || is_float128(__) || is_long256(__) || is_double256(__) ) return 4;
 547   if ( is_byte64(__) || is_short128(__) || is_int256(__) || is_float256(__) || is_long512(__) || is_double512(__) ) return 8;
 548   if ( is_byte128(__) || is_short256(__) || is_int512(__) || is_float512(__) ) return 16;
 549   if ( is_byte256(__) || is_short512(__) ) return 32;
 550   if ( is_byte512(__) ) return 64;
 551   return -1;
 552 }
 553 
 554 BasicType ciType::vectorapi_vector_bt() {
 555   if ( is_float_vec_or_mask(__) ) return T_FLOAT;
 556   if ( is_double_vec_or_mask(__) ) return T_DOUBLE;
 557   if ( is_int_vec_or_mask(__) ) return T_INT;
 558   if ( is_long_vec_or_mask(__) ) return T_LONG;
 559   if ( is_byte_vec_or_mask(__) ) return T_BYTE;
 560   if ( is_short_vec_or_mask(__) ) return T_SHORT;
 561   return T_VOID;
 562 }
 563 
 564 #undef __
 565 
 566 // ciReturnAddress
 567 //
 568 // This class represents the type of a specific return address in the
 569 // bytecodes.
 570 
 571 // ------------------------------------------------------------------
 572 // ciReturnAddress::ciReturnAddress
 573 //
 574 ciReturnAddress::ciReturnAddress(int bci) : ciType(T_ADDRESS) {
 575   assert(0 <= bci, "bci cannot be negative");
 576   _bci = bci;
 577 }
 578 
 579 // ------------------------------------------------------------------
 580 // ciReturnAddress::print_impl
 581 //
 582 // Implementation of the print method.
 583 void ciReturnAddress::print_impl(outputStream* st) {
 584   st->print(" bci=%d", _bci);
 585 }
 586 
 587 // ------------------------------------------------------------------
 588 // ciReturnAddress::make
 589 ciReturnAddress* ciReturnAddress::make(int bci) {
 590   GUARDED_VM_ENTRY(return CURRENT_ENV->get_return_address(bci);)
 591 }
--- EOF ---