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_float64(BasicType bt, vmSymbols::SID sid) {
 143   return is_float64vector(bt, sid) || is_float64species(bt, sid) || is_float64mask(bt, sid);
 144 }
 145 static bool is_float128vector(BasicType bt, vmSymbols::SID sid) {
 146   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Float128Vector);
 147 }
 148 static bool is_float128species(BasicType bt, vmSymbols::SID sid) {
 149   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Float128Vector_Float128Species);
 150 }
 151 static bool is_float128mask(BasicType bt, vmSymbols::SID sid) {
 152   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Float128Vector_Float128Mask);
 153 }



 154 static bool is_float128(BasicType bt, vmSymbols::SID sid) {
 155   return is_float128vector(bt, sid) || is_float128species(bt, sid) || is_float128mask(bt, sid);
 156 }
 157 static bool is_float256vector(BasicType bt, vmSymbols::SID sid) {
 158   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Float256Vector);
 159 }
 160 static bool is_float256species(BasicType bt, vmSymbols::SID sid) {
 161   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Float256Vector_Float256Species);
 162 }
 163 static bool is_float256mask(BasicType bt, vmSymbols::SID sid) {
 164   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Float256Vector_Float256Mask);
 165 }



 166 static bool is_float256(BasicType bt, vmSymbols::SID sid) {
 167   return is_float256vector(bt, sid) || is_float256species(bt, sid) || is_float256mask(bt, sid);
 168 }
 169 static bool is_float512vector(BasicType bt, vmSymbols::SID sid) {
 170   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Float512Vector);
 171 }
 172 static bool is_float512species(BasicType bt, vmSymbols::SID sid) {
 173   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Float512Vector_Float512Species);
 174 }
 175 static bool is_float512mask(BasicType bt, vmSymbols::SID sid) {
 176   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Float512Vector_Float512Mask);
 177 }



 178 static bool is_float512(BasicType bt, vmSymbols::SID sid) {
 179   return is_float512vector(bt, sid) || is_float512species(bt, sid) || is_float512mask(bt, sid);
 180 }
 181 static bool is_float_vec_or_mask(BasicType bt, vmSymbols::SID sid) {
 182   return is_float64(bt, sid) || is_float128(bt, sid) || is_float256(bt, sid) || is_float512(bt, sid);
 183 }
 184 static bool is_double64vector(BasicType bt, vmSymbols::SID sid) {
 185   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Double64Vector);
 186 }
 187 static bool is_double64species(BasicType bt, vmSymbols::SID sid) {
 188   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Double64Vector_Double64Species);
 189 }
 190 static bool is_double64mask(BasicType bt, vmSymbols::SID sid) {
 191   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Double64Vector_Double64Mask);
 192 }



 193 static bool is_double64(BasicType bt, vmSymbols::SID sid) {
 194   return is_double64vector(bt, sid) || is_double64species(bt, sid) || is_double64mask(bt, sid);
 195 }
 196 static bool is_double128vector(BasicType bt, vmSymbols::SID sid) {
 197   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Double128Vector);
 198 }
 199 static bool is_double128species(BasicType bt, vmSymbols::SID sid) {
 200   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Double128Vector_Double128Species);
 201 }
 202 static bool is_double128mask(BasicType bt, vmSymbols::SID sid) {
 203   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Double128Vector_Double128Mask);
 204 }



 205 static bool is_double128(BasicType bt, vmSymbols::SID sid) {
 206   return is_double128vector(bt, sid) || is_double128species(bt, sid) || is_double128mask(bt, sid);
 207 }
 208 static bool is_double256vector(BasicType bt, vmSymbols::SID sid) {
 209   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Double256Vector);
 210 }
 211 static bool is_double256species(BasicType bt, vmSymbols::SID sid) {
 212   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Double256Vector_Double256Species);
 213 }
 214 static bool is_double256mask(BasicType bt, vmSymbols::SID sid) {
 215   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Double256Vector_Double256Mask);
 216 }



 217 static bool is_double256(BasicType bt, vmSymbols::SID sid) {
 218   return is_double256vector(bt, sid) || is_double256species(bt, sid) || is_double256mask(bt, sid);
 219 }
 220 static bool is_double512vector(BasicType bt, vmSymbols::SID sid) {
 221   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Double512Vector);
 222 }
 223 static bool is_double512species(BasicType bt, vmSymbols::SID sid) {
 224   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Double512Vector_Double512Species);
 225 }
 226 static bool is_double512mask(BasicType bt, vmSymbols::SID sid) {
 227   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Double512Vector_Double512Mask);
 228 }



 229 static bool is_double512(BasicType bt, vmSymbols::SID sid) {
 230   return is_double512vector(bt, sid) || is_double512species(bt, sid) || is_double512mask(bt, sid);
 231 }
 232 static bool is_double_vec_or_mask(BasicType bt, vmSymbols::SID sid) {
 233   return is_double64(bt, sid) || is_double128(bt, sid) || is_double256(bt, sid) || is_double512(bt, sid);
 234 }
 235 static bool is_int64vector(BasicType bt, vmSymbols::SID sid) {
 236   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Int64Vector);
 237 }
 238 static bool is_int64species(BasicType bt, vmSymbols::SID sid) {
 239   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Int64Vector_Int64Species);
 240 }
 241 static bool is_int64mask(BasicType bt, vmSymbols::SID sid) {
 242   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Int64Vector_Int64Mask);
 243 }



 244 static bool is_int64(BasicType bt, vmSymbols::SID sid) {
 245   return is_int64vector(bt, sid) || is_int64species(bt, sid) || is_int64mask(bt, sid);
 246 }
 247 static bool is_int128vector(BasicType bt, vmSymbols::SID sid) {
 248   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Int128Vector);
 249 }
 250 static bool is_int128species(BasicType bt, vmSymbols::SID sid) {
 251   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Int128Vector_Int128Species);
 252 }
 253 static bool is_int128mask(BasicType bt, vmSymbols::SID sid) {
 254   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Int128Vector_Int128Mask);
 255 }



 256 static bool is_int128(BasicType bt, vmSymbols::SID sid) {
 257   return is_int128vector(bt, sid) || is_int128species(bt, sid) || is_int128mask(bt, sid);
 258 }
 259 static bool is_int256vector(BasicType bt, vmSymbols::SID sid) {
 260   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Int256Vector);
 261 }
 262 static bool is_int256species(BasicType bt, vmSymbols::SID sid) {
 263   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Int256Vector_Int256Species);
 264 }
 265 static bool is_int256mask(BasicType bt, vmSymbols::SID sid) {
 266   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Int256Vector_Int256Mask);
 267 }



 268 static bool is_int256(BasicType bt, vmSymbols::SID sid) {
 269   return is_int256vector(bt, sid) || is_int256species(bt, sid) || is_int256mask(bt, sid);
 270 }
 271 static bool is_int512vector(BasicType bt, vmSymbols::SID sid) {
 272   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Int512Vector);
 273 }
 274 static bool is_int512species(BasicType bt, vmSymbols::SID sid) {
 275   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Int512Vector_Int512Species);
 276 }
 277 static bool is_int512mask(BasicType bt, vmSymbols::SID sid) {
 278   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Int512Vector_Int512Mask);
 279 }



 280 static bool is_int512(BasicType bt, vmSymbols::SID sid) {
 281   return is_int512vector(bt, sid) || is_int512species(bt, sid) || is_int512mask(bt, sid);
 282 }
 283 static bool is_int_vec_or_mask(BasicType bt, vmSymbols::SID sid) {
 284   return is_int64(bt, sid) || is_int128(bt, sid) || is_int256(bt, sid) || is_int512(bt, sid);
 285 }
 286 static bool is_long64vector(BasicType bt, vmSymbols::SID sid) {
 287   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Long64Vector);
 288 }
 289 static bool is_long64species(BasicType bt, vmSymbols::SID sid) {
 290   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Long64Vector_Long64Species);
 291 }
 292 static bool is_long64mask(BasicType bt, vmSymbols::SID sid) {
 293   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Long64Vector_Long64Mask);
 294 }



 295 static bool is_long64(BasicType bt, vmSymbols::SID sid) {
 296   return is_long64vector(bt, sid) || is_long64species(bt, sid) || is_long64mask(bt, sid);
 297 }
 298 static bool is_long128vector(BasicType bt, vmSymbols::SID sid) {
 299   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Long128Vector);
 300 }
 301 static bool is_long128species(BasicType bt, vmSymbols::SID sid) {
 302   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Long128Vector_Long128Species);
 303 }
 304 static bool is_long128mask(BasicType bt, vmSymbols::SID sid) {
 305   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Long128Vector_Long128Mask);
 306 }



 307 static bool is_long128(BasicType bt, vmSymbols::SID sid) {
 308   return is_long128vector(bt, sid) || is_long128species(bt, sid) || is_long128mask(bt, sid);
 309 }
 310 static bool is_long256vector(BasicType bt, vmSymbols::SID sid) {
 311   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Long256Vector);
 312 }
 313 static bool is_long256species(BasicType bt, vmSymbols::SID sid) {
 314   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Long256Vector_Long256Species);
 315 }
 316 static bool is_long256mask(BasicType bt, vmSymbols::SID sid) {
 317   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Long256Vector_Long256Mask);
 318 }



 319 static bool is_long256(BasicType bt, vmSymbols::SID sid) {
 320   return is_long256vector(bt, sid) || is_long256species(bt, sid) || is_long256mask(bt, sid);
 321 }
 322 static bool is_long512vector(BasicType bt, vmSymbols::SID sid) {
 323   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Long512Vector);
 324 }
 325 static bool is_long512species(BasicType bt, vmSymbols::SID sid) {
 326   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Long512Vector_Long512Species);
 327 }
 328 static bool is_long512mask(BasicType bt, vmSymbols::SID sid) {
 329   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Long512Vector_Long512Mask);
 330 }



 331 static bool is_long512(BasicType bt, vmSymbols::SID sid) {
 332   return is_long512vector(bt, sid) || is_long512species(bt, sid) || is_long512mask(bt, sid);
 333 }
 334 static bool is_long_vec_or_mask(BasicType bt, vmSymbols::SID sid) {
 335   return is_long64(bt, sid) || is_long128(bt, sid) || is_long256(bt, sid) || is_long512(bt, sid);
 336 }
 337 static bool is_byte64vector(BasicType bt, vmSymbols::SID sid) {
 338   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Byte64Vector);
 339 }
 340 static bool is_byte64species(BasicType bt, vmSymbols::SID sid) {
 341   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Byte64Vector_Byte64Species);
 342 }
 343 static bool is_byte64mask(BasicType bt, vmSymbols::SID sid) {
 344   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Byte64Vector_Byte64Mask);
 345 }



 346 static bool is_byte64(BasicType bt, vmSymbols::SID sid) {
 347   return is_byte64vector(bt, sid) || is_byte64species(bt, sid) || is_byte64mask(bt, sid);
 348 }
 349 static bool is_byte128vector(BasicType bt, vmSymbols::SID sid) {
 350   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Byte128Vector);
 351 }
 352 static bool is_byte128species(BasicType bt, vmSymbols::SID sid) {
 353   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Byte128Vector_Byte128Species);
 354 }
 355 static bool is_byte128mask(BasicType bt, vmSymbols::SID sid) {
 356   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Byte128Vector_Byte128Mask);
 357 }



 358 static bool is_byte128(BasicType bt, vmSymbols::SID sid) {
 359   return is_byte128vector(bt, sid) || is_byte128species(bt, sid) || is_byte128mask(bt, sid);
 360 }
 361 static bool is_byte256vector(BasicType bt, vmSymbols::SID sid) {
 362   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Byte256Vector);
 363 }
 364 static bool is_byte256species(BasicType bt, vmSymbols::SID sid) {
 365   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Byte256Vector_Byte256Species);
 366 }
 367 static bool is_byte256mask(BasicType bt, vmSymbols::SID sid) {
 368   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Byte256Vector_Byte256Mask);
 369 }



 370 static bool is_byte256(BasicType bt, vmSymbols::SID sid) {
 371   return is_byte256vector(bt, sid) || is_byte256species(bt, sid) || is_byte256mask(bt, sid);
 372 }
 373 static bool is_byte512vector(BasicType bt, vmSymbols::SID sid) {
 374   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Byte512Vector);
 375 }
 376 static bool is_byte512species(BasicType bt, vmSymbols::SID sid) {
 377   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Byte512Vector_Byte512Species);
 378 }
 379 static bool is_byte512mask(BasicType bt, vmSymbols::SID sid) {
 380   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Byte512Vector_Byte512Mask);
 381 }



 382 static bool is_byte512(BasicType bt, vmSymbols::SID sid) {
 383   return is_byte512vector(bt, sid) || is_byte512species(bt, sid) || is_byte512mask(bt, sid);
 384 }
 385 static bool is_byte_vec_or_mask(BasicType bt, vmSymbols::SID sid) {
 386   return is_byte64(bt, sid) || is_byte128(bt, sid) || is_byte256(bt, sid) || is_byte512(bt, sid);
 387 }
 388 static bool is_short64vector(BasicType bt, vmSymbols::SID sid) {
 389   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Short64Vector);
 390 }
 391 static bool is_short64species(BasicType bt, vmSymbols::SID sid) {
 392   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Short64Vector_Short64Species);
 393 }
 394 static bool is_short64mask(BasicType bt, vmSymbols::SID sid) {
 395   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Short64Vector_Short64Mask);
 396 }



 397 static bool is_short64(BasicType bt, vmSymbols::SID sid) {
 398   return is_short64vector(bt, sid) || is_short64species(bt, sid) || is_short64mask(bt, sid);
 399 }
 400 static bool is_short128vector(BasicType bt, vmSymbols::SID sid) {
 401   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Short128Vector);
 402 }
 403 static bool is_short128species(BasicType bt, vmSymbols::SID sid) {
 404   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Short128Vector_Short128Species);
 405 }
 406 static bool is_short128mask(BasicType bt, vmSymbols::SID sid) {
 407   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Short128Vector_Short128Mask);
 408 }



 409 static bool is_short128(BasicType bt, vmSymbols::SID sid) {
 410   return is_short128vector(bt, sid) || is_short128species(bt, sid) || is_short128mask(bt, sid);
 411 }
 412 static bool is_short256vector(BasicType bt, vmSymbols::SID sid) {
 413   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Short256Vector);
 414 }
 415 static bool is_short256species(BasicType bt, vmSymbols::SID sid) {
 416   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Short256Vector_Short256Species);
 417 }
 418 static bool is_short256mask(BasicType bt, vmSymbols::SID sid) {
 419   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Short256Vector_Short256Mask);
 420 }



 421 static bool is_short256(BasicType bt, vmSymbols::SID sid) {
 422   return is_short256vector(bt, sid) || is_short256species(bt, sid) || is_short256mask(bt, sid);
 423 }
 424 static bool is_short512vector(BasicType bt, vmSymbols::SID sid) {
 425   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Short512Vector);
 426 }
 427 static bool is_short512species(BasicType bt, vmSymbols::SID sid) {
 428   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Short512Vector_Short512Species);
 429 }
 430 static bool is_short512mask(BasicType bt, vmSymbols::SID sid) {
 431   return bt == T_OBJECT && sid == vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_incubator_vector_Short512Vector_Short512Mask);
 432 }



 433 static bool is_short512(BasicType bt, vmSymbols::SID sid) {
 434   return is_short512vector(bt, sid) || is_short512species(bt, sid) || is_short512mask(bt, sid);
 435 }
 436 static bool is_short_vec_or_mask(BasicType bt, vmSymbols::SID sid) {
 437   return is_short64(bt, sid) || is_short128(bt, sid) || is_short256(bt, sid) || is_short512(bt, sid);
 438 }
 439 
 440 #define __ basic_type(), as_klass()->name()->sid()
 441 
 442 bool ciType::is_vectormask() {
 443   return basic_type() == T_OBJECT &&
 444       (is_float64mask(__) || is_float128mask(__) || is_float256mask(__) || is_float512mask(__) ||
 445        is_double64mask(__) || is_double128mask(__) || is_double256mask(__) || is_double512mask(__) ||
 446        is_int64mask(__) || is_int128mask(__) || is_int256mask(__) || is_int512mask(__) ||
 447        is_long64mask(__) || is_long128mask(__) || is_long256mask(__) || is_long512mask(__) ||
 448        is_byte64mask(__) || is_byte128mask(__) || is_byte256mask(__) || is_byte512mask(__) ||
 449        is_short64mask(__) || is_short128mask(__) || is_short256mask(__) || is_short512mask(__));










 450 }
 451 
 452 bool ciType::is_vectorapi_vector() {
 453   return is_float_vec_or_mask(__) ||
 454       is_double_vec_or_mask(__) ||
 455       is_int_vec_or_mask(__) ||
 456       is_long_vec_or_mask(__) ||
 457       is_byte_vec_or_mask(__) ||
 458       is_short_vec_or_mask(__);
 459 }
 460 
 461 int ciType::vectorapi_vector_size() {
 462   if ( is_double64(__) || is_long64(__)) return 1;
 463   if ( is_int64(__) || is_float64(__) || is_long128(__) || is_double128(__) ) return 2;
 464   if ( is_short64(__) || is_int128(__) || is_float128(__) || is_long256(__) || is_double256(__) ) return 4;
 465   if ( is_byte64(__) || is_short128(__) || is_int256(__) || is_float256(__) || is_long512(__) || is_double512(__) ) return 8;
 466   if ( is_byte128(__) || is_short256(__) || is_int512(__) || is_float512(__) ) return 16;
 467   if ( is_byte256(__) || is_short512(__) ) return 32;
 468   if ( is_byte512(__) ) return 64;
 469   return -1;
 470 }
 471 
 472 BasicType ciType::vectorapi_vector_bt() {
 473   if ( is_float_vec_or_mask(__) ) return T_FLOAT;
 474   if ( is_double_vec_or_mask(__) ) return T_DOUBLE;
 475   if ( is_int_vec_or_mask(__) ) return T_INT;
 476   if ( is_long_vec_or_mask(__) ) return T_LONG;
 477   if ( is_byte_vec_or_mask(__) ) return T_BYTE;
 478   if ( is_short_vec_or_mask(__) ) return T_SHORT;
 479   return T_VOID;
 480 }
 481 
 482 #undef __
 483 
 484 // ciReturnAddress
 485 //
 486 // This class represents the type of a specific return address in the
 487 // bytecodes.
 488 
 489 // ------------------------------------------------------------------
 490 // ciReturnAddress::ciReturnAddress
 491 //
 492 ciReturnAddress::ciReturnAddress(int bci) : ciType(T_ADDRESS) {
 493   assert(0 <= bci, "bci cannot be negative");
 494   _bci = bci;
 495 }
 496 
 497 // ------------------------------------------------------------------
 498 // ciReturnAddress::print_impl
 499 //
 500 // Implementation of the print method.
 501 void ciReturnAddress::print_impl(outputStream* st) {
 502   st->print(" bci=%d", _bci);
 503 }
 504 
 505 // ------------------------------------------------------------------
 506 // ciReturnAddress::make
 507 ciReturnAddress* ciReturnAddress::make(int bci) {
 508   GUARDED_VM_ENTRY(return CURRENT_ENV->get_return_address(bci);)
 509 }
--- EOF ---