OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "hydrogen.h" | 31 #include "hydrogen.h" |
32 | 32 |
33 namespace v8 { | 33 namespace v8 { |
34 namespace internal { | 34 namespace internal { |
35 | 35 |
36 | 36 |
37 class HComputeMinusZeroChecksPhase : public HPhase { | 37 class HComputeMinusZeroChecksPhase : public HPhase { |
38 public: | 38 public: |
39 explicit HComputeMinusZeroChecksPhase(HGraph* graph) | 39 explicit HComputeMinusZeroChecksPhase(HGraph* graph) |
40 : HPhase("H_Compute minus zero checks", graph), | 40 : HPhase("H_Compute minus zero checks", graph), |
41 visited_(graph->GetMaximumValueID(), zone()) { } | 41 in_worklist_(graph->GetMaximumValueID(), zone()), |
| 42 worklist_(32, zone()) {} |
42 | 43 |
43 void Run(); | 44 void Run(); |
44 | 45 |
45 private: | 46 private: |
| 47 void AddToWorklist(HValue* value) { |
| 48 if (value->CheckFlag(HValue::kBailoutOnMinusZero)) return; |
| 49 if (in_worklist_.Contains(value->id())) return; |
| 50 in_worklist_.Add(value->id()); |
| 51 worklist_.Add(value, zone()); |
| 52 } |
46 void PropagateMinusZeroChecks(HValue* value); | 53 void PropagateMinusZeroChecks(HValue* value); |
47 | 54 |
48 BitVector visited_; | 55 BitVector in_worklist_; |
| 56 ZoneList<HValue*> worklist_; |
49 | 57 |
50 DISALLOW_COPY_AND_ASSIGN(HComputeMinusZeroChecksPhase); | 58 DISALLOW_COPY_AND_ASSIGN(HComputeMinusZeroChecksPhase); |
51 }; | 59 }; |
52 | 60 |
53 | 61 |
54 } } // namespace v8::internal | 62 } } // namespace v8::internal |
55 | 63 |
56 #endif // V8_HYDROGEN_MINUS_ZERO_H_ | 64 #endif // V8_HYDROGEN_MINUS_ZERO_H_ |
OLD | NEW |