src/share/vm/opto/compile.cpp

changeset 6507
752ba2e5f6d0
parent 6503
a9becfeecd1b
parent 6314
1419657ed891
child 6518
62c54fcc0a35
     1.1 --- a/src/share/vm/opto/compile.cpp	Wed Feb 19 20:12:43 2014 -0800
     1.2 +++ b/src/share/vm/opto/compile.cpp	Tue Feb 25 15:11:18 2014 -0800
     1.3 @@ -705,10 +705,7 @@
     1.4  
     1.5    print_compile_messages();
     1.6  
     1.7 -  if (UseOldInlining || PrintCompilation NOT_PRODUCT( || PrintOpto) )
     1.8 -    _ilt = InlineTree::build_inline_tree_root();
     1.9 -  else
    1.10 -    _ilt = NULL;
    1.11 +  _ilt = InlineTree::build_inline_tree_root();
    1.12  
    1.13    // Even if NO memory addresses are used, MergeMem nodes must have at least 1 slice
    1.14    assert(num_alias_types() >= AliasIdxRaw, "");
    1.15 @@ -3948,16 +3945,18 @@
    1.16      // which may optimize it out.
    1.17      for (uint next = 0; next < worklist.size(); ++next) {
    1.18        Node *n  = worklist.at(next);
    1.19 -      if (n->is_Type() && n->as_Type()->type()->isa_oopptr() != NULL &&
    1.20 -          n->as_Type()->type()->is_oopptr()->speculative() != NULL) {
    1.21 +      if (n->is_Type()) {
    1.22          TypeNode* tn = n->as_Type();
    1.23 -        const TypeOopPtr* t = tn->type()->is_oopptr();
    1.24 -        bool in_hash = igvn.hash_delete(n);
    1.25 -        assert(in_hash, "node should be in igvn hash table");
    1.26 -        tn->set_type(t->remove_speculative());
    1.27 -        igvn.hash_insert(n);
    1.28 -        igvn._worklist.push(n); // give it a chance to go away
    1.29 -        modified++;
    1.30 +        const Type* t = tn->type();
    1.31 +        const Type* t_no_spec = t->remove_speculative();
    1.32 +        if (t_no_spec != t) {
    1.33 +          bool in_hash = igvn.hash_delete(n);
    1.34 +          assert(in_hash, "node should be in igvn hash table");
    1.35 +          tn->set_type(t_no_spec);
    1.36 +          igvn.hash_insert(n);
    1.37 +          igvn._worklist.push(n); // give it a chance to go away
    1.38 +          modified++;
    1.39 +        }
    1.40        }
    1.41        uint max = n->len();
    1.42        for( uint i = 0; i < max; ++i ) {
    1.43 @@ -3971,6 +3970,27 @@
    1.44      if (modified > 0) {
    1.45        igvn.optimize();
    1.46      }
    1.47 +#ifdef ASSERT
    1.48 +    // Verify that after the IGVN is over no speculative type has resurfaced
    1.49 +    worklist.clear();
    1.50 +    worklist.push(root());
    1.51 +    for (uint next = 0; next < worklist.size(); ++next) {
    1.52 +      Node *n  = worklist.at(next);
    1.53 +      const Type* t = igvn.type(n);
    1.54 +      assert(t == t->remove_speculative(), "no more speculative types");
    1.55 +      if (n->is_Type()) {
    1.56 +        t = n->as_Type()->type();
    1.57 +        assert(t == t->remove_speculative(), "no more speculative types");
    1.58 +      }
    1.59 +      uint max = n->len();
    1.60 +      for( uint i = 0; i < max; ++i ) {
    1.61 +        Node *m = n->in(i);
    1.62 +        if (not_a_node(m))  continue;
    1.63 +        worklist.push(m);
    1.64 +      }
    1.65 +    }
    1.66 +    igvn.check_no_speculative_types();
    1.67 +#endif
    1.68    }
    1.69  }
    1.70  

mercurial