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
3 // found in the LICENSE file.
5 #ifndef V8_HYDROGEN_BCE_H_
6 #define V8_HYDROGEN_BCE_H_
8 #include "src/hydrogen.h"
14 class BoundsCheckBbData;
16 class BoundsCheckTable : private ZoneHashMap {
18 explicit BoundsCheckTable(Zone* zone);
20 INLINE(BoundsCheckBbData** LookupOrInsert(BoundsCheckKey* key, Zone* zone));
21 INLINE(void Insert(BoundsCheckKey* key, BoundsCheckBbData* data, Zone* zone));
22 INLINE(void Delete(BoundsCheckKey* key));
25 DISALLOW_COPY_AND_ASSIGN(BoundsCheckTable);
29 class HBoundsCheckEliminationPhase : public HPhase {
31 explicit HBoundsCheckEliminationPhase(HGraph* graph)
32 : HPhase("H_Bounds checks elimination", graph), table_(zone()) { }
35 EliminateRedundantBoundsChecks(graph()->entry_block());
39 void EliminateRedundantBoundsChecks(HBasicBlock* bb);
40 BoundsCheckBbData* PreProcessBlock(HBasicBlock* bb);
41 void PostProcessBlock(HBasicBlock* bb, BoundsCheckBbData* data);
43 BoundsCheckTable table_;
45 DISALLOW_COPY_AND_ASSIGN(HBoundsCheckEliminationPhase);
49 } } // namespace v8::internal
51 #endif // V8_HYDROGEN_BCE_H_