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_MARK_DEOPTIMIZE_H_
6 #define V8_HYDROGEN_MARK_DEOPTIMIZE_H_
14 // Compute DeoptimizeOnUndefined flag for phis. Any phi that can reach a use
15 // with DeoptimizeOnUndefined set must have DeoptimizeOnUndefined set.
16 // Currently only HCompareNumericAndBranch, with double input representation,
17 // has this flag set. The flag is used by HChange tagged->double, which must
18 // deoptimize if one of its uses has this flag set.
19 class HMarkDeoptimizeOnUndefinedPhase : public HPhase {
21 explicit HMarkDeoptimizeOnUndefinedPhase(HGraph* graph)
22 : HPhase("H_Mark deoptimize on undefined", graph),
23 worklist_(16, zone()) {}
28 void ProcessPhi(HPhi* phi);
30 // Preallocated worklist used as an optimization so we don't have
31 // to allocate a new ZoneList for every ProcessPhi() invocation.
32 ZoneList<HPhi*> worklist_;
34 DISALLOW_COPY_AND_ASSIGN(HMarkDeoptimizeOnUndefinedPhase);
38 class HComputeChangeUndefinedToNaN : public HPhase {
40 explicit HComputeChangeUndefinedToNaN(HGraph* graph)
41 : HPhase("H_Compute change undefined to nan", graph) {}
46 DISALLOW_COPY_AND_ASSIGN(HComputeChangeUndefinedToNaN);
50 } } // namespace v8::internal
52 #endif // V8_HYDROGEN_MARK_DEOPTIMIZE_H_