< prev index next >

src/share/vm/opto/compile.cpp

Print this page




1953   assert(predicate_count()==0, "should be clean!");
1954 }
1955 
1956 void Compile::add_range_check_cast(Node* n) {
1957   assert(n->isa_CastII()->has_range_check(), "CastII should have range check dependency");
1958   assert(!_range_check_casts->contains(n), "duplicate entry in range check casts");
1959   _range_check_casts->append(n);
1960 }
1961 
1962 // Remove all range check dependent CastIINodes.
1963 void Compile::remove_range_check_casts(PhaseIterGVN &igvn) {
1964   for (int i = range_check_cast_count(); i > 0; i--) {
1965     Node* cast = range_check_cast_node(i-1);
1966     assert(cast->isa_CastII()->has_range_check(), "CastII should have range check dependency");
1967     igvn.replace_node(cast, cast->in(1));
1968   }
1969   assert(range_check_cast_count() == 0, "should be empty");
1970 }
1971 
1972 void Compile::add_value_type_ptr(ValueTypePtrNode* n) {

1973   assert(!_value_type_ptr_nodes->contains(n), "duplicate entry");
1974   _value_type_ptr_nodes->append(n);
1975 }
1976 
1977 void Compile::process_value_type_ptr_nodes(PhaseIterGVN &igvn) {
1978   for (int i = value_type_ptr_count(); i > 0; i--) {
1979     ValueTypePtrNode* vtptr = value_type_ptr(i-1);
1980     // once all inlining is over otherwise debug info can get
1981     // inconsistent
1982     vtptr->make_scalar_in_safepoints(igvn.C->root(), &igvn);
1983     igvn.replace_node(vtptr, vtptr->get_oop());
1984   }
1985   assert(value_type_ptr_count() == 0, "should be empty");

1986   igvn.optimize();
1987 }
1988 
1989 // StringOpts and late inlining of string methods
1990 void Compile::inline_string_calls(bool parse_time) {
1991   {
1992     // remove useless nodes to make the usage analysis simpler
1993     ResourceMark rm;
1994     PhaseRemoveUseless pru(initial_gvn(), for_igvn());
1995   }
1996 
1997   {
1998     ResourceMark rm;
1999     print_method(PHASE_BEFORE_STRINGOPTS, 3);
2000     PhaseStringOpts pso(initial_gvn(), for_igvn());
2001     print_method(PHASE_AFTER_STRINGOPTS, 3);
2002   }
2003 
2004   // now inline anything that we skipped the first time around
2005   if (!parse_time) {




1953   assert(predicate_count()==0, "should be clean!");
1954 }
1955 
1956 void Compile::add_range_check_cast(Node* n) {
1957   assert(n->isa_CastII()->has_range_check(), "CastII should have range check dependency");
1958   assert(!_range_check_casts->contains(n), "duplicate entry in range check casts");
1959   _range_check_casts->append(n);
1960 }
1961 
1962 // Remove all range check dependent CastIINodes.
1963 void Compile::remove_range_check_casts(PhaseIterGVN &igvn) {
1964   for (int i = range_check_cast_count(); i > 0; i--) {
1965     Node* cast = range_check_cast_node(i-1);
1966     assert(cast->isa_CastII()->has_range_check(), "CastII should have range check dependency");
1967     igvn.replace_node(cast, cast->in(1));
1968   }
1969   assert(range_check_cast_count() == 0, "should be empty");
1970 }
1971 
1972 void Compile::add_value_type_ptr(ValueTypePtrNode* n) {
1973   assert(can_add_value_type_ptr(), "too late");
1974   assert(!_value_type_ptr_nodes->contains(n), "duplicate entry");
1975   _value_type_ptr_nodes->append(n);
1976 }
1977 
1978 void Compile::process_value_type_ptr_nodes(PhaseIterGVN &igvn) {
1979   for (int i = value_type_ptr_count(); i > 0; i--) {
1980     ValueTypePtrNode* vtptr = value_type_ptr(i-1);
1981     // once all inlining is over otherwise debug info can get
1982     // inconsistent
1983     vtptr->make_scalar_in_safepoints(igvn.C->root(), &igvn);
1984     igvn.replace_node(vtptr, vtptr->get_oop());
1985   }
1986   assert(value_type_ptr_count() == 0, "should be empty");
1987   _value_type_ptr_nodes = NULL;
1988   igvn.optimize();
1989 }
1990 
1991 // StringOpts and late inlining of string methods
1992 void Compile::inline_string_calls(bool parse_time) {
1993   {
1994     // remove useless nodes to make the usage analysis simpler
1995     ResourceMark rm;
1996     PhaseRemoveUseless pru(initial_gvn(), for_igvn());
1997   }
1998 
1999   {
2000     ResourceMark rm;
2001     print_method(PHASE_BEFORE_STRINGOPTS, 3);
2002     PhaseStringOpts pso(initial_gvn(), for_igvn());
2003     print_method(PHASE_AFTER_STRINGOPTS, 3);
2004   }
2005 
2006   // now inline anything that we skipped the first time around
2007   if (!parse_time) {


< prev index next >