提交 704d4ce3 编写于 作者: M minqi

Merge

......@@ -2994,6 +2994,11 @@ Node* GraphKit::gen_checkcast(Node *obj, Node* superklass,
}
Node* cast_obj = NULL;
if (tk->klass_is_exact()) {
// The following optimization tries to statically cast the speculative type of the object
// (for example obtained during profiling) to the type of the superklass and then do a
// dynamic check that the type of the object is what we expect. To work correctly
// for checkcast and aastore the type of superklass should be exact.
const TypeOopPtr* obj_type = _gvn.type(obj)->is_oopptr();
// We may not have profiling here or it may not help us. If we have
// a speculative type use it to perform an exact cast.
......@@ -3012,6 +3017,7 @@ Node* GraphKit::gen_checkcast(Node *obj, Node* superklass,
phi->raise_bottom_type(_gvn.type(cast_obj)->meet_speculative(TypePtr::NULL_PTR));
}
}
}
if (cast_obj == NULL) {
// Load the object's klass
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册