< prev index next >

src/hotspot/share/ci/ciSignature.cpp

Print this page

 47 
 48   int size = 0;
 49   int count = 0;
 50   ResourceMark rm(THREAD);
 51   Symbol* sh = symbol->get_symbol();
 52   SignatureStream ss(sh);
 53   for (; ; ss.next()) {
 54     // Process one element of the signature
 55     ciType* type;
 56     if (!ss.is_reference()) {
 57       type = ciType::make(ss.type());
 58     } else {
 59       ciSymbol* klass_name = env->get_symbol(ss.as_symbol());
 60       type = env->get_klass_by_name_impl(_accessing_klass, cpool, klass_name, false);
 61     }
 62     if (ss.at_return_type()) {
 63       // don't include return type in size calculation
 64       _return_type = type;
 65       break;
 66     }



 67     _types.append(type);
 68     size += type->size();
 69   }
 70   _size = size;
 71 }
 72 














 73 // ------------------------------------------------------------------
 74 // ciSignature::equals
 75 //
 76 // Compare this signature to another one.  Signatures with different
 77 // accessing classes but with signature-types resolved to the same
 78 // types are defined to be equal.
 79 bool ciSignature::equals(ciSignature* that) {
 80   // Compare signature
 81   if (!this->as_symbol()->equals(that->as_symbol())) {
 82     return false;
 83   }
 84   // Compare all types of the arguments
 85   if (_types.length() != that->_types.length()) {
 86     return false;
 87   }
 88   for (int i = 0; i < _types.length(); i++) {
 89     if (this->type_at(i) != that->type_at(i)) {
 90       return false;
 91     }
 92   }

 47 
 48   int size = 0;
 49   int count = 0;
 50   ResourceMark rm(THREAD);
 51   Symbol* sh = symbol->get_symbol();
 52   SignatureStream ss(sh);
 53   for (; ; ss.next()) {
 54     // Process one element of the signature
 55     ciType* type;
 56     if (!ss.is_reference()) {
 57       type = ciType::make(ss.type());
 58     } else {
 59       ciSymbol* klass_name = env->get_symbol(ss.as_symbol());
 60       type = env->get_klass_by_name_impl(_accessing_klass, cpool, klass_name, false);
 61     }
 62     if (ss.at_return_type()) {
 63       // don't include return type in size calculation
 64       _return_type = type;
 65       break;
 66     }
 67     if (type->is_inlinetype() && ss.has_Q_descriptor()) {
 68       type = env->make_null_free_wrapper(type);
 69     }
 70     _types.append(type);
 71     size += type->size();
 72   }
 73   _size = size;
 74 }
 75 
 76 // ------------------------------------------------------------------
 77 // ciSignature::returns_null_free_inline_type
 78 bool ciSignature::returns_null_free_inline_type() const {
 79   GUARDED_VM_ENTRY(return get_symbol()->is_Q_method_signature();)
 80 }
 81 
 82 // ------------------------------------------------------------------
 83 // ciSignature::is_null_free_at
 84 //
 85 // True if we know that the argument at 'index' is null-free.
 86 bool ciSignature::is_null_free_at(int index) const {
 87   return _types.at(index)->is_null_free();
 88 }
 89 
 90 // ------------------------------------------------------------------
 91 // ciSignature::equals
 92 //
 93 // Compare this signature to another one.  Signatures with different
 94 // accessing classes but with signature-types resolved to the same
 95 // types are defined to be equal.
 96 bool ciSignature::equals(ciSignature* that) {
 97   // Compare signature
 98   if (!this->as_symbol()->equals(that->as_symbol())) {
 99     return false;
100   }
101   // Compare all types of the arguments
102   if (_types.length() != that->_types.length()) {
103     return false;
104   }
105   for (int i = 0; i < _types.length(); i++) {
106     if (this->type_at(i) != that->type_at(i)) {
107       return false;
108     }
109   }
< prev index next >