< prev index next >

src/hotspot/share/opto/type.cpp

Print this page


   1 /*
   2  * Copyright (c) 1997, 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  *


 587   fsc[0] = TypeInt::CC;
 588   fsc[1] = Type::MEMORY;
 589   TypeTuple::STORECONDITIONAL = TypeTuple::make(2, fsc);
 590 
 591   TypeInstPtr::NOTNULL = TypeInstPtr::make(TypePtr::NotNull, current->env()->Object_klass());
 592   TypeInstPtr::BOTTOM  = TypeInstPtr::make(TypePtr::BotPTR,  current->env()->Object_klass());
 593   TypeInstPtr::MIRROR  = TypeInstPtr::make(TypePtr::NotNull, current->env()->Class_klass());
 594   TypeInstPtr::MARK    = TypeInstPtr::make(TypePtr::BotPTR,  current->env()->Object_klass(),
 595                                            false, 0, Offset(oopDesc::mark_offset_in_bytes()));
 596   TypeInstPtr::KLASS   = TypeInstPtr::make(TypePtr::BotPTR,  current->env()->Object_klass(),
 597                                            false, 0, Offset(oopDesc::klass_offset_in_bytes()));
 598   TypeOopPtr::BOTTOM  = TypeOopPtr::make(TypePtr::BotPTR, Offset::bottom, TypeOopPtr::InstanceBot);
 599 
 600   TypeMetadataPtr::BOTTOM = TypeMetadataPtr::make(TypePtr::BotPTR, NULL, Offset::bottom);
 601 
 602   TypeNarrowOop::NULL_PTR = TypeNarrowOop::make( TypePtr::NULL_PTR );
 603   TypeNarrowOop::BOTTOM   = TypeNarrowOop::make( TypeInstPtr::BOTTOM );
 604 
 605   TypeNarrowKlass::NULL_PTR = TypeNarrowKlass::make( TypePtr::NULL_PTR );
 606 
 607   // TypeValueTypePtr::NOTNULL = (EnableValhalla || EnableMVT) ? TypeValueTypePtr::make(TypePtr::NotNull, current->env()->___Value_klass()->as_value_klass()) : NULL;
 608   TypeValueTypePtr::NOTNULL = NULL;
 609 
 610   mreg2type[Op_Node] = Type::BOTTOM;
 611   mreg2type[Op_Set ] = 0;
 612   mreg2type[Op_RegN] = TypeNarrowOop::BOTTOM;
 613   mreg2type[Op_RegI] = TypeInt::INT;
 614   mreg2type[Op_RegP] = TypePtr::BOTTOM;
 615   mreg2type[Op_RegF] = Type::FLOAT;
 616   mreg2type[Op_RegD] = Type::DOUBLE;
 617   mreg2type[Op_RegL] = TypeLong::LONG;
 618   mreg2type[Op_RegFlags] = TypeInt::CC;
 619 
 620   TypeAryPtr::RANGE   = TypeAryPtr::make(TypePtr::BotPTR, TypeAry::make(Type::BOTTOM,TypeInt::POS), NULL /* current->env()->Object_klass() */, false, Offset(arrayOopDesc::length_offset_in_bytes()));
 621 
 622   TypeAryPtr::NARROWOOPS = TypeAryPtr::make(TypePtr::BotPTR, TypeAry::make(TypeNarrowOop::BOTTOM, TypeInt::POS), NULL /*ciArrayKlass::make(o)*/,  false,  Offset::bottom);
 623 
 624 #ifdef _LP64
 625   if (UseCompressedOops) {
 626     assert(TypeAryPtr::NARROWOOPS->is_ptr_to_narrowoop(), "array of narrow oops must be ptr to narrow oop");
 627     TypeAryPtr::OOPS  = TypeAryPtr::NARROWOOPS;


 638   TypeAryPtr::LONGS   = TypeAryPtr::make(TypePtr::BotPTR, TypeAry::make(TypeLong::LONG     ,TypeInt::POS), ciTypeArrayKlass::make(T_LONG),   true,  Offset::bottom);
 639   TypeAryPtr::FLOATS  = TypeAryPtr::make(TypePtr::BotPTR, TypeAry::make(Type::FLOAT        ,TypeInt::POS), ciTypeArrayKlass::make(T_FLOAT),  true,  Offset::bottom);
 640   TypeAryPtr::DOUBLES = TypeAryPtr::make(TypePtr::BotPTR, TypeAry::make(Type::DOUBLE       ,TypeInt::POS), ciTypeArrayKlass::make(T_DOUBLE), true,  Offset::bottom);
 641 
 642   // Nobody should ask _array_body_type[T_NARROWOOP]. Use NULL as assert.
 643   TypeAryPtr::_array_body_type[T_NARROWOOP] = NULL;
 644   TypeAryPtr::_array_body_type[T_OBJECT]  = TypeAryPtr::OOPS;
 645   TypeAryPtr::_array_body_type[T_ARRAY]   = TypeAryPtr::OOPS; // arrays are stored in oop arrays
 646   TypeAryPtr::_array_body_type[T_VALUETYPEPTR] = NULL;
 647   TypeAryPtr::_array_body_type[T_BYTE]    = TypeAryPtr::BYTES;
 648   TypeAryPtr::_array_body_type[T_BOOLEAN] = TypeAryPtr::BYTES;  // boolean[] is a byte array
 649   TypeAryPtr::_array_body_type[T_SHORT]   = TypeAryPtr::SHORTS;
 650   TypeAryPtr::_array_body_type[T_CHAR]    = TypeAryPtr::CHARS;
 651   TypeAryPtr::_array_body_type[T_INT]     = TypeAryPtr::INTS;
 652   TypeAryPtr::_array_body_type[T_LONG]    = TypeAryPtr::LONGS;
 653   TypeAryPtr::_array_body_type[T_FLOAT]   = TypeAryPtr::FLOATS;
 654   TypeAryPtr::_array_body_type[T_DOUBLE]  = TypeAryPtr::DOUBLES;
 655 
 656   TypeKlassPtr::OBJECT = TypeKlassPtr::make(TypePtr::NotNull, current->env()->Object_klass(), Offset(0) );
 657   TypeKlassPtr::OBJECT_OR_NULL = TypeKlassPtr::make(TypePtr::BotPTR, current->env()->Object_klass(), Offset(0) );
 658   TypeKlassPtr::BOTTOM = (EnableValhalla || EnableMVT) ? TypeKlassPtr::make(TypePtr::BotPTR, NULL, Offset(0)) : TypeKlassPtr::OBJECT_OR_NULL;
 659   // TypeKlassPtr::VALUE = TypeKlassPtr::make(TypePtr::NotNull, current->env()->___Value_klass(), Offset(0));
 660   TypeKlassPtr::VALUE = NULL;
 661 
 662   const Type **fi2c = TypeTuple::fields(2);
 663   fi2c[TypeFunc::Parms+0] = TypeInstPtr::BOTTOM; // Method*
 664   fi2c[TypeFunc::Parms+1] = TypeRawPtr::BOTTOM; // argument pointer
 665   TypeTuple::START_I2C = TypeTuple::make(TypeFunc::Parms+2, fi2c);
 666 
 667   const Type **intpair = TypeTuple::fields(2);
 668   intpair[0] = TypeInt::INT;
 669   intpair[1] = TypeInt::INT;
 670   TypeTuple::INT_PAIR = TypeTuple::make(2, intpair);
 671 
 672   const Type **longpair = TypeTuple::fields(2);
 673   longpair[0] = TypeLong::LONG;
 674   longpair[1] = TypeLong::LONG;
 675   TypeTuple::LONG_PAIR = TypeTuple::make(2, longpair);
 676 
 677   const Type **intccpair = TypeTuple::fields(2);
 678   intccpair[0] = TypeInt::INT;


   1 /*
   2  * Copyright (c) 1997, 2018, 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  *


 587   fsc[0] = TypeInt::CC;
 588   fsc[1] = Type::MEMORY;
 589   TypeTuple::STORECONDITIONAL = TypeTuple::make(2, fsc);
 590 
 591   TypeInstPtr::NOTNULL = TypeInstPtr::make(TypePtr::NotNull, current->env()->Object_klass());
 592   TypeInstPtr::BOTTOM  = TypeInstPtr::make(TypePtr::BotPTR,  current->env()->Object_klass());
 593   TypeInstPtr::MIRROR  = TypeInstPtr::make(TypePtr::NotNull, current->env()->Class_klass());
 594   TypeInstPtr::MARK    = TypeInstPtr::make(TypePtr::BotPTR,  current->env()->Object_klass(),
 595                                            false, 0, Offset(oopDesc::mark_offset_in_bytes()));
 596   TypeInstPtr::KLASS   = TypeInstPtr::make(TypePtr::BotPTR,  current->env()->Object_klass(),
 597                                            false, 0, Offset(oopDesc::klass_offset_in_bytes()));
 598   TypeOopPtr::BOTTOM  = TypeOopPtr::make(TypePtr::BotPTR, Offset::bottom, TypeOopPtr::InstanceBot);
 599 
 600   TypeMetadataPtr::BOTTOM = TypeMetadataPtr::make(TypePtr::BotPTR, NULL, Offset::bottom);
 601 
 602   TypeNarrowOop::NULL_PTR = TypeNarrowOop::make( TypePtr::NULL_PTR );
 603   TypeNarrowOop::BOTTOM   = TypeNarrowOop::make( TypeInstPtr::BOTTOM );
 604 
 605   TypeNarrowKlass::NULL_PTR = TypeNarrowKlass::make( TypePtr::NULL_PTR );
 606 
 607   // TypeValueTypePtr::NOTNULL = EnableValhalla ? TypeValueTypePtr::make(TypePtr::NotNull, current->env()->___Value_klass()->as_value_klass()) : NULL;
 608   TypeValueTypePtr::NOTNULL = NULL;
 609 
 610   mreg2type[Op_Node] = Type::BOTTOM;
 611   mreg2type[Op_Set ] = 0;
 612   mreg2type[Op_RegN] = TypeNarrowOop::BOTTOM;
 613   mreg2type[Op_RegI] = TypeInt::INT;
 614   mreg2type[Op_RegP] = TypePtr::BOTTOM;
 615   mreg2type[Op_RegF] = Type::FLOAT;
 616   mreg2type[Op_RegD] = Type::DOUBLE;
 617   mreg2type[Op_RegL] = TypeLong::LONG;
 618   mreg2type[Op_RegFlags] = TypeInt::CC;
 619 
 620   TypeAryPtr::RANGE   = TypeAryPtr::make(TypePtr::BotPTR, TypeAry::make(Type::BOTTOM,TypeInt::POS), NULL /* current->env()->Object_klass() */, false, Offset(arrayOopDesc::length_offset_in_bytes()));
 621 
 622   TypeAryPtr::NARROWOOPS = TypeAryPtr::make(TypePtr::BotPTR, TypeAry::make(TypeNarrowOop::BOTTOM, TypeInt::POS), NULL /*ciArrayKlass::make(o)*/,  false,  Offset::bottom);
 623 
 624 #ifdef _LP64
 625   if (UseCompressedOops) {
 626     assert(TypeAryPtr::NARROWOOPS->is_ptr_to_narrowoop(), "array of narrow oops must be ptr to narrow oop");
 627     TypeAryPtr::OOPS  = TypeAryPtr::NARROWOOPS;


 638   TypeAryPtr::LONGS   = TypeAryPtr::make(TypePtr::BotPTR, TypeAry::make(TypeLong::LONG     ,TypeInt::POS), ciTypeArrayKlass::make(T_LONG),   true,  Offset::bottom);
 639   TypeAryPtr::FLOATS  = TypeAryPtr::make(TypePtr::BotPTR, TypeAry::make(Type::FLOAT        ,TypeInt::POS), ciTypeArrayKlass::make(T_FLOAT),  true,  Offset::bottom);
 640   TypeAryPtr::DOUBLES = TypeAryPtr::make(TypePtr::BotPTR, TypeAry::make(Type::DOUBLE       ,TypeInt::POS), ciTypeArrayKlass::make(T_DOUBLE), true,  Offset::bottom);
 641 
 642   // Nobody should ask _array_body_type[T_NARROWOOP]. Use NULL as assert.
 643   TypeAryPtr::_array_body_type[T_NARROWOOP] = NULL;
 644   TypeAryPtr::_array_body_type[T_OBJECT]  = TypeAryPtr::OOPS;
 645   TypeAryPtr::_array_body_type[T_ARRAY]   = TypeAryPtr::OOPS; // arrays are stored in oop arrays
 646   TypeAryPtr::_array_body_type[T_VALUETYPEPTR] = NULL;
 647   TypeAryPtr::_array_body_type[T_BYTE]    = TypeAryPtr::BYTES;
 648   TypeAryPtr::_array_body_type[T_BOOLEAN] = TypeAryPtr::BYTES;  // boolean[] is a byte array
 649   TypeAryPtr::_array_body_type[T_SHORT]   = TypeAryPtr::SHORTS;
 650   TypeAryPtr::_array_body_type[T_CHAR]    = TypeAryPtr::CHARS;
 651   TypeAryPtr::_array_body_type[T_INT]     = TypeAryPtr::INTS;
 652   TypeAryPtr::_array_body_type[T_LONG]    = TypeAryPtr::LONGS;
 653   TypeAryPtr::_array_body_type[T_FLOAT]   = TypeAryPtr::FLOATS;
 654   TypeAryPtr::_array_body_type[T_DOUBLE]  = TypeAryPtr::DOUBLES;
 655 
 656   TypeKlassPtr::OBJECT = TypeKlassPtr::make(TypePtr::NotNull, current->env()->Object_klass(), Offset(0) );
 657   TypeKlassPtr::OBJECT_OR_NULL = TypeKlassPtr::make(TypePtr::BotPTR, current->env()->Object_klass(), Offset(0) );
 658   TypeKlassPtr::BOTTOM = EnableValhalla ? TypeKlassPtr::make(TypePtr::BotPTR, NULL, Offset(0)) : TypeKlassPtr::OBJECT_OR_NULL;
 659   // TypeKlassPtr::VALUE = TypeKlassPtr::make(TypePtr::NotNull, current->env()->___Value_klass(), Offset(0));
 660   TypeKlassPtr::VALUE = NULL;
 661 
 662   const Type **fi2c = TypeTuple::fields(2);
 663   fi2c[TypeFunc::Parms+0] = TypeInstPtr::BOTTOM; // Method*
 664   fi2c[TypeFunc::Parms+1] = TypeRawPtr::BOTTOM; // argument pointer
 665   TypeTuple::START_I2C = TypeTuple::make(TypeFunc::Parms+2, fi2c);
 666 
 667   const Type **intpair = TypeTuple::fields(2);
 668   intpair[0] = TypeInt::INT;
 669   intpair[1] = TypeInt::INT;
 670   TypeTuple::INT_PAIR = TypeTuple::make(2, intpair);
 671 
 672   const Type **longpair = TypeTuple::fields(2);
 673   longpair[0] = TypeLong::LONG;
 674   longpair[1] = TypeLong::LONG;
 675   TypeTuple::LONG_PAIR = TypeTuple::make(2, longpair);
 676 
 677   const Type **intccpair = TypeTuple::fields(2);
 678   intccpair[0] = TypeInt::INT;


< prev index next >