Mercurial > hg > graal-compiler
comparison src/share/vm/opto/compile.cpp @ 17799:752ba2e5f6d0
Merge
author | kvn |
---|---|
date | Tue, 25 Feb 2014 15:11:18 -0800 |
parents | a9becfeecd1b 1419657ed891 |
children | cd5d10655495 62c54fcc0a35 |
comparison
equal
deleted
inserted
replaced
17798:f040cf9fc9c0 | 17799:752ba2e5f6d0 |
---|---|
703 Init(::AliasLevel); | 703 Init(::AliasLevel); |
704 | 704 |
705 | 705 |
706 print_compile_messages(); | 706 print_compile_messages(); |
707 | 707 |
708 if (UseOldInlining || PrintCompilation NOT_PRODUCT( || PrintOpto) ) | 708 _ilt = InlineTree::build_inline_tree_root(); |
709 _ilt = InlineTree::build_inline_tree_root(); | |
710 else | |
711 _ilt = NULL; | |
712 | 709 |
713 // Even if NO memory addresses are used, MergeMem nodes must have at least 1 slice | 710 // Even if NO memory addresses are used, MergeMem nodes must have at least 1 slice |
714 assert(num_alias_types() >= AliasIdxRaw, ""); | 711 assert(num_alias_types() >= AliasIdxRaw, ""); |
715 | 712 |
716 #define MINIMUM_NODE_HASH 1023 | 713 #define MINIMUM_NODE_HASH 1023 |
3946 // Go over all type nodes that carry a speculative type, drop the | 3943 // Go over all type nodes that carry a speculative type, drop the |
3947 // speculative part of the type and enqueue the node for an igvn | 3944 // speculative part of the type and enqueue the node for an igvn |
3948 // which may optimize it out. | 3945 // which may optimize it out. |
3949 for (uint next = 0; next < worklist.size(); ++next) { | 3946 for (uint next = 0; next < worklist.size(); ++next) { |
3950 Node *n = worklist.at(next); | 3947 Node *n = worklist.at(next); |
3951 if (n->is_Type() && n->as_Type()->type()->isa_oopptr() != NULL && | 3948 if (n->is_Type()) { |
3952 n->as_Type()->type()->is_oopptr()->speculative() != NULL) { | |
3953 TypeNode* tn = n->as_Type(); | 3949 TypeNode* tn = n->as_Type(); |
3954 const TypeOopPtr* t = tn->type()->is_oopptr(); | 3950 const Type* t = tn->type(); |
3955 bool in_hash = igvn.hash_delete(n); | 3951 const Type* t_no_spec = t->remove_speculative(); |
3956 assert(in_hash, "node should be in igvn hash table"); | 3952 if (t_no_spec != t) { |
3957 tn->set_type(t->remove_speculative()); | 3953 bool in_hash = igvn.hash_delete(n); |
3958 igvn.hash_insert(n); | 3954 assert(in_hash, "node should be in igvn hash table"); |
3959 igvn._worklist.push(n); // give it a chance to go away | 3955 tn->set_type(t_no_spec); |
3960 modified++; | 3956 igvn.hash_insert(n); |
3957 igvn._worklist.push(n); // give it a chance to go away | |
3958 modified++; | |
3959 } | |
3961 } | 3960 } |
3962 uint max = n->len(); | 3961 uint max = n->len(); |
3963 for( uint i = 0; i < max; ++i ) { | 3962 for( uint i = 0; i < max; ++i ) { |
3964 Node *m = n->in(i); | 3963 Node *m = n->in(i); |
3965 if (not_a_node(m)) continue; | 3964 if (not_a_node(m)) continue; |
3969 // Drop the speculative part of all types in the igvn's type table | 3968 // Drop the speculative part of all types in the igvn's type table |
3970 igvn.remove_speculative_types(); | 3969 igvn.remove_speculative_types(); |
3971 if (modified > 0) { | 3970 if (modified > 0) { |
3972 igvn.optimize(); | 3971 igvn.optimize(); |
3973 } | 3972 } |
3973 #ifdef ASSERT | |
3974 // Verify that after the IGVN is over no speculative type has resurfaced | |
3975 worklist.clear(); | |
3976 worklist.push(root()); | |
3977 for (uint next = 0; next < worklist.size(); ++next) { | |
3978 Node *n = worklist.at(next); | |
3979 const Type* t = igvn.type(n); | |
3980 assert(t == t->remove_speculative(), "no more speculative types"); | |
3981 if (n->is_Type()) { | |
3982 t = n->as_Type()->type(); | |
3983 assert(t == t->remove_speculative(), "no more speculative types"); | |
3984 } | |
3985 uint max = n->len(); | |
3986 for( uint i = 0; i < max; ++i ) { | |
3987 Node *m = n->in(i); | |
3988 if (not_a_node(m)) continue; | |
3989 worklist.push(m); | |
3990 } | |
3991 } | |
3992 igvn.check_no_speculative_types(); | |
3993 #endif | |
3974 } | 3994 } |
3975 } | 3995 } |
3976 | 3996 |
3977 // Auxiliary method to support randomized stressing/fuzzing. | 3997 // Auxiliary method to support randomized stressing/fuzzing. |
3978 // | 3998 // |