Mercurial > hg > graal-jvmci-8
comparison src/share/vm/opto/type.cpp @ 1137:97125851f396
6829187: compiler optimizations required for JSR 292
Summary: C2 implementation for invokedynamic support.
Reviewed-by: kvn, never
author | twisti |
---|---|
date | Tue, 05 Jan 2010 13:05:58 +0100 |
parents | 03b336640699 |
children | 2432acbee618 09ac706c2623 |
comparison
equal
deleted
inserted
replaced
1136:4b84186a8248 | 1137:97125851f396 |
---|---|
2429 } | 2429 } |
2430 | 2430 |
2431 //------------------------------make_from_constant----------------------------- | 2431 //------------------------------make_from_constant----------------------------- |
2432 // Make a java pointer from an oop constant | 2432 // Make a java pointer from an oop constant |
2433 const TypeOopPtr* TypeOopPtr::make_from_constant(ciObject* o, bool require_constant) { | 2433 const TypeOopPtr* TypeOopPtr::make_from_constant(ciObject* o, bool require_constant) { |
2434 if (o->is_method_data() || o->is_method()) { | 2434 if (o->is_method_data() || o->is_method() || o->is_cpcache()) { |
2435 // Treat much like a typeArray of bytes, like below, but fake the type... | 2435 // Treat much like a typeArray of bytes, like below, but fake the type... |
2436 const Type* etype = (Type*)get_const_basic_type(T_BYTE); | 2436 const Type* etype = (Type*)get_const_basic_type(T_BYTE); |
2437 const TypeAry* arr0 = TypeAry::make(etype, TypeInt::POS); | 2437 const TypeAry* arr0 = TypeAry::make(etype, TypeInt::POS); |
2438 ciKlass *klass = ciTypeArrayKlass::make((BasicType) T_BYTE); | 2438 ciKlass *klass = ciTypeArrayKlass::make((BasicType) T_BYTE); |
2439 assert(o->can_be_constant(), "method data oops should be tenured"); | 2439 assert(o->can_be_constant(), "method data oops should be tenured"); |
3964 const TypeFunc *TypeFunc::make(ciMethod* method) { | 3964 const TypeFunc *TypeFunc::make(ciMethod* method) { |
3965 Compile* C = Compile::current(); | 3965 Compile* C = Compile::current(); |
3966 const TypeFunc* tf = C->last_tf(method); // check cache | 3966 const TypeFunc* tf = C->last_tf(method); // check cache |
3967 if (tf != NULL) return tf; // The hit rate here is almost 50%. | 3967 if (tf != NULL) return tf; // The hit rate here is almost 50%. |
3968 const TypeTuple *domain; | 3968 const TypeTuple *domain; |
3969 if (method->flags().is_static()) { | 3969 if (method->is_static()) { |
3970 domain = TypeTuple::make_domain(NULL, method->signature()); | 3970 domain = TypeTuple::make_domain(NULL, method->signature()); |
3971 } else { | 3971 } else { |
3972 domain = TypeTuple::make_domain(method->holder(), method->signature()); | 3972 domain = TypeTuple::make_domain(method->holder(), method->signature()); |
3973 } | 3973 } |
3974 const TypeTuple *range = TypeTuple::make_range(method->signature()); | 3974 const TypeTuple *range = TypeTuple::make_range(method->signature()); |