Mercurial > hg > graal-compiler
comparison src/share/vm/opto/stringopts.cpp @ 1817:c40600e85311
6986028: assert(_base == Int) failed: Not an Int in CmpINode::sub
Reviewed-by: kvn, twisti
author | never |
---|---|
date | Wed, 22 Sep 2010 23:51:03 -0700 |
parents | 3e8fbc61cee8 |
children | f95d63e2154a |
comparison
equal
deleted
inserted
replaced
1816:87b64980e2f1 | 1817:c40600e85311 |
---|---|
73 sc->end()->extract_projections(&endprojs, false); | 73 sc->end()->extract_projections(&endprojs, false); |
74 if (endprojs.resproj != NULL) { | 74 if (endprojs.resproj != NULL) { |
75 for (SimpleDUIterator i(endprojs.resproj); i.has_next(); i.next()) { | 75 for (SimpleDUIterator i(endprojs.resproj); i.has_next(); i.next()) { |
76 CallStaticJavaNode *use = i.get()->isa_CallStaticJava(); | 76 CallStaticJavaNode *use = i.get()->isa_CallStaticJava(); |
77 if (use != NULL && use->method() != NULL && | 77 if (use != NULL && use->method() != NULL && |
78 use->method()->holder() == C->env()->String_klass() && | 78 use->method()->intrinsic_id() == vmIntrinsics::_String_String && |
79 use->method()->name() == ciSymbol::object_initializer_name() && | |
80 use->in(TypeFunc::Parms + 1) == endprojs.resproj) { | 79 use->in(TypeFunc::Parms + 1) == endprojs.resproj) { |
81 // Found useless new String(sb.toString()) so reuse the newly allocated String | 80 // Found useless new String(sb.toString()) so reuse the newly allocated String |
82 // when creating the result instead of allocating a new one. | 81 // when creating the result instead of allocating a new one. |
83 sc->set_string_alloc(use->in(TypeFunc::Parms)); | 82 sc->set_string_alloc(use->in(TypeFunc::Parms)); |
84 sc->set_end(use); | 83 sc->set_end(use); |
392 break; | 391 break; |
393 } | 392 } |
394 Node* constructor = NULL; | 393 Node* constructor = NULL; |
395 for (SimpleDUIterator i(result); i.has_next(); i.next()) { | 394 for (SimpleDUIterator i(result); i.has_next(); i.next()) { |
396 CallStaticJavaNode *use = i.get()->isa_CallStaticJava(); | 395 CallStaticJavaNode *use = i.get()->isa_CallStaticJava(); |
397 if (use != NULL && use->method() != NULL && | 396 if (use != NULL && |
397 use->method() != NULL && | |
398 !use->method()->is_static() && | |
398 use->method()->name() == ciSymbol::object_initializer_name() && | 399 use->method()->name() == ciSymbol::object_initializer_name() && |
399 use->method()->holder() == m->holder()) { | 400 use->method()->holder() == m->holder()) { |
400 // Matched the constructor. | 401 // Matched the constructor. |
401 ciSymbol* sig = use->method()->signature()->as_symbol(); | 402 ciSymbol* sig = use->method()->signature()->as_symbol(); |
402 if (sig == ciSymbol::void_method_signature() || | 403 if (sig == ciSymbol::void_method_signature() || |
442 } else { | 443 } else { |
443 return NULL; | 444 return NULL; |
444 } | 445 } |
445 } else if (cnode->method() == NULL) { | 446 } else if (cnode->method() == NULL) { |
446 break; | 447 break; |
447 } else if (cnode->method()->holder() == m->holder() && | 448 } else if (!cnode->method()->is_static() && |
449 cnode->method()->holder() == m->holder() && | |
448 cnode->method()->name() == ciSymbol::append_name() && | 450 cnode->method()->name() == ciSymbol::append_name() && |
449 (cnode->method()->signature()->as_symbol() == string_sig || | 451 (cnode->method()->signature()->as_symbol() == string_sig || |
450 cnode->method()->signature()->as_symbol() == char_sig || | 452 cnode->method()->signature()->as_symbol() == char_sig || |
451 cnode->method()->signature()->as_symbol() == int_sig)) { | 453 cnode->method()->signature()->as_symbol() == int_sig)) { |
452 sc->add_control(cnode); | 454 sc->add_control(cnode); |
457 sc->push_char(arg); | 459 sc->push_char(arg); |
458 } else { | 460 } else { |
459 if (arg->is_Proj() && arg->in(0)->is_CallStaticJava()) { | 461 if (arg->is_Proj() && arg->in(0)->is_CallStaticJava()) { |
460 CallStaticJavaNode* csj = arg->in(0)->as_CallStaticJava(); | 462 CallStaticJavaNode* csj = arg->in(0)->as_CallStaticJava(); |
461 if (csj->method() != NULL && | 463 if (csj->method() != NULL && |
462 csj->method()->holder() == C->env()->Integer_klass() && | 464 csj->method()->intrinsic_id() == vmIntrinsics::_Integer_toString) { |
463 csj->method()->name() == ciSymbol::toString_name()) { | |
464 sc->add_control(csj); | 465 sc->add_control(csj); |
465 sc->push_int(csj->in(TypeFunc::Parms)); | 466 sc->push_int(csj->in(TypeFunc::Parms)); |
466 continue; | 467 continue; |
467 } | 468 } |
468 } | 469 } |
535 for (int i = 0; i < sc->num_arguments(); i++) { | 536 for (int i = 0; i < sc->num_arguments(); i++) { |
536 Node* arg = sc->argument(i); | 537 Node* arg = sc->argument(i); |
537 if (arg->is_Proj() && arg->in(0)->is_CallStaticJava()) { | 538 if (arg->is_Proj() && arg->in(0)->is_CallStaticJava()) { |
538 CallStaticJavaNode* csj = arg->in(0)->as_CallStaticJava(); | 539 CallStaticJavaNode* csj = arg->in(0)->as_CallStaticJava(); |
539 if (csj->method() != NULL && | 540 if (csj->method() != NULL && |
540 (csj->method()->holder() == C->env()->StringBuffer_klass() || | 541 (csj->method()->intrinsic_id() == vmIntrinsics::_StringBuilder_toString || |
541 csj->method()->holder() == C->env()->StringBuilder_klass()) && | 542 csj->method()->intrinsic_id() == vmIntrinsics::_StringBuffer_toString)) { |
542 csj->method()->name() == ciSymbol::toString_name()) { | |
543 for (int o = 0; o < concats.length(); o++) { | 543 for (int o = 0; o < concats.length(); o++) { |
544 if (c == o) continue; | 544 if (c == o) continue; |
545 StringConcat* other = concats.at(o); | 545 StringConcat* other = concats.at(o); |
546 if (other->end() == csj) { | 546 if (other->end() == csj) { |
547 #ifndef PRODUCT | 547 #ifndef PRODUCT |