comparison src/share/vm/opto/escape.cpp @ 77:36cd3cc4d27b

6679854: assert in escape.cpp:397 Summary: The assert misses the case CastX2P 'base' for an unsafe field reference Reviewed-by: never, jrose
author kvn
date Thu, 27 Mar 2008 09:12:54 -0700
parents 99269dbf4ba8
children f96100ac3d12
comparison
equal deleted inserted replaced
76:d6fe2e4959d6 77:36cd3cc4d27b
49 49
50 _edges->remove(v); 50 _edges->remove(v);
51 } 51 }
52 52
53 #ifndef PRODUCT 53 #ifndef PRODUCT
54 static char *node_type_names[] = { 54 static const char *node_type_names[] = {
55 "UnknownType", 55 "UnknownType",
56 "JavaObject", 56 "JavaObject",
57 "LocalVar", 57 "LocalVar",
58 "Field" 58 "Field"
59 }; 59 };
60 60
61 static char *esc_names[] = { 61 static const char *esc_names[] = {
62 "UnknownEscape", 62 "UnknownEscape",
63 "NoEscape", 63 "NoEscape",
64 "ArgEscape", 64 "ArgEscape",
65 "GlobalEscape" 65 "GlobalEscape"
66 }; 66 };
67 67
68 static char *edge_type_suffix[] = { 68 static const char *edge_type_suffix[] = {
69 "?", // UnknownEdge 69 "?", // UnknownEdge
70 "P", // PointsToEdge 70 "P", // PointsToEdge
71 "D", // DeferredEdge 71 "D", // DeferredEdge
72 "F" // FieldEdge 72 "F" // FieldEdge
73 }; 73 };
381 // | 381 // |
382 // Proj #5 ( oop result ) 382 // Proj #5 ( oop result )
383 // | | 383 // | |
384 // AddP ( base == address ) 384 // AddP ( base == address )
385 // 385 //
386 // case #6. Constant Pool or ThreadLocal or Raw object's field reference: 386 // case #6. Constant Pool, ThreadLocal, CastX2P or
387 // ConP # Object from Constant Pool. 387 // Raw object's field reference:
388 // {ConP, ThreadLocal, CastX2P, raw Load}
388 // top | 389 // top |
389 // \ | 390 // \ |
390 // AddP ( base == top ) 391 // AddP ( base == top )
392 //
393 // case #7. Klass's field reference.
394 // LoadKlass
395 // | |
396 // AddP ( base == address )
391 // 397 //
392 Node *base = addp->in(AddPNode::Base)->uncast(); 398 Node *base = addp->in(AddPNode::Base)->uncast();
393 if (base->is_top()) { // The AddP case #3 and #6. 399 if (base->is_top()) { // The AddP case #3 and #6.
394 base = addp->in(AddPNode::Address)->uncast(); 400 base = addp->in(AddPNode::Address)->uncast();
395 assert(base->Opcode() == Op_ConP || base->Opcode() == Op_ThreadLocal || 401 assert(base->Opcode() == Op_ConP || base->Opcode() == Op_ThreadLocal ||
396 base->is_Mem() && base->bottom_type() == TypeRawPtr::NOTNULL || 402 base->Opcode() == Op_CastX2P ||
397 base->is_Proj() && base->in(0)->is_Allocate(), "sanity"); 403 (base->is_Mem() && base->bottom_type() == TypeRawPtr::NOTNULL) ||
404 (base->is_Proj() && base->in(0)->is_Allocate()), "sanity");
398 } 405 }
399 return base; 406 return base;
400 } 407 }
401 408
402 static Node* find_second_addp(Node* addp, Node* n) { 409 static Node* find_second_addp(Node* addp, Node* n) {