2061 Node_List _tests; // Set of IfNodes & PCTableNodes
2062
2063 Final_Reshape_Counts() :
2064 _call_count(0), _float_count(0), _double_count(0),
2065 _java_call_count(0), _inner_loop_count(0),
2066 _visited( Thread::current()->resource_area() ) { }
2067
2068 void inc_call_count () { _call_count ++; }
2069 void inc_float_count () { _float_count ++; }
2070 void inc_double_count() { _double_count++; }
2071 void inc_java_call_count() { _java_call_count++; }
2072 void inc_inner_loop_count() { _inner_loop_count++; }
2073
2074 int get_call_count () const { return _call_count ; }
2075 int get_float_count () const { return _float_count ; }
2076 int get_double_count() const { return _double_count; }
2077 int get_java_call_count() const { return _java_call_count; }
2078 int get_inner_loop_count() const { return _inner_loop_count; }
2079 };
2080
2081 static bool oop_offset_is_sane(const TypeInstPtr* tp) {
2082 ciInstanceKlass *k = tp->klass()->as_instance_klass();
2083 // Make sure the offset goes inside the instance layout.
2084 return k->contains_field_offset(tp->offset());
2085 // Note that OffsetBot and OffsetTop are very negative.
2086 }
2087
2088 // Eliminate trivially redundant StoreCMs and accumulate their
2089 // precedence edges.
2090 static void eliminate_redundant_card_marks(Node* n) {
2091 assert(n->Opcode() == Op_StoreCM, "expected StoreCM");
2092 if (n->in(MemNode::Address)->outcnt() > 1) {
2093 // There are multiple users of the same address so it might be
2094 // possible to eliminate some of the StoreCMs
2095 Node* mem = n->in(MemNode::Memory);
2096 Node* adr = n->in(MemNode::Address);
2097 Node* val = n->in(MemNode::ValueIn);
2098 Node* prev = n;
2099 bool done = false;
2100 // Walk the chain of StoreCMs eliminating ones that match. As
2101 // long as it's a chain of single users then the optimization is
2102 // safe. Eliminating partially redundant StoreCMs would require
2103 // cloning copies down the other paths.
2104 while (mem->Opcode() == Op_StoreCM && mem->outcnt() == 1 && !done) {
2105 if (adr == mem->in(MemNode::Address) &&
2106 val == mem->in(MemNode::ValueIn)) {
|
2061 Node_List _tests; // Set of IfNodes & PCTableNodes
2062
2063 Final_Reshape_Counts() :
2064 _call_count(0), _float_count(0), _double_count(0),
2065 _java_call_count(0), _inner_loop_count(0),
2066 _visited( Thread::current()->resource_area() ) { }
2067
2068 void inc_call_count () { _call_count ++; }
2069 void inc_float_count () { _float_count ++; }
2070 void inc_double_count() { _double_count++; }
2071 void inc_java_call_count() { _java_call_count++; }
2072 void inc_inner_loop_count() { _inner_loop_count++; }
2073
2074 int get_call_count () const { return _call_count ; }
2075 int get_float_count () const { return _float_count ; }
2076 int get_double_count() const { return _double_count; }
2077 int get_java_call_count() const { return _java_call_count; }
2078 int get_inner_loop_count() const { return _inner_loop_count; }
2079 };
2080
2081 #ifdef ASSERT
2082 static bool oop_offset_is_sane(const TypeInstPtr* tp) {
2083 ciInstanceKlass *k = tp->klass()->as_instance_klass();
2084 // Make sure the offset goes inside the instance layout.
2085 return k->contains_field_offset(tp->offset());
2086 // Note that OffsetBot and OffsetTop are very negative.
2087 }
2088 #endif
2089
2090 // Eliminate trivially redundant StoreCMs and accumulate their
2091 // precedence edges.
2092 static void eliminate_redundant_card_marks(Node* n) {
2093 assert(n->Opcode() == Op_StoreCM, "expected StoreCM");
2094 if (n->in(MemNode::Address)->outcnt() > 1) {
2095 // There are multiple users of the same address so it might be
2096 // possible to eliminate some of the StoreCMs
2097 Node* mem = n->in(MemNode::Memory);
2098 Node* adr = n->in(MemNode::Address);
2099 Node* val = n->in(MemNode::ValueIn);
2100 Node* prev = n;
2101 bool done = false;
2102 // Walk the chain of StoreCMs eliminating ones that match. As
2103 // long as it's a chain of single users then the optimization is
2104 // safe. Eliminating partially redundant StoreCMs would require
2105 // cloning copies down the other paths.
2106 while (mem->Opcode() == Op_StoreCM && mem->outcnt() == 1 && !done) {
2107 if (adr == mem->in(MemNode::Address) &&
2108 val == mem->in(MemNode::ValueIn)) {
|