Mercurial > hg > graal-jvmci-8
comparison src/share/vm/opto/compile.cpp @ 235:9c2ecc2ffb12 jdk7-b31
Merge
author | trims |
---|---|
date | Fri, 11 Jul 2008 01:14:44 -0700 |
parents | d1605aabd0a1 1dd146f17531 |
children | 4a4c365f777d |
comparison
equal
deleted
inserted
replaced
197:de141433919f | 235:9c2ecc2ffb12 |
---|---|
311 Type::Initialize(compile); | 311 Type::Initialize(compile); |
312 _compile->set_scratch_buffer_blob(NULL); | 312 _compile->set_scratch_buffer_blob(NULL); |
313 _compile->begin_method(); | 313 _compile->begin_method(); |
314 } | 314 } |
315 CompileWrapper::~CompileWrapper() { | 315 CompileWrapper::~CompileWrapper() { |
316 if (_compile->failing()) { | |
317 _compile->print_method("Failed"); | |
318 } | |
319 _compile->end_method(); | 316 _compile->end_method(); |
320 if (_compile->scratch_buffer_blob() != NULL) | 317 if (_compile->scratch_buffer_blob() != NULL) |
321 BufferBlob::free(_compile->scratch_buffer_blob()); | 318 BufferBlob::free(_compile->scratch_buffer_blob()); |
322 _compile->env()->set_compiler_data(NULL); | 319 _compile->env()->set_compiler_data(NULL); |
323 } | 320 } |
601 } | 598 } |
602 // Now optimize | 599 // Now optimize |
603 Optimize(); | 600 Optimize(); |
604 if (failing()) return; | 601 if (failing()) return; |
605 NOT_PRODUCT( verify_graph_edges(); ) | 602 NOT_PRODUCT( verify_graph_edges(); ) |
603 | |
604 print_method("Before Matching"); | |
606 | 605 |
607 #ifndef PRODUCT | 606 #ifndef PRODUCT |
608 if (PrintIdeal) { | 607 if (PrintIdeal) { |
609 ttyLocker ttyl; // keep the following output all in one block | 608 ttyLocker ttyl; // keep the following output all in one block |
610 // This output goes directly to the tty, not the compiler log. | 609 // This output goes directly to the tty, not the compiler log. |
1068 if( to && _AliasLevel >= 2 && to != TypeOopPtr::BOTTOM ) { | 1067 if( to && _AliasLevel >= 2 && to != TypeOopPtr::BOTTOM ) { |
1069 if( ptr == TypePtr::Constant ) { | 1068 if( ptr == TypePtr::Constant ) { |
1070 // No constant oop pointers (such as Strings); they alias with | 1069 // No constant oop pointers (such as Strings); they alias with |
1071 // unknown strings. | 1070 // unknown strings. |
1072 tj = to = TypeInstPtr::make(TypePtr::BotPTR,to->klass(),false,0,offset); | 1071 tj = to = TypeInstPtr::make(TypePtr::BotPTR,to->klass(),false,0,offset); |
1073 } else if( to->is_instance_field() ) { | 1072 } else if( to->is_known_instance_field() ) { |
1074 tj = to; // Keep NotNull and klass_is_exact for instance type | 1073 tj = to; // Keep NotNull and klass_is_exact for instance type |
1075 } else if( ptr == TypePtr::NotNull || to->klass_is_exact() ) { | 1074 } else if( ptr == TypePtr::NotNull || to->klass_is_exact() ) { |
1076 // During the 2nd round of IterGVN, NotNull castings are removed. | 1075 // During the 2nd round of IterGVN, NotNull castings are removed. |
1077 // Make sure the Bottom and NotNull variants alias the same. | 1076 // Make sure the Bottom and NotNull variants alias the same. |
1078 // Also, make sure exact and non-exact variants alias the same. | 1077 // Also, make sure exact and non-exact variants alias the same. |
1189 _index = i; | 1188 _index = i; |
1190 _adr_type = at; | 1189 _adr_type = at; |
1191 _field = NULL; | 1190 _field = NULL; |
1192 _is_rewritable = true; // default | 1191 _is_rewritable = true; // default |
1193 const TypeOopPtr *atoop = (at != NULL) ? at->isa_oopptr() : NULL; | 1192 const TypeOopPtr *atoop = (at != NULL) ? at->isa_oopptr() : NULL; |
1194 if (atoop != NULL && atoop->is_instance()) { | 1193 if (atoop != NULL && atoop->is_known_instance()) { |
1195 const TypeOopPtr *gt = atoop->cast_to_instance(TypeOopPtr::UNKNOWN_INSTANCE); | 1194 const TypeOopPtr *gt = atoop->cast_to_instance_id(TypeOopPtr::InstanceBot); |
1196 _general_index = Compile::current()->get_alias_index(gt); | 1195 _general_index = Compile::current()->get_alias_index(gt); |
1197 } else { | 1196 } else { |
1198 _general_index = 0; | 1197 _general_index = 0; |
1199 } | 1198 } |
1200 } | 1199 } |
1479 ResourceMark rm; | 1478 ResourceMark rm; |
1480 int loop_opts_cnt; | 1479 int loop_opts_cnt; |
1481 | 1480 |
1482 NOT_PRODUCT( verify_graph_edges(); ) | 1481 NOT_PRODUCT( verify_graph_edges(); ) |
1483 | 1482 |
1484 print_method("Start"); | 1483 print_method("After Parsing"); |
1485 | 1484 |
1486 { | 1485 { |
1487 // Iterative Global Value Numbering, including ideal transforms | 1486 // Iterative Global Value Numbering, including ideal transforms |
1488 // Initialize IterGVN with types and values from parse-time GVN | 1487 // Initialize IterGVN with types and values from parse-time GVN |
1489 PhaseIterGVN igvn(initial_gvn()); | 1488 PhaseIterGVN igvn(initial_gvn()); |
1686 TracePhase t2a("output", &_t_output, true); | 1685 TracePhase t2a("output", &_t_output, true); |
1687 NOT_PRODUCT( TraceTime t2b(NULL, &_t_codeGeneration, TimeCompiler, false); ) | 1686 NOT_PRODUCT( TraceTime t2b(NULL, &_t_codeGeneration, TimeCompiler, false); ) |
1688 Output(); | 1687 Output(); |
1689 } | 1688 } |
1690 | 1689 |
1691 print_method("End"); | 1690 print_method("Final Code"); |
1692 | 1691 |
1693 // He's dead, Jim. | 1692 // He's dead, Jim. |
1694 _cfg = (PhaseCFG*)0xdeadbeef; | 1693 _cfg = (PhaseCFG*)0xdeadbeef; |
1695 _regalloc = (PhaseChaitin*)0xdeadbeef; | 1694 _regalloc = (PhaseChaitin*)0xdeadbeef; |
1696 } | 1695 } |
2015 Node* r = C->root(); | 2014 Node* r = C->root(); |
2016 uint cnt = r->outcnt(); | 2015 uint cnt = r->outcnt(); |
2017 for (uint i = 0; i < cnt; i++) { | 2016 for (uint i = 0; i < cnt; i++) { |
2018 Node* m = r->raw_out(i); | 2017 Node* m = r->raw_out(i); |
2019 if (m!= NULL && m->Opcode() == Op_ConN && | 2018 if (m!= NULL && m->Opcode() == Op_ConN && |
2020 m->bottom_type()->is_narrowoop()->make_oopptr() == t) { | 2019 m->bottom_type()->make_ptr() == t) { |
2021 nn = m; | 2020 nn = m; |
2022 break; | 2021 break; |
2023 } | 2022 } |
2024 } | 2023 } |
2025 if (nn != NULL) { | 2024 if (nn != NULL) { |
2068 if (i >= in1->outcnt()) { | 2067 if (i >= in1->outcnt()) { |
2069 in2 = ConNode::make(C, TypeNarrowOop::NULL_PTR); | 2068 in2 = ConNode::make(C, TypeNarrowOop::NULL_PTR); |
2070 } | 2069 } |
2071 } | 2070 } |
2072 } else if (t->isa_oopptr()) { | 2071 } else if (t->isa_oopptr()) { |
2073 in2 = ConNode::make(C, t->is_oopptr()->make_narrowoop()); | 2072 in2 = ConNode::make(C, t->make_narrowoop()); |
2074 } | 2073 } |
2075 } | 2074 } |
2076 if( in2 != NULL ) { | 2075 if( in2 != NULL ) { |
2077 Node* cmpN = new (C, 3) CmpNNode(n->in(1)->in(1), in2); | 2076 Node* cmpN = new (C, 3) CmpNNode(n->in(1)->in(1), in2); |
2078 n->subsume_by( cmpN ); | 2077 n->subsume_by( cmpN ); |
2464 } | 2463 } |
2465 if (_failure_reason == NULL) { | 2464 if (_failure_reason == NULL) { |
2466 // Record the first failure reason. | 2465 // Record the first failure reason. |
2467 _failure_reason = reason; | 2466 _failure_reason = reason; |
2468 } | 2467 } |
2468 if (!C->failure_reason_is(C2Compiler::retry_no_subsuming_loads())) { | |
2469 C->print_method(_failure_reason); | |
2470 } | |
2469 _root = NULL; // flush the graph, too | 2471 _root = NULL; // flush the graph, too |
2470 } | 2472 } |
2471 | 2473 |
2472 Compile::TracePhase::TracePhase(const char* name, elapsedTimer* accumulator, bool dolog) | 2474 Compile::TracePhase::TracePhase(const char* name, elapsedTimer* accumulator, bool dolog) |
2473 : TraceTime(NULL, accumulator, false NOT_PRODUCT( || TimeCompiler ), false) | 2475 : TraceTime(NULL, accumulator, false NOT_PRODUCT( || TimeCompiler ), false) |