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_CHECK_ELIMINATION_H_
6 #define V8_HYDROGEN_CHECK_ELIMINATION_H_
8 #include "src/hydrogen.h"
9 #include "src/hydrogen-alias-analysis.h"
15 // Remove CheckMaps instructions through flow- and branch-sensitive analysis.
16 class HCheckEliminationPhase : public HPhase {
18 explicit HCheckEliminationPhase(HGraph* graph)
19 : HPhase("H_Check Elimination", graph), aliasing_(),
20 string_maps_(kStringMapsSize, zone()) {
21 // Compute the set of string maps.
22 #define ADD_STRING_MAP(type, size, name, Name) \
23 string_maps_.Add(Unique<Map>::CreateImmovable( \
24 graph->isolate()->factory()->name##_map()), zone());
25 STRING_TYPE_LIST(ADD_STRING_MAP)
27 DCHECK_EQ(kStringMapsSize, string_maps_.size());
44 friend class HCheckTable;
47 const UniqueSet<Map>* string_maps() const { return &string_maps_; }
51 HAliasAnalyzer* aliasing_;
52 #define COUNT(type, size, name, Name) + 1
53 static const int kStringMapsSize = 0 STRING_TYPE_LIST(COUNT);
55 UniqueSet<Map> string_maps_;
71 } } // namespace v8::internal
73 #endif // V8_HYDROGEN_CHECK_ELIMINATION_H_