7071709: JSR 292: switchpoint invalidation should be pushed not pulled

Reviewed-by: never
This commit is contained in:
Christian Thalinger 2011-09-02 04:28:59 -07:00
parent db44acbeb4
commit 1038fed51d
2 changed files with 37 additions and 7 deletions

View file

@ -147,19 +147,21 @@ void Parse::do_field_access(bool is_get, bool is_field) {
void Parse::do_get_xxx(Node* obj, ciField* field, bool is_field) {
// Does this field have a constant value? If so, just push the value.
if (field->is_constant()) {
// final field
if (field->is_static()) {
// final static field
if (push_constant(field->constant_value()))
return;
}
else {
// final non-static field of a trusted class (classes in
// java.lang.invoke and sun.invoke packages and subpackages).
// final non-static field
// Treat final non-static fields of trusted classes (classes in
// java.lang.invoke and sun.invoke packages and subpackages) as
// compile time constants.
if (obj->is_Con()) {
const TypeOopPtr* oop_ptr = obj->bottom_type()->isa_oopptr();
ciObject* constant_oop = oop_ptr->const_oop();
ciConstant constant = field->constant_value_of(constant_oop);
if (push_constant(constant, true))
return;
}