| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 } | 110 } |
| 111 // Improvements possible: | 111 // Improvements possible: |
| 112 // - eliminate redundant HCheckSmi, HCheckInstanceType instructions | 112 // - eliminate redundant HCheckSmi, HCheckInstanceType instructions |
| 113 // - track which values have been HCheckHeapObject'd | 113 // - track which values have been HCheckHeapObject'd |
| 114 } | 114 } |
| 115 | 115 |
| 116 return this; | 116 return this; |
| 117 } | 117 } |
| 118 | 118 |
| 119 // Global analysis: Copy state to successor block. | 119 // Global analysis: Copy state to successor block. |
| 120 HCheckTable* Copy(HBasicBlock* succ, Zone* zone) { | 120 HCheckTable* Copy(HBasicBlock* succ, HBasicBlock* from_block, Zone* zone) { |
| 121 HCheckTable* copy = new(phase_->zone()) HCheckTable(phase_); | 121 HCheckTable* copy = new(phase_->zone()) HCheckTable(phase_); |
| 122 for (int i = 0; i < size_; i++) { | 122 for (int i = 0; i < size_; i++) { |
| 123 HCheckTableEntry* old_entry = &entries_[i]; | 123 HCheckTableEntry* old_entry = &entries_[i]; |
| 124 HCheckTableEntry* new_entry = ©->entries_[i]; | 124 HCheckTableEntry* new_entry = ©->entries_[i]; |
| 125 // TODO(titzer): keep the check if this block dominates the successor? | 125 // TODO(titzer): keep the check if this block dominates the successor? |
| 126 new_entry->object_ = old_entry->object_; | 126 new_entry->object_ = old_entry->object_; |
| 127 new_entry->check_ = NULL; | 127 new_entry->check_ = NULL; |
| 128 new_entry->maps_ = old_entry->maps_->Copy(phase_->zone()); | 128 new_entry->maps_ = old_entry->maps_->Copy(phase_->zone()); |
| 129 } | 129 } |
| 130 copy->cursor_ = cursor_; | 130 copy->cursor_ = cursor_; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 re->maps_ = intersect->Copy(zone); | 166 re->maps_ = intersect->Copy(zone); |
| 167 } | 167 } |
| 168 } | 168 } |
| 169 // Learning on false branches requires storing negative facts. | 169 // Learning on false branches requires storing negative facts. |
| 170 } | 170 } |
| 171 | 171 |
| 172 return copy; | 172 return copy; |
| 173 } | 173 } |
| 174 | 174 |
| 175 // Global analysis: Merge this state with the other incoming state. | 175 // Global analysis: Merge this state with the other incoming state. |
| 176 HCheckTable* Merge(HBasicBlock* succ, HCheckTable* that, Zone* zone) { | 176 HCheckTable* Merge(HBasicBlock* succ, HCheckTable* that, |
| 177 HBasicBlock* that_block, Zone* zone) { |
| 177 if (that->size_ == 0) { | 178 if (that->size_ == 0) { |
| 178 // If the other state is empty, simply reset. | 179 // If the other state is empty, simply reset. |
| 179 size_ = 0; | 180 size_ = 0; |
| 180 cursor_ = 0; | 181 cursor_ = 0; |
| 181 return this; | 182 return this; |
| 182 } | 183 } |
| 183 bool compact = false; | 184 bool compact = false; |
| 184 for (int i = 0; i < size_; i++) { | 185 for (int i = 0; i < size_; i++) { |
| 185 HCheckTableEntry* this_entry = &entries_[i]; | 186 HCheckTableEntry* this_entry = &entries_[i]; |
| 186 HCheckTableEntry* that_entry = that->Find(this_entry->object_); | 187 HCheckTableEntry* that_entry = that->Find(this_entry->object_); |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 PRINT_STAT(removed_cho); | 553 PRINT_STAT(removed_cho); |
| 553 PRINT_STAT(narrowed); | 554 PRINT_STAT(narrowed); |
| 554 PRINT_STAT(loads); | 555 PRINT_STAT(loads); |
| 555 PRINT_STAT(empty); | 556 PRINT_STAT(empty); |
| 556 PRINT_STAT(compares_true); | 557 PRINT_STAT(compares_true); |
| 557 PRINT_STAT(compares_false); | 558 PRINT_STAT(compares_false); |
| 558 PRINT_STAT(transitions); | 559 PRINT_STAT(transitions); |
| 559 } | 560 } |
| 560 | 561 |
| 561 } } // namespace v8::internal | 562 } } // namespace v8::internal |
| OLD | NEW |