comparison src/share/vm/opto/loopTransform.cpp @ 1785:5e4f03302987

6982533: Crash in ~StubRoutines::jbyte_fill with AggressiveOpts enabled Reviewed-by: kvn
author never
date Tue, 07 Sep 2010 11:31:27 -0700
parents d6f45b55c972
children c77e8f982901
comparison
equal deleted inserted replaced
1784:ac4f710073ed 1785:5e4f03302987
2415 break; 2415 break;
2416 } 2416 }
2417 Node* value = n->in(MemNode::ValueIn); 2417 Node* value = n->in(MemNode::ValueIn);
2418 if (!lpt->is_invariant(value)) { 2418 if (!lpt->is_invariant(value)) {
2419 msg = "variant store value"; 2419 msg = "variant store value";
2420 } else if (!_igvn.type(n->in(MemNode::Address))->isa_aryptr()) {
2421 msg = "not array address";
2420 } 2422 }
2421 store = n; 2423 store = n;
2422 store_value = value; 2424 store_value = value;
2423 } else if (n->is_If() && n != head->loopexit()) { 2425 } else if (n->is_If() && n != head->loopexit()) {
2424 msg = "extra control flow"; 2426 msg = "extra control flow";
2466 2468
2467 // Make sure the address expression can be handled. It should be 2469 // Make sure the address expression can be handled. It should be
2468 // head->phi * elsize + con. head->phi might have a ConvI2L. 2470 // head->phi * elsize + con. head->phi might have a ConvI2L.
2469 Node* elements[4]; 2471 Node* elements[4];
2470 Node* conv = NULL; 2472 Node* conv = NULL;
2473 bool found_index = false;
2471 int count = store->in(MemNode::Address)->as_AddP()->unpack_offsets(elements, ARRAY_SIZE(elements)); 2474 int count = store->in(MemNode::Address)->as_AddP()->unpack_offsets(elements, ARRAY_SIZE(elements));
2472 for (int e = 0; e < count; e++) { 2475 for (int e = 0; e < count; e++) {
2473 Node* n = elements[e]; 2476 Node* n = elements[e];
2474 if (n->is_Con() && con == NULL) { 2477 if (n->is_Con() && con == NULL) {
2475 con = n; 2478 con = n;
2482 } 2485 }
2483 #endif 2486 #endif
2484 if (value != head->phi()) { 2487 if (value != head->phi()) {
2485 msg = "unhandled shift in address"; 2488 msg = "unhandled shift in address";
2486 } else { 2489 } else {
2490 found_index = true;
2487 shift = n; 2491 shift = n;
2488 assert(type2aelembytes(store->as_Mem()->memory_type(), true) == 1 << shift->in(2)->get_int(), "scale should match"); 2492 assert(type2aelembytes(store->as_Mem()->memory_type(), true) == 1 << shift->in(2)->get_int(), "scale should match");
2489 } 2493 }
2490 } else if (n->Opcode() == Op_ConvI2L && conv == NULL) { 2494 } else if (n->Opcode() == Op_ConvI2L && conv == NULL) {
2491 if (n->in(1) == head->phi()) { 2495 if (n->in(1) == head->phi()) {
2496 found_index = true;
2492 conv = n; 2497 conv = n;
2493 } else { 2498 } else {
2494 msg = "unhandled input to ConvI2L"; 2499 msg = "unhandled input to ConvI2L";
2495 } 2500 }
2496 } else if (n == head->phi()) { 2501 } else if (n == head->phi()) {
2497 // no shift, check below for allowed cases 2502 // no shift, check below for allowed cases
2503 found_index = true;
2498 } else { 2504 } else {
2499 msg = "unhandled node in address"; 2505 msg = "unhandled node in address";
2500 msg_node = n; 2506 msg_node = n;
2501 } 2507 }
2502 } 2508 }
2503 2509
2504 if (count == -1) { 2510 if (count == -1) {
2505 msg = "malformed address expression"; 2511 msg = "malformed address expression";
2506 msg_node = store; 2512 msg_node = store;
2513 }
2514
2515 if (!found_index) {
2516 msg = "missing use of index";
2507 } 2517 }
2508 2518
2509 // byte sized items won't have a shift 2519 // byte sized items won't have a shift
2510 if (msg == NULL && shift == NULL && t != T_BYTE && t != T_BOOLEAN) { 2520 if (msg == NULL && shift == NULL && t != T_BYTE && t != T_BOOLEAN) {
2511 msg = "can't find shift"; 2521 msg = "can't find shift";