< prev index next >
src/hotspot/share/ci/ciSignature.cpp
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 66,75 ****
--- 66,78 ----
CLEAR_PENDING_EXCEPTION;
} else {
ciSymbol* klass_name = env->get_symbol(name);
type = env->get_klass_by_name_impl(_accessing_klass, cpool, klass_name, false);
}
+ if (type->is_valuetype() && ss.type() == T_VALUETYPE) {
+ type = env->make_never_null_wrapper(type);
+ }
}
_types->append(type);
if (ss.at_return_type()) {
// Done processing the return type; do not add it into the count.
break;
*** 89,123 ****
_size( method_type->ptype_slot_count()),
_count(method_type->ptype_count())
{
ASSERT_IN_VM;
EXCEPTION_CONTEXT;
! Arena* arena = CURRENT_ENV->arena();
_types = new (arena) GrowableArray<ciType*>(arena, _count + 1, 0, NULL);
for (int i = 0; i < _count; i++) {
! _types->append(method_type->ptype_at(i));
}
! _types->append(method_type->rtype());
}
// ------------------------------------------------------------------
// ciSignature::return_type
//
// What is the return type of this signature?
ciType* ciSignature::return_type() const {
! return _types->at(_count);
}
// ------------------------------------------------------------------
// ciSignature::type_at
//
// What is the type of the index'th element of this
// signature?
ciType* ciSignature::type_at(int index) const {
assert(index < _count, "out of bounds");
// The first _klasses element holds the return klass.
! return _types->at(index);
}
// ------------------------------------------------------------------
// ciSignature::equals
//
--- 92,154 ----
_size( method_type->ptype_slot_count()),
_count(method_type->ptype_count())
{
ASSERT_IN_VM;
EXCEPTION_CONTEXT;
! ciEnv* env = CURRENT_ENV;
! Arena* arena = env->arena();
_types = new (arena) GrowableArray<ciType*>(arena, _count + 1, 0, NULL);
+ ciType* type = NULL;
+ bool never_null = false;
for (int i = 0; i < _count; i++) {
! type = method_type->ptype_at(i, never_null);
! if (type->is_valuetype() && never_null) {
! type = env->make_never_null_wrapper(type);
! }
! _types->append(type);
! }
! type = method_type->rtype(never_null);
! if (type->is_valuetype() && never_null) {
! type = env->make_never_null_wrapper(type);
}
! _types->append(type);
}
// ------------------------------------------------------------------
// ciSignature::return_type
//
// What is the return type of this signature?
ciType* ciSignature::return_type() const {
! return _types->at(_count)->unwrap();
}
// ------------------------------------------------------------------
// ciSignature::type_at
//
// What is the type of the index'th element of this
// signature?
ciType* ciSignature::type_at(int index) const {
assert(index < _count, "out of bounds");
// The first _klasses element holds the return klass.
! return _types->at(index)->unwrap();
! }
!
! // ------------------------------------------------------------------
! // ciSignature::return_never_null
! //
! // True if we statically know that the return value is never null.
! bool ciSignature::returns_never_null() const {
! return _types->at(_count)->is_never_null();
! }
!
! // ------------------------------------------------------------------
! // ciSignature::never_null_at
! //
! // True if we statically know that the argument at 'index' is never null.
! bool ciSignature::is_never_null_at(int index) const {
! assert(index < _count, "out of bounds");
! return _types->at(index)->is_never_null();
}
// ------------------------------------------------------------------
// ciSignature::equals
//
< prev index next >