Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / v8 / src / hydrogen-check-elimination.h
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.
4
5 #ifndef V8_HYDROGEN_CHECK_ELIMINATION_H_
6 #define V8_HYDROGEN_CHECK_ELIMINATION_H_
7
8 #include "hydrogen.h"
9 #include "hydrogen-alias-analysis.h"
10
11 namespace v8 {
12 namespace internal {
13
14
15 // Remove CheckMaps instructions through flow- and branch-sensitive analysis.
16 class HCheckEliminationPhase : public HPhase {
17  public:
18   explicit HCheckEliminationPhase(HGraph* graph)
19       : HPhase("H_Check Elimination", graph), aliasing_() {
20 #ifdef DEBUG
21     redundant_ = 0;
22     removed_ = 0;
23     removed_cho_ = 0;
24     narrowed_ = 0;
25     loads_ = 0;
26     empty_ = 0;
27     compares_true_ = 0;
28     compares_false_ = 0;
29     transitions_ = 0;
30 #endif
31   }
32
33   void Run();
34
35   friend class HCheckTable;
36
37  private:
38   void PrintStats();
39
40   HAliasAnalyzer* aliasing_;
41 #ifdef DEBUG
42   int redundant_;
43   int removed_;
44   int removed_cho_;
45   int narrowed_;
46   int loads_;
47   int empty_;
48   int compares_true_;
49   int compares_false_;
50   int transitions_;
51 #endif
52 };
53
54
55 } }  // namespace v8::internal
56
57 #endif  // V8_HYDROGEN_CHECK_ELIMINATION_H_