提交 7412ccfa 编写于 作者: K kvn

6679854: assert in escape.cpp:397

Summary: The assert misses the case CastX2P 'base' for an unsafe field reference
Reviewed-by: never, jrose
上级 0838dcdc
...@@ -51,21 +51,21 @@ void PointsToNode::remove_edge(uint targIdx, PointsToNode::EdgeType et) { ...@@ -51,21 +51,21 @@ void PointsToNode::remove_edge(uint targIdx, PointsToNode::EdgeType et) {
} }
#ifndef PRODUCT #ifndef PRODUCT
static char *node_type_names[] = { static const char *node_type_names[] = {
"UnknownType", "UnknownType",
"JavaObject", "JavaObject",
"LocalVar", "LocalVar",
"Field" "Field"
}; };
static char *esc_names[] = { static const char *esc_names[] = {
"UnknownEscape", "UnknownEscape",
"NoEscape", "NoEscape",
"ArgEscape", "ArgEscape",
"GlobalEscape" "GlobalEscape"
}; };
static char *edge_type_suffix[] = { static const char *edge_type_suffix[] = {
"?", // UnknownEdge "?", // UnknownEdge
"P", // PointsToEdge "P", // PointsToEdge
"D", // DeferredEdge "D", // DeferredEdge
...@@ -383,18 +383,25 @@ static Node* get_addp_base(Node *addp) { ...@@ -383,18 +383,25 @@ static Node* get_addp_base(Node *addp) {
// | | // | |
// AddP ( base == address ) // AddP ( base == address )
// //
// case #6. Constant Pool or ThreadLocal or Raw object's field reference: // case #6. Constant Pool, ThreadLocal, CastX2P or
// ConP # Object from Constant Pool. // Raw object's field reference:
// {ConP, ThreadLocal, CastX2P, raw Load}
// top | // top |
// \ | // \ |
// AddP ( base == top ) // AddP ( base == top )
// //
// case #7. Klass's field reference.
// LoadKlass
// | |
// AddP ( base == address )
//
Node *base = addp->in(AddPNode::Base)->uncast(); Node *base = addp->in(AddPNode::Base)->uncast();
if (base->is_top()) { // The AddP case #3 and #6. if (base->is_top()) { // The AddP case #3 and #6.
base = addp->in(AddPNode::Address)->uncast(); base = addp->in(AddPNode::Address)->uncast();
assert(base->Opcode() == Op_ConP || base->Opcode() == Op_ThreadLocal || assert(base->Opcode() == Op_ConP || base->Opcode() == Op_ThreadLocal ||
base->is_Mem() && base->bottom_type() == TypeRawPtr::NOTNULL || base->Opcode() == Op_CastX2P ||
base->is_Proj() && base->in(0)->is_Allocate(), "sanity"); (base->is_Mem() && base->bottom_type() == TypeRawPtr::NOTNULL) ||
(base->is_Proj() && base->in(0)->is_Allocate()), "sanity");
} }
return base; return base;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册