< prev index next >
src/share/vm/opto/type.hpp
Print this page
@@ -26,10 +26,11 @@
#define SHARE_VM_OPTO_TYPE_HPP
#include "ci/ciValueKlass.hpp"
#include "opto/adlcVMDeps.hpp"
#include "runtime/handles.hpp"
+#include "runtime/sharedRuntime.hpp"
// Portions of code courtesy of Clifford Click
// Optimization - Graph Style
@@ -689,11 +690,11 @@
assert(i < _cnt, "oob");
_fields[i] = t;
}
static const TypeTuple *make( uint cnt, const Type **fields );
- static const TypeTuple *make_range(ciSignature *sig);
+ static const TypeTuple *make_range(ciSignature *sig, bool ret_vt_fields = false);
static const TypeTuple *make_domain(ciInstanceKlass* recv, ciSignature *sig, bool vt_fields_as_args = false);
// Subroutine call type with space allocated for argument types
// Memory for Control, I_O, Memory, FramePtr, and ReturnAdr is allocated implicitly
static const Type **fields( uint arg_cnt );
@@ -1342,10 +1343,12 @@
virtual bool empty(void) const; // TRUE if type is vacuous
virtual const Type* xmeet_helper(const Type* t) const;
virtual const Type* xdual() const;
+ static const TypeValueTypePtr* NOTNULL;
+
#ifndef PRODUCT
virtual void dump2(Dict &d, uint depth, outputStream* st) const; // Specialized per-Type dumping
#endif
};
@@ -1400,12 +1403,10 @@
virtual bool eq( const Type *t ) const;
virtual int hash() const; // Type specific hashing
virtual bool singleton(void) const; // TRUE if type is a singleton
private:
- static const TypeKlassPtr* make_from_klass_common(ciKlass* klass, bool klass_change, bool try_for_exact);
-
ciKlass* _klass;
// Does the type exclude subclasses of the klass? (Inexact == polymorphic.)
bool _klass_is_exact;
@@ -1415,27 +1416,10 @@
ciKlass* klass() const { return _klass; }
bool klass_is_exact() const { return _klass_is_exact; }
bool is_loaded() const { return klass()->is_loaded(); }
- // Creates a type given a klass. Correctly handles multi-dimensional arrays
- // Respects UseUniqueSubclasses.
- // If the klass is final, the resulting type will be exact.
- static const TypeKlassPtr* make_from_klass(ciKlass* klass) {
- return make_from_klass_common(klass, true, false);
- }
- // Same as before, but will produce an exact type, even if
- // the klass is not final, as long as it has exactly one implementation.
- static const TypeKlassPtr* make_from_klass_unique(ciKlass* klass) {
- return make_from_klass_common(klass, true, true);
- }
- // Same as before, but does not respects UseUniqueSubclasses.
- // Use this only for creating array element types.
- static const TypeKlassPtr* make_from_klass_raw(ciKlass* klass) {
- return make_from_klass_common(klass, false, false);
- }
-
// Make a generic (unclassed) pointer to metadata.
static const TypeKlassPtr* make(PTR ptr, Offset offset);
// ptr to klass 'k'
static const TypeKlassPtr* make(ciKlass* k) { return make( TypePtr::Constant, k, Offset(0)); }
@@ -1587,11 +1571,12 @@
};
//------------------------------TypeFunc---------------------------------------
// Class of Array Types
class TypeFunc : public Type {
- TypeFunc(const TypeTuple *domain_sig, const TypeTuple *domain_cc, const TypeTuple *range) : Type(Function), _domain_sig(domain_sig), _domain_cc(domain_cc), _range(range) {}
+ TypeFunc(const TypeTuple *domain_sig, const TypeTuple *domain_cc, const TypeTuple *range_sig, const TypeTuple *range_cc)
+ : Type(Function), _domain_sig(domain_sig), _domain_cc(domain_cc), _range_sig(range_sig), _range_cc(range_cc) {}
virtual bool eq( const Type *t ) const;
virtual int hash() const; // Type specific hashing
virtual bool singleton(void) const; // TRUE if type is a singleton
virtual bool empty(void) const; // TRUE if type is vacuous
@@ -1601,11 +1586,15 @@
// based on the signature (with a value type argument as a single
// slot), one based on the actual calling convention (with a value
// type argument as a list of its fields).
const TypeTuple* const _domain_sig;
const TypeTuple* const _domain_cc;
- const TypeTuple* const _range; // Range of results
+ // Range of results. Similar to domains: a value type result can be
+ // returned in registers in which case range_cc lists all fields and
+ // is the actual calling convention.
+ const TypeTuple* const _range_sig;
+ const TypeTuple* const _range_cc;
public:
// Constants are shared among ADLC and VM
enum { Control = AdlcVMDeps::Control,
I_O = AdlcVMDeps::I_O,
@@ -1617,22 +1606,26 @@
// Accessors:
const TypeTuple* domain_sig() const { return _domain_sig; }
const TypeTuple* domain_cc() const { return _domain_cc; }
- const TypeTuple* range() const { return _range; }
+ const TypeTuple* range_sig() const { return _range_sig; }
+ const TypeTuple* range_cc() const { return _range_cc; }
static const TypeFunc *make(ciMethod* method);
static const TypeFunc *make(ciSignature signature, const Type* extra);
- static const TypeFunc *make(const TypeTuple* domain, const TypeTuple* domain_cc, const TypeTuple* range);
+ static const TypeFunc *make(const TypeTuple* domain_sig, const TypeTuple* domain_cc,
+ const TypeTuple* range_sig, const TypeTuple* range_cc);
static const TypeFunc *make(const TypeTuple* domain, const TypeTuple* range);
virtual const Type *xmeet( const Type *t ) const;
virtual const Type *xdual() const; // Compute dual right now.
BasicType return_type() const;
+ bool returns_value_type_as_fields() const { return range_sig() != range_cc(); }
+
#ifndef PRODUCT
virtual void dump2( Dict &d, uint depth, outputStream *st ) const; // Specialized per-Type dumping
#endif
// Convenience common pre-built types.
};
< prev index next >