| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/crankshaft/hydrogen-bce.h" | 5 #include "src/crankshaft/hydrogen-bce.h" |
| 6 | 6 |
| 7 namespace v8 { | 7 namespace v8 { |
| 8 namespace internal { | 8 namespace internal { |
| 9 | 9 |
| 10 | 10 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // Traversing the dominator tree we keep a stack (implemented as a singly | 87 // Traversing the dominator tree we keep a stack (implemented as a singly |
| 88 // linked list) of "data" for each basic block that contains a relevant check | 88 // linked list) of "data" for each basic block that contains a relevant check |
| 89 // with the same key (the dictionary holds the head of the list). | 89 // with the same key (the dictionary holds the head of the list). |
| 90 // We also keep all the "data" created for a given basic block in a list, and | 90 // We also keep all the "data" created for a given basic block in a list, and |
| 91 // use it to "clean up" the dictionary when backtracking in the dominator tree | 91 // use it to "clean up" the dictionary when backtracking in the dominator tree |
| 92 // traversal. | 92 // traversal. |
| 93 // Doing this each dictionary entry always directly points to the check that | 93 // Doing this each dictionary entry always directly points to the check that |
| 94 // is dominating the code being examined now. | 94 // is dominating the code being examined now. |
| 95 // We also track the current "offset" of the index expression and use it to | 95 // We also track the current "offset" of the index expression and use it to |
| 96 // decide if any check is already "covered" (so it can be removed) or not. | 96 // decide if any check is already "covered" (so it can be removed) or not. |
| 97 class BoundsCheckBbData: public ZoneObject { | 97 class BoundsCheckBbData : public ZoneObject { |
| 98 public: | 98 public: |
| 99 BoundsCheckKey* Key() const { return key_; } | 99 BoundsCheckKey* Key() const { return key_; } |
| 100 int32_t LowerOffset() const { return lower_offset_; } | 100 int32_t LowerOffset() const { return lower_offset_; } |
| 101 int32_t UpperOffset() const { return upper_offset_; } | 101 int32_t UpperOffset() const { return upper_offset_; } |
| 102 HBasicBlock* BasicBlock() const { return basic_block_; } | 102 HBasicBlock* BasicBlock() const { return basic_block_; } |
| 103 HBoundsCheck* LowerCheck() const { return lower_check_; } | 103 HBoundsCheck* LowerCheck() const { return lower_check_; } |
| 104 HBoundsCheck* UpperCheck() const { return upper_check_; } | 104 HBoundsCheck* UpperCheck() const { return upper_check_; } |
| 105 BoundsCheckBbData* NextInBasicBlock() const { return next_in_bb_; } | 105 BoundsCheckBbData* NextInBasicBlock() const { return next_in_bb_; } |
| 106 BoundsCheckBbData* FatherInDominatorTree() const { return father_in_dt_; } | 106 BoundsCheckBbData* FatherInDominatorTree() const { return father_in_dt_; } |
| 107 | 107 |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 table_.Insert(data->Key(), data->FatherInDominatorTree(), zone()); | 469 table_.Insert(data->Key(), data->FatherInDominatorTree(), zone()); |
| 470 } else { | 470 } else { |
| 471 table_.Delete(data->Key()); | 471 table_.Delete(data->Key()); |
| 472 } | 472 } |
| 473 data = data->NextInBasicBlock(); | 473 data = data->NextInBasicBlock(); |
| 474 } | 474 } |
| 475 } | 475 } |
| 476 | 476 |
| 477 } // namespace internal | 477 } // namespace internal |
| 478 } // namespace v8 | 478 } // namespace v8 |
| OLD | NEW |